@thurinlabs/identity-kit 1.3.3 → 1.3.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.
package/dist/index.cjs CHANGED
@@ -56,7 +56,10 @@
56
56
 
57
57
 
58
58
 
59
- var _chunkCIMLLM5Ncjs = require('./chunk-CIMLLM5N.cjs');
59
+
60
+
61
+
62
+ var _chunkYTO7Z5SIcjs = require('./chunk-YTO7Z5SI.cjs');
60
63
 
61
64
  // src/provider.tsx
62
65
  var _react = require('react');
@@ -86,7 +89,7 @@ var defaultQueryClient = new (0, _reactquery.QueryClient)({
86
89
  }
87
90
  });
88
91
  function createDefaultWagmiConfig(rpcUrl, network) {
89
- const url = rpcUrl || _chunkCIMLLM5Ncjs.getRegistry.call(void 0, network).defaultRpcUrl;
92
+ const url = rpcUrl || _chunkYTO7Z5SIcjs.getRegistry.call(void 0, network).defaultRpcUrl;
90
93
  if (network === "sepolia") return _wagmi.createConfig.call(void 0, { chains: [_chains.sepolia], transports: { [_chains.sepolia.id]: _wagmi.http.call(void 0, url) } });
91
94
  if (network === "local") return _wagmi.createConfig.call(void 0, { chains: [_chains.foundry], transports: { [_chains.foundry.id]: _wagmi.http.call(void 0, url) } });
92
95
  return _wagmi.createConfig.call(void 0, { chains: [_chains.mainnet], transports: { [_chains.mainnet.id]: _wagmi.http.call(void 0, url) } });
@@ -121,6 +124,7 @@ function IdentityKitProvider({
121
124
 
122
125
  // src/hooks/useThurinIdentity.ts
123
126
 
127
+
124
128
  var _ens = require('viem/ens');
125
129
 
126
130
  // src/hooks/useAttestations.ts
@@ -129,12 +133,12 @@ var _ens = require('viem/ens');
129
133
  var _viem = require('viem');
130
134
  function useAttestations(address) {
131
135
  const config = useIdentityKitConfig();
132
- const registry = _chunkCIMLLM5Ncjs.getRegistry.call(void 0, config.network, config.registryAddress);
133
- const chain = _chunkCIMLLM5Ncjs.chainFor.call(void 0, config.network);
136
+ const registry = _chunkYTO7Z5SIcjs.getRegistry.call(void 0, config.network, config.registryAddress);
137
+ const chain = _chunkYTO7Z5SIcjs.chainFor.call(void 0, config.network);
134
138
  const owner = address;
135
- const { data: rows, isLoading: rowsLoading } = _wagmi.useReadContract.call(void 0, {
139
+ const { data: rows, isLoading: rowsLoading, isFetched: rowsFetched, error: rowsError, refetch: refetchRows } = _wagmi.useReadContract.call(void 0, {
136
140
  address: registry.address,
137
- abi: _chunkCIMLLM5Ncjs.REGISTRY_ABI,
141
+ abi: _chunkYTO7Z5SIcjs.REGISTRY_ABI,
138
142
  functionName: "attestationsOf",
139
143
  args: owner ? [owner] : void 0,
140
144
  chainId: chain.id,
@@ -143,12 +147,12 @@ function useAttestations(address) {
143
147
  const count = _nullishCoalesce(_optionalChain([rows, 'optionalAccess', _2 => _2.length]), () => ( 0));
144
148
  const contracts = owner && rows ? rows.map((_, i) => ({
145
149
  address: registry.address,
146
- abi: _chunkCIMLLM5Ncjs.REGISTRY_ABI,
150
+ abi: _chunkYTO7Z5SIcjs.REGISTRY_ABI,
147
151
  functionName: "getPayload",
148
152
  args: [owner, BigInt(i)],
149
153
  chainId: chain.id
150
154
  })) : [];
151
- const { data: payloads, isLoading: payloadsLoading } = _wagmi.useReadContracts.call(void 0, {
155
+ const { data: payloads, isLoading: payloadsLoading, error: payloadsError, refetch: refetchPayloads } = _wagmi.useReadContracts.call(void 0, {
152
156
  contracts,
153
157
  query: { enabled: contracts.length > 0 }
154
158
  });
@@ -168,8 +172,8 @@ function useAttestations(address) {
168
172
  pgpSignature = _viem.hexToString.call(void 0, sigHex);
169
173
  pgpPublicKey = _viem.hexToString.call(void 0, keyHex);
170
174
  }
171
- const fingerprint = _chunkCIMLLM5Ncjs.bytesToFingerprint.call(void 0, row.fingerprint);
172
- const verification = pgpPublicKey && pgpSignature ? await _chunkCIMLLM5Ncjs.verifyAttestation.call(void 0, { pgpPublicKey, pgpSignature, fingerprint, ethAddress: address }) : null;
175
+ const fingerprint = _chunkYTO7Z5SIcjs.bytesToFingerprint.call(void 0, row.fingerprint);
176
+ const verification = pgpPublicKey && pgpSignature ? await _chunkYTO7Z5SIcjs.verifyAttestation.call(void 0, { pgpPublicKey, pgpSignature, fingerprint, ethAddress: address }) : null;
173
177
  const revokedAt = Number(row.revokedAt);
174
178
  results.push({
175
179
  index: i,
@@ -188,7 +192,7 @@ function useAttestations(address) {
188
192
  enabled: !!rows && payloadsReady,
189
193
  staleTime: 3e5
190
194
  });
191
- const isLoading = rowsLoading || payloadsLoading || verifyLoading || !!owner && rows !== void 0 && !payloadsReady;
195
+ const isLoading = rowsLoading || !!owner && !rowsFetched || payloadsLoading || verifyLoading || !!owner && rows !== void 0 && !payloadsReady;
192
196
  const activeClaims = (claims || []).filter((c) => !c.revoked);
193
197
  const verifiedClaims = activeClaims.filter((c) => _optionalChain([c, 'access', _4 => _4.verification, 'optionalAccess', _5 => _5.verified]));
194
198
  const currentFingerprint = verifiedClaims.length > 0 ? verifiedClaims[verifiedClaims.length - 1].fingerprint : null;
@@ -197,7 +201,15 @@ function useAttestations(address) {
197
201
  totalClaims: count,
198
202
  activeClaims: activeClaims.length,
199
203
  currentFingerprint,
200
- isLoading
204
+ isLoading,
205
+ /** A registry read failed (the RPC may be down; useThurinIdentity finds out which). */
206
+ error: _nullishCoalesce(_nullishCoalesce(rowsError, () => ( payloadsError)), () => ( null)),
207
+ refetch: () => {
208
+ if (owner) {
209
+ refetchRows();
210
+ if (contracts.length > 0) refetchPayloads();
211
+ }
212
+ }
201
213
  };
202
214
  }
203
215
 
@@ -206,7 +218,7 @@ function useAttestations(address) {
206
218
  function useEFPGraph(address) {
207
219
  const { data, isLoading } = _reactquery.useQuery.call(void 0, {
208
220
  queryKey: ["efp-graph", address],
209
- queryFn: () => _chunkCIMLLM5Ncjs.fetchEFPGraph.call(void 0, address),
221
+ queryFn: () => _chunkYTO7Z5SIcjs.fetchEFPGraph.call(void 0, address),
210
222
  enabled: !!address,
211
223
  staleTime: 3e5
212
224
  });
@@ -226,19 +238,19 @@ function usePGPProofs(fingerprint, armoredKey) {
226
238
  queryKey: ["pgp-proofs", fingerprint, _nullishCoalesce(_optionalChain([armoredKey, 'optionalAccess', _6 => _6.length]), () => ( 0))],
227
239
  queryFn: async () => {
228
240
  if (!fingerprint || !armoredKey) return { keyInfo: null, proofs: [] };
229
- const keyInfo = await _chunkCIMLLM5Ncjs.parsePgpKey.call(void 0, armoredKey);
241
+ const keyInfo = await _chunkYTO7Z5SIcjs.parsePgpKey.call(void 0, armoredKey);
230
242
  if (!keyInfo) return { keyInfo: null, proofs: [] };
231
- const identified = keyInfo.notations.map((n) => _chunkCIMLLM5Ncjs.identifyProof.call(void 0, n)).filter((p) => p !== null && p.provider !== "unknown");
243
+ const identified = keyInfo.notations.map((n) => _chunkYTO7Z5SIcjs.identifyProof.call(void 0, n)).filter((p) => p !== null && p.provider !== "unknown");
232
244
  const proofs = await Promise.all(
233
245
  identified.map(async (proof) => {
234
- const result = await _chunkCIMLLM5Ncjs.verifyProof.call(void 0, proof, fingerprint, config.neynarApiKey);
246
+ const result = await _chunkYTO7Z5SIcjs.verifyProof.call(void 0, proof, fingerprint, config.neynarApiKey);
235
247
  return {
236
248
  provider: proof.provider,
237
249
  label: proof.label,
238
250
  url: proof.url,
239
- displayUrl: _chunkCIMLLM5Ncjs.displayUrl.call(void 0, proof),
240
- href: _chunkCIMLLM5Ncjs.proofHref.call(void 0, proof),
241
- secondaryHref: _chunkCIMLLM5Ncjs.proofSecondaryHref.call(void 0, proof),
251
+ displayUrl: _chunkYTO7Z5SIcjs.displayUrl.call(void 0, proof),
252
+ href: _chunkYTO7Z5SIcjs.proofHref.call(void 0, proof),
253
+ secondaryHref: _chunkYTO7Z5SIcjs.proofSecondaryHref.call(void 0, proof),
242
254
  status: result.verified ? "verified" : "unverified",
243
255
  reason: result.reason
244
256
  };
@@ -273,11 +285,11 @@ function usePGPProofs(fingerprint, armoredKey) {
273
285
 
274
286
  function useSafeAvatar(name, chainId) {
275
287
  const { data: raw } = _wagmi.useEnsText.call(void 0, { name, key: "avatar", chainId, query: { enabled: !!name } });
276
- const direct = _chunkCIMLLM5Ncjs.avatarUrl.call(void 0, raw);
277
- const nft = direct ? null : _chunkCIMLLM5Ncjs.parseNftAvatar.call(void 0, raw);
288
+ const direct = _chunkYTO7Z5SIcjs.avatarUrl.call(void 0, raw);
289
+ const nft = direct ? null : _chunkYTO7Z5SIcjs.parseNftAvatar.call(void 0, raw);
278
290
  const { data: tokenUri } = _wagmi.useReadContract.call(void 0, {
279
291
  address: _optionalChain([nft, 'optionalAccess', _9 => _9.contract]),
280
- abi: _chunkCIMLLM5Ncjs.NFT_AVATAR_ABI,
292
+ abi: _chunkYTO7Z5SIcjs.NFT_AVATAR_ABI,
281
293
  functionName: _optionalChain([nft, 'optionalAccess', _10 => _10.standard]) === "erc1155" ? "uri" : "tokenURI",
282
294
  args: nft ? [nft.tokenId] : void 0,
283
295
  chainId,
@@ -285,7 +297,7 @@ function useSafeAvatar(name, chainId) {
285
297
  });
286
298
  const { data: image } = _reactquery.useQuery.call(void 0, {
287
299
  queryKey: ["thurin-nft-avatar", tokenUri, _optionalChain([nft, 'optionalAccess', _11 => _11.tokenId, 'access', _12 => _12.toString, 'call', _13 => _13()])],
288
- queryFn: () => _chunkCIMLLM5Ncjs.nftAvatarImage.call(void 0, tokenUri, nft.tokenId).catch(() => null),
300
+ queryFn: () => _chunkYTO7Z5SIcjs.nftAvatarImage.call(void 0, tokenUri, nft.tokenId).catch(() => null),
289
301
  enabled: typeof tokenUri === "string" && !!nft
290
302
  });
291
303
  return _nullishCoalesce(_nullishCoalesce(direct, () => ( image)), () => ( null));
@@ -303,10 +315,10 @@ function safeNormalize(name) {
303
315
  }
304
316
  }
305
317
  function useThurinIdentity(ensOrAddress) {
306
- const chain = _chunkCIMLLM5Ncjs.chainFor.call(void 0, useIdentityKitConfig().network);
318
+ const chain = _chunkYTO7Z5SIcjs.chainFor.call(void 0, useIdentityKitConfig().network);
307
319
  const isAddr = ensOrAddress ? isAddress(ensOrAddress) : false;
308
320
  const ensInput = ensOrAddress && !isAddr ? safeNormalize(ensOrAddress) : void 0;
309
- const { data: resolvedAddress } = _wagmi.useEnsAddress.call(void 0, {
321
+ const { data: resolvedAddress, error: ensError, isFetched: ensFetched, refetch: refetchEns } = _wagmi.useEnsAddress.call(void 0, {
310
322
  name: ensInput,
311
323
  chainId: chain.id,
312
324
  query: { enabled: !!ensInput }
@@ -324,7 +336,9 @@ function useThurinIdentity(ensOrAddress) {
324
336
  totalClaims,
325
337
  activeClaims,
326
338
  currentFingerprint,
327
- isLoading: claimsLoading
339
+ isLoading: claimsLoading,
340
+ error: claimsError,
341
+ refetch: refetchClaims
328
342
  } = useAttestations(address);
329
343
  const currentClaim = [...claims].reverse().find(
330
344
  (c) => !c.revoked && _optionalChain([c, 'access', _14 => _14.verification, 'optionalAccess', _15 => _15.verified]) && c.fingerprint === currentFingerprint
@@ -335,6 +349,24 @@ function useThurinIdentity(ensOrAddress) {
335
349
  isLoading: proofsLoading
336
350
  } = usePGPProofs(currentFingerprint, _nullishCoalesce(_optionalChain([currentClaim, 'optionalAccess', _16 => _16.pgpPublicKey]), () => ( null)));
337
351
  const { efp, isLoading: efpLoading } = useEFPGraph(address);
352
+ const lookup = { ensEmpty: !!ensInput && ensFetched && !resolvedAddress, ensFailed: !!ensError, claimsFailed: !!claimsError };
353
+ const probeNeeded = _chunkYTO7Z5SIcjs.needsRpcProbe.call(void 0, lookup);
354
+ const client = _wagmi.usePublicClient.call(void 0, { chainId: chain.id });
355
+ const probe = _reactquery.useQuery.call(void 0, {
356
+ queryKey: ["thurin-rpc-probe", chain.id, ensOrAddress],
357
+ queryFn: () => client.getBlockNumber(),
358
+ enabled: probeNeeded && !!client,
359
+ retry: 0,
360
+ staleTime: 0
361
+ });
362
+ const rpcAnswered = !probeNeeded || probe.isFetching ? void 0 : probe.isSuccess ? true : probe.isError ? false : void 0;
363
+ const errorKind = _chunkYTO7Z5SIcjs.identityErrorKind.call(void 0, { ...lookup, rpcAnswered });
364
+ const probing = probeNeeded && rpcAnswered === void 0;
365
+ const retry = () => {
366
+ if (ensInput) refetchEns();
367
+ refetchClaims();
368
+ if (probeNeeded) probe.refetch();
369
+ };
338
370
  return {
339
371
  address,
340
372
  ensName: displayName,
@@ -346,8 +378,12 @@ function useThurinIdentity(ensOrAddress) {
346
378
  pgpKeyInfo,
347
379
  proofs,
348
380
  efp,
349
- isLoading: claimsLoading || proofsLoading || efpLoading,
350
- error: null
381
+ // "Not finished" counts as loading, including queries paused in a background tab: the card
382
+ // must not render defaults (zeros) for an identity it hasn't looked up yet.
383
+ isLoading: !!ensInput && !ensFetched || claimsLoading || proofsLoading || efpLoading || probing,
384
+ error: errorKind ? new Error(_chunkYTO7Z5SIcjs.IDENTITY_ERROR_TEXT[errorKind]) : null,
385
+ errorKind,
386
+ retry
351
387
  };
352
388
  }
353
389
 
@@ -371,8 +407,21 @@ function ThurinCard({ ens, address, theme = "thurin" }) {
371
407
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "thurin-card", "data-thurin-theme": theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "thurin-card-loading", children: "Loading identity..." }) });
372
408
  }
373
409
  const displayAddress = identity.address || null;
410
+ if (identity.errorKind) {
411
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "thurin-card", "data-thurin-theme": theme, children: [
412
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "thurin-card-header", children: [
413
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThurinLogo, {}),
414
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "thurin-card-name", children: identity.ensName || ens || address }) })
415
+ ] }),
416
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "thurin-card-error", role: "status", children: [
417
+ _optionalChain([identity, 'access', _17 => _17.error, 'optionalAccess', _18 => _18.message]),
418
+ identity.errorKind !== "not-found" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "thurin-card-retry", onClick: identity.retry, children: "Try again" })
419
+ ] }),
420
+ profileUrl && identity.errorKind !== "not-found" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className: "thurin-card-link", href: profileUrl, target: "_blank", rel: "noopener noreferrer", children: "View on Thurin" })
421
+ ] });
422
+ }
374
423
  const verifiedProofs = identity.proofs.filter((p) => p.status === "verified").length;
375
- const hasVerifiedPgp = identity.claims.some((c) => _optionalChain([c, 'access', _17 => _17.verification, 'optionalAccess', _18 => _18.verified]) && !c.revoked);
424
+ const hasVerifiedPgp = identity.claims.some((c) => _optionalChain([c, 'access', _19 => _19.verification, 'optionalAccess', _20 => _20.verified]) && !c.revoked);
376
425
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "thurin-card", "data-thurin-theme": theme, children: [
377
426
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "a", { className: "thurin-card-header", href: profileUrl || void 0, target: "_blank", rel: "noopener noreferrer", children: [
378
427
  identity.ensAvatar ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -398,7 +447,7 @@ function ThurinCard({ ens, address, theme = "thurin" }) {
398
447
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "thurin-card-stat-label", children: "Proofs" })
399
448
  ] }),
400
449
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "thurin-card-stat", children: [
401
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "thurin-card-stat-value", children: _nullishCoalesce(_optionalChain([identity, 'access', _19 => _19.efp, 'optionalAccess', _20 => _20.followers]), () => ( 0)) }),
450
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "thurin-card-stat-value", children: identity.efp ? identity.efp.followers : "\u2013" }),
402
451
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "thurin-card-stat-label", children: "Followers" })
403
452
  ] })
404
453
  ] }),
@@ -438,15 +487,15 @@ function safeNormalize2(name) {
438
487
  }
439
488
  }
440
489
  function useEnsHint(name, verifiedFingerprint) {
441
- const chain = _chunkCIMLLM5Ncjs.chainFor.call(void 0, useIdentityKitConfig().network);
490
+ const chain = _chunkYTO7Z5SIcjs.chainFor.call(void 0, useIdentityKitConfig().network);
442
491
  const ensName = name ? safeNormalize2(name) : void 0;
443
492
  const { data, isLoading, refetch } = _wagmi.useEnsText.call(void 0, {
444
493
  name: ensName,
445
- key: _chunkCIMLLM5Ncjs.ENS_HINT_KEY,
494
+ key: _chunkYTO7Z5SIcjs.ENS_HINT_KEY,
446
495
  chainId: chain.id,
447
496
  query: { enabled: !!ensName }
448
497
  });
449
- return { ..._chunkCIMLLM5Ncjs.ensHintFor.call(void 0, _nullishCoalesce(data, () => ( null)), verifiedFingerprint), isLoading: !!ensName && isLoading, refetch: () => {
498
+ return { ..._chunkYTO7Z5SIcjs.ensHintFor.call(void 0, _nullishCoalesce(data, () => ( null)), verifiedFingerprint), isLoading: !!ensName && isLoading, refetch: () => {
450
499
  void refetch();
451
500
  } };
452
501
  }
@@ -454,20 +503,20 @@ function useEnsHint(name, verifiedFingerprint) {
454
503
  // src/hooks/useRecords.ts
455
504
 
456
505
 
457
- function useRecords(address, index, kinds = _chunkCIMLLM5Ncjs.IDENTITY_KINDS, armoredKey) {
506
+ function useRecords(address, index, kinds = _chunkYTO7Z5SIcjs.IDENTITY_KINDS, armoredKey) {
458
507
  const config = useIdentityKitConfig();
459
- const registry = _chunkCIMLLM5Ncjs.getRegistry.call(void 0, config.network, config.registryAddress);
460
- const chain = _chunkCIMLLM5Ncjs.chainFor.call(void 0, config.network);
508
+ const registry = _chunkYTO7Z5SIcjs.getRegistry.call(void 0, config.network, config.registryAddress);
509
+ const chain = _chunkYTO7Z5SIcjs.chainFor.call(void 0, config.network);
461
510
  const owner = address;
462
511
  const enabled = !!owner && index !== void 0 && index !== null;
463
- const contracts = enabled ? kinds.map((kind) => ({ address: registry.address, abi: _chunkCIMLLM5Ncjs.REGISTRY_ABI, functionName: "record", args: [owner, BigInt(index), _chunkCIMLLM5Ncjs.recordKind.call(void 0, kind)], chainId: chain.id })) : [];
512
+ const contracts = enabled ? kinds.map((kind) => ({ address: registry.address, abi: _chunkYTO7Z5SIcjs.REGISTRY_ABI, functionName: "record", args: [owner, BigInt(index), _chunkYTO7Z5SIcjs.recordKind.call(void 0, kind)], chainId: chain.id })) : [];
464
513
  const { data: raw, isLoading: readLoading, refetch } = _wagmi.useReadContracts.call(void 0, { contracts, query: { enabled: contracts.length > 0 } });
465
- const texts = (_nullishCoalesce(raw, () => ( []))).map((r) => r.status === "success" ? _chunkCIMLLM5Ncjs.decodeRecord.call(void 0, r.result) : "");
514
+ const texts = (_nullishCoalesce(raw, () => ( []))).map((r) => r.status === "success" ? _chunkYTO7Z5SIcjs.decodeRecord.call(void 0, r.result) : "");
466
515
  const { data: records, isLoading: parseLoading } = _reactquery.useQuery.call(void 0, {
467
516
  queryKey: ["records", config.network, registry.address, address, index, kinds.join(","), texts.join(" "), _nullishCoalesce(armoredKey, () => ( ""))],
468
517
  queryFn: async () => {
469
518
  const out = [];
470
- for (let i = 0; i < kinds.length; i++) if (texts[i]) out.push(await _chunkCIMLLM5Ncjs.parseRecord.call(void 0, kinds[i], texts[i], { armoredKey: _nullishCoalesce(armoredKey, () => ( void 0)) }));
519
+ for (let i = 0; i < kinds.length; i++) if (texts[i]) out.push(await _chunkYTO7Z5SIcjs.parseRecord.call(void 0, kinds[i], texts[i], { armoredKey: _nullishCoalesce(armoredKey, () => ( void 0)) }));
471
520
  return out;
472
521
  },
473
522
  enabled: enabled && raw !== void 0
@@ -543,5 +592,8 @@ function useRecords(address, index, kinds = _chunkCIMLLM5Ncjs.IDENTITY_KINDS, ar
543
592
 
544
593
 
545
594
 
546
- exports.ARWEAVE_GATEWAY = _chunkCIMLLM5Ncjs.ARWEAVE_GATEWAY; exports.AUTHORIZATION_TYPES = _chunkCIMLLM5Ncjs.AUTHORIZATION_TYPES; exports.EIP712_NAME = _chunkCIMLLM5Ncjs.EIP712_NAME; exports.EIP712_VERSION = _chunkCIMLLM5Ncjs.EIP712_VERSION; exports.ENS_HINT_KEY = _chunkCIMLLM5Ncjs.ENS_HINT_KEY; exports.ENS_TEXT_RESOLVER_ABI = _chunkCIMLLM5Ncjs.ENS_TEXT_RESOLVER_ABI; exports.IDENTITY_KINDS = _chunkCIMLLM5Ncjs.IDENTITY_KINDS; exports.IPFS_GATEWAY = _chunkCIMLLM5Ncjs.IPFS_GATEWAY; exports.IdentityKitProvider = IdentityKitProvider; exports.KNOWN_KINDS = _chunkCIMLLM5Ncjs.KNOWN_KINDS; exports.MAX_RECORD_BYTES = _chunkCIMLLM5Ncjs.MAX_RECORD_BYTES; exports.NETWORKS = _chunkCIMLLM5Ncjs.NETWORKS; exports.NFT_AVATAR_ABI = _chunkCIMLLM5Ncjs.NFT_AVATAR_ABI; exports.REGISTRY_ABI = _chunkCIMLLM5Ncjs.REGISTRY_ABI; exports.REGISTRY_ADDRESS = _chunkCIMLLM5Ncjs.REGISTRY_ADDRESS; exports.ThurinCard = ThurinCard; exports.addPointer = _chunkCIMLLM5Ncjs.addPointer; exports.attestTypedData = _chunkCIMLLM5Ncjs.attestTypedData; exports.authorizationDigest = _chunkCIMLLM5Ncjs.authorizationDigest; exports.avatarUrl = _chunkCIMLLM5Ncjs.avatarUrl; exports.bytesToFingerprint = _chunkCIMLLM5Ncjs.bytesToFingerprint; exports.chainFor = _chunkCIMLLM5Ncjs.chainFor; exports.decodeRecord = _chunkCIMLLM5Ncjs.decodeRecord; exports.displayUrl = _chunkCIMLLM5Ncjs.displayUrl; exports.encodeRecord = _chunkCIMLLM5Ncjs.encodeRecord; exports.ensHintFor = _chunkCIMLLM5Ncjs.ensHintFor; exports.ensHintValue = _chunkCIMLLM5Ncjs.ensHintValue; exports.ensHintWrite = _chunkCIMLLM5Ncjs.ensHintWrite; exports.fetchEFPGraph = _chunkCIMLLM5Ncjs.fetchEFPGraph; exports.fetchEnsHint = _chunkCIMLLM5Ncjs.fetchEnsHint; exports.fetchRecords = _chunkCIMLLM5Ncjs.fetchRecords; exports.fingerprintHash = _chunkCIMLLM5Ncjs.fingerprintHash; exports.fingerprintToBytes = _chunkCIMLLM5Ncjs.fingerprintToBytes; exports.getRegistry = _chunkCIMLLM5Ncjs.getRegistry; exports.hasEmailUserID = _chunkCIMLLM5Ncjs.hasEmailUserID; exports.identifyProof = _chunkCIMLLM5Ncjs.identifyProof; exports.isNetworkName = _chunkCIMLLM5Ncjs.isNetworkName; exports.keyIdOf = _chunkCIMLLM5Ncjs.keyIdOf; exports.keyIdToBytes = _chunkCIMLLM5Ncjs.keyIdToBytes; exports.kindName = _chunkCIMLLM5Ncjs.kindName; exports.nftAvatarImage = _chunkCIMLLM5Ncjs.nftAvatarImage; exports.normalizeFingerprint = _chunkCIMLLM5Ncjs.normalizeFingerprint; exports.parseNftAvatar = _chunkCIMLLM5Ncjs.parseNftAvatar; exports.parsePgpKey = _chunkCIMLLM5Ncjs.parsePgpKey; exports.parsePointer = _chunkCIMLLM5Ncjs.parsePointer; exports.parseRecord = _chunkCIMLLM5Ncjs.parseRecord; exports.proofHref = _chunkCIMLLM5Ncjs.proofHref; exports.proofSecondaryHref = _chunkCIMLLM5Ncjs.proofSecondaryHref; exports.reattestTypedData = _chunkCIMLLM5Ncjs.reattestTypedData; exports.recordKind = _chunkCIMLLM5Ncjs.recordKind; exports.registryDomain = _chunkCIMLLM5Ncjs.registryDomain; exports.renderPointer = _chunkCIMLLM5Ncjs.renderPointer; exports.revokeTypedData = _chunkCIMLLM5Ncjs.revokeTypedData; exports.setRecordTypedData = _chunkCIMLLM5Ncjs.setRecordTypedData; exports.stripEmailUserIDs = _chunkCIMLLM5Ncjs.stripEmailUserIDs; exports.updateKeyTypedData = _chunkCIMLLM5Ncjs.updateKeyTypedData; exports.useAttestations = useAttestations; exports.useEFPGraph = useEFPGraph; exports.useEnsHint = useEnsHint; exports.usePGPProofs = usePGPProofs; exports.useRecords = useRecords; exports.useSafeAvatar = useSafeAvatar; exports.useThurinIdentity = useThurinIdentity; exports.verifyAttestation = _chunkCIMLLM5Ncjs.verifyAttestation; exports.verifyClearsigned = _chunkCIMLLM5Ncjs.verifyClearsigned; exports.verifyProof = _chunkCIMLLM5Ncjs.verifyProof;
595
+
596
+
597
+
598
+ exports.ARWEAVE_GATEWAY = _chunkYTO7Z5SIcjs.ARWEAVE_GATEWAY; exports.AUTHORIZATION_TYPES = _chunkYTO7Z5SIcjs.AUTHORIZATION_TYPES; exports.EIP712_NAME = _chunkYTO7Z5SIcjs.EIP712_NAME; exports.EIP712_VERSION = _chunkYTO7Z5SIcjs.EIP712_VERSION; exports.ENS_HINT_KEY = _chunkYTO7Z5SIcjs.ENS_HINT_KEY; exports.ENS_TEXT_RESOLVER_ABI = _chunkYTO7Z5SIcjs.ENS_TEXT_RESOLVER_ABI; exports.IDENTITY_ERROR_TEXT = _chunkYTO7Z5SIcjs.IDENTITY_ERROR_TEXT; exports.IDENTITY_KINDS = _chunkYTO7Z5SIcjs.IDENTITY_KINDS; exports.IPFS_GATEWAY = _chunkYTO7Z5SIcjs.IPFS_GATEWAY; exports.IdentityKitProvider = IdentityKitProvider; exports.KNOWN_KINDS = _chunkYTO7Z5SIcjs.KNOWN_KINDS; exports.MAX_RECORD_BYTES = _chunkYTO7Z5SIcjs.MAX_RECORD_BYTES; exports.NETWORKS = _chunkYTO7Z5SIcjs.NETWORKS; exports.NFT_AVATAR_ABI = _chunkYTO7Z5SIcjs.NFT_AVATAR_ABI; exports.REGISTRY_ABI = _chunkYTO7Z5SIcjs.REGISTRY_ABI; exports.REGISTRY_ADDRESS = _chunkYTO7Z5SIcjs.REGISTRY_ADDRESS; exports.ThurinCard = ThurinCard; exports.addPointer = _chunkYTO7Z5SIcjs.addPointer; exports.attestTypedData = _chunkYTO7Z5SIcjs.attestTypedData; exports.authorizationDigest = _chunkYTO7Z5SIcjs.authorizationDigest; exports.avatarUrl = _chunkYTO7Z5SIcjs.avatarUrl; exports.bytesToFingerprint = _chunkYTO7Z5SIcjs.bytesToFingerprint; exports.chainFor = _chunkYTO7Z5SIcjs.chainFor; exports.decodeRecord = _chunkYTO7Z5SIcjs.decodeRecord; exports.displayUrl = _chunkYTO7Z5SIcjs.displayUrl; exports.encodeRecord = _chunkYTO7Z5SIcjs.encodeRecord; exports.ensHintFor = _chunkYTO7Z5SIcjs.ensHintFor; exports.ensHintValue = _chunkYTO7Z5SIcjs.ensHintValue; exports.ensHintWrite = _chunkYTO7Z5SIcjs.ensHintWrite; exports.fetchEFPGraph = _chunkYTO7Z5SIcjs.fetchEFPGraph; exports.fetchEnsHint = _chunkYTO7Z5SIcjs.fetchEnsHint; exports.fetchRecords = _chunkYTO7Z5SIcjs.fetchRecords; exports.fingerprintHash = _chunkYTO7Z5SIcjs.fingerprintHash; exports.fingerprintToBytes = _chunkYTO7Z5SIcjs.fingerprintToBytes; exports.getRegistry = _chunkYTO7Z5SIcjs.getRegistry; exports.hasEmailUserID = _chunkYTO7Z5SIcjs.hasEmailUserID; exports.identifyProof = _chunkYTO7Z5SIcjs.identifyProof; exports.identityErrorKind = _chunkYTO7Z5SIcjs.identityErrorKind; exports.isNetworkName = _chunkYTO7Z5SIcjs.isNetworkName; exports.keyIdOf = _chunkYTO7Z5SIcjs.keyIdOf; exports.keyIdToBytes = _chunkYTO7Z5SIcjs.keyIdToBytes; exports.kindName = _chunkYTO7Z5SIcjs.kindName; exports.needsRpcProbe = _chunkYTO7Z5SIcjs.needsRpcProbe; exports.nftAvatarImage = _chunkYTO7Z5SIcjs.nftAvatarImage; exports.normalizeFingerprint = _chunkYTO7Z5SIcjs.normalizeFingerprint; exports.parseNftAvatar = _chunkYTO7Z5SIcjs.parseNftAvatar; exports.parsePgpKey = _chunkYTO7Z5SIcjs.parsePgpKey; exports.parsePointer = _chunkYTO7Z5SIcjs.parsePointer; exports.parseRecord = _chunkYTO7Z5SIcjs.parseRecord; exports.proofHref = _chunkYTO7Z5SIcjs.proofHref; exports.proofSecondaryHref = _chunkYTO7Z5SIcjs.proofSecondaryHref; exports.reattestTypedData = _chunkYTO7Z5SIcjs.reattestTypedData; exports.recordKind = _chunkYTO7Z5SIcjs.recordKind; exports.registryDomain = _chunkYTO7Z5SIcjs.registryDomain; exports.renderPointer = _chunkYTO7Z5SIcjs.renderPointer; exports.revokeTypedData = _chunkYTO7Z5SIcjs.revokeTypedData; exports.setRecordTypedData = _chunkYTO7Z5SIcjs.setRecordTypedData; exports.stripEmailUserIDs = _chunkYTO7Z5SIcjs.stripEmailUserIDs; exports.updateKeyTypedData = _chunkYTO7Z5SIcjs.updateKeyTypedData; exports.useAttestations = useAttestations; exports.useEFPGraph = useEFPGraph; exports.useEnsHint = useEnsHint; exports.usePGPProofs = usePGPProofs; exports.useRecords = useRecords; exports.useSafeAvatar = useSafeAvatar; exports.useThurinIdentity = useThurinIdentity; exports.verifyAttestation = _chunkYTO7Z5SIcjs.verifyAttestation; exports.verifyClearsigned = _chunkYTO7Z5SIcjs.verifyClearsigned; exports.verifyProof = _chunkYTO7Z5SIcjs.verifyProof;
547
599
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/ben/code/thurinlabs/identity-kit/dist/index.cjs","../src/provider.tsx","../src/context.ts","../src/hooks/useThurinIdentity.ts","../src/hooks/useAttestations.ts","../src/hooks/useEFPGraph.ts","../src/hooks/usePGPProofs.ts","../src/hooks/useSafeAvatar.ts","../src/components/ThurinCard/ThurinCard.tsx","../src/hooks/useEnsHint.ts","../src/hooks/useRecords.ts"],"names":["useQuery","jsx","safeNormalize","normalize"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/ben/code/thurinlabs/identity-kit/dist/index.cjs","sourcesContent":[null,"import { type ReactNode, useMemo } from 'react'\nimport { WagmiProvider, createConfig, http, useConfig } from 'wagmi'\nimport { mainnet, sepolia, foundry } from 'wagmi/chains'\nimport { getRegistry } from './core/contract'\nimport type { NetworkName } from './core/contract'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { IdentityKitContext } from './context'\nimport type { IdentityKitConfig } from './core/types'\n\nconst defaultQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60_000,\n retry: 1,\n },\n },\n})\n\nexport { chainFor } from './core/contract'\n\nfunction createDefaultWagmiConfig(rpcUrl: string | undefined, network: NetworkName) {\n const url = rpcUrl || getRegistry(network).defaultRpcUrl\n // Spelled out per network: wagmi types `transports` by the exact chain ids.\n if (network === 'sepolia') return createConfig({ chains: [sepolia], transports: { [sepolia.id]: http(url) } })\n if (network === 'local') return createConfig({ chains: [foundry], transports: { [foundry.id]: http(url) } })\n return createConfig({ chains: [mainnet], transports: { [mainnet.id]: http(url) } })\n}\n\nfunction WagmiDetector({ children, rpcUrl, network }: { children: ReactNode; rpcUrl?: string; network: NetworkName }) {\n // Try to use existing wagmi config\n let hasWagmi = false\n try {\n useConfig()\n hasWagmi = true\n } catch {\n // No WagmiProvider above us\n }\n\n const wagmiConfig = useMemo(() => createDefaultWagmiConfig(rpcUrl, network), [rpcUrl, network])\n\n if (hasWagmi) {\n return <>{children}</>\n }\n\n return (\n <WagmiProvider config={wagmiConfig}>\n <QueryClientProvider client={defaultQueryClient}>\n {children}\n </QueryClientProvider>\n </WagmiProvider>\n )\n}\n\nexport interface IdentityKitProviderProps extends IdentityKitConfig {\n children: ReactNode\n}\n\nexport function IdentityKitProvider({\n children,\n rpcUrl,\n neynarApiKey,\n baseUrl = 'https://thurin.id',\n network = 'mainnet',\n registryAddress,\n}: IdentityKitProviderProps) {\n const config = useMemo(\n () => ({ rpcUrl, neynarApiKey, baseUrl, network, registryAddress }),\n [rpcUrl, neynarApiKey, baseUrl, network, registryAddress],\n )\n\n return (\n <IdentityKitContext.Provider value={config}>\n <WagmiDetector rpcUrl={rpcUrl} network={network}>\n {children}\n </WagmiDetector>\n </IdentityKitContext.Provider>\n )\n}\n","import { createContext, useContext } from 'react'\nimport type { IdentityKitConfig } from './core/types'\n\nconst defaultConfig: IdentityKitConfig = {\n baseUrl: 'https://thurin.id',\n network: 'mainnet',\n}\n\nexport const IdentityKitContext = createContext<IdentityKitConfig>(defaultConfig)\n\nexport function useIdentityKitConfig(): IdentityKitConfig {\n return useContext(IdentityKitContext)\n}\n","import { useEnsAddress, useEnsName } from 'wagmi'\nimport { useIdentityKitConfig } from '../context'\nimport { chainFor } from '../provider'\nimport { normalize } from 'viem/ens'\nimport { useAttestations } from './useAttestations'\nimport { useEFPGraph } from './useEFPGraph'\nimport { usePGPProofs } from './usePGPProofs'\nimport { useSafeAvatar } from './useSafeAvatar'\nimport type { ThurinIdentity } from '../core/types'\n\nfunction isAddress(value: string): boolean {\n return /^0x[0-9a-fA-F]{40}$/.test(value)\n}\n\nfunction safeNormalize(name: string): string | undefined {\n try {\n return normalize(name)\n } catch {\n return undefined\n }\n}\n\nexport function useThurinIdentity(ensOrAddress: string | undefined | null): ThurinIdentity {\n const chain = chainFor(useIdentityKitConfig().network)\n const isAddr = ensOrAddress ? isAddress(ensOrAddress) : false\n const ensInput = ensOrAddress && !isAddr ? safeNormalize(ensOrAddress) : undefined\n\n // Resolve ENS → address\n const { data: resolvedAddress } = useEnsAddress({\n name: ensInput,\n chainId: chain.id,\n query: { enabled: !!ensInput },\n })\n\n const address = isAddr ? ensOrAddress! : resolvedAddress ?? null\n\n // Reverse resolve address → ENS\n const { data: ensName } = useEnsName({\n address: address as `0x${string}` | undefined,\n chainId: chain.id,\n query: { enabled: !!address },\n })\n\n const displayName = ensInput || ensName || null\n\n const ensAvatar = useSafeAvatar(displayName ? safeNormalize(displayName) : undefined, chain.id)\n\n // On-chain attestations\n const {\n claims,\n totalClaims,\n activeClaims,\n currentFingerprint,\n isLoading: claimsLoading,\n } = useAttestations(address)\n\n // PGP proofs come from the key stored in the current attestation — the\n // latest claim that is active and whose signature verified (the same rule\n // useAttestations uses to pick currentFingerprint).\n const currentClaim = [...claims].reverse().find(\n (c) => !c.revoked && c.verification?.verified && c.fingerprint === currentFingerprint,\n )\n const {\n keyInfo: pgpKeyInfo,\n proofs,\n isLoading: proofsLoading,\n } = usePGPProofs(currentFingerprint, currentClaim?.pgpPublicKey ?? null)\n\n // EFP social graph\n const { efp, isLoading: efpLoading } = useEFPGraph(address)\n\n return {\n address,\n ensName: displayName,\n ensAvatar,\n claims,\n totalClaims,\n activeClaims,\n currentFingerprint,\n pgpKeyInfo,\n proofs,\n efp,\n isLoading: claimsLoading || proofsLoading || efpLoading,\n error: null,\n }\n}\n","import { useReadContract, useReadContracts } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { hexToString } from 'viem'\nimport { REGISTRY_ABI, getRegistry } from '../core/contract'\nimport { bytesToFingerprint } from '../core/fingerprint'\nimport { chainFor } from '../provider'\nimport { verifyAttestation } from '../core/pgp'\nimport { useIdentityKitConfig } from '../context'\nimport type { Attestation } from '../core/types'\n\n/**\n * On-chain attestations for an address, read straight from the v2 registry:\n * `attestationsOf` for the history, `getPayload` for each stored signature + key.\n * No event logs, so any RPC works. Each claim is verified off-chain.\n */\nexport function useAttestations(address: string | undefined | null) {\n const config = useIdentityKitConfig()\n const registry = getRegistry(config.network, config.registryAddress)\n const chain = chainFor(config.network)\n const owner = address as `0x${string}` | undefined\n\n const { data: rows, isLoading: rowsLoading } = useReadContract({\n address: registry.address,\n abi: REGISTRY_ABI,\n functionName: 'attestationsOf',\n args: owner ? [owner] : undefined,\n chainId: chain.id,\n query: { enabled: !!owner },\n })\n\n const count = rows?.length ?? 0\n\n const contracts = owner && rows\n ? rows.map((_, i) => ({\n address: registry.address,\n abi: REGISTRY_ABI,\n functionName: 'getPayload' as const,\n args: [owner, BigInt(i)] as const,\n chainId: chain.id,\n }))\n : []\n\n const { data: payloads, isLoading: payloadsLoading } = useReadContracts({\n contracts,\n query: { enabled: contracts.length > 0 },\n })\n\n const payloadsReady = count === 0 || (payloads !== undefined && payloads.length === count)\n\n const { data: claims, isLoading: verifyLoading } = useQuery({\n queryKey: ['attestations', config.network, registry.address, address, count, payloadsReady],\n queryFn: async (): Promise<Attestation[]> => {\n if (!rows || !address) return []\n const results: Attestation[] = []\n\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i]\n const payload = payloads?.[i]\n let pgpSignature: string | null = null\n let pgpPublicKey: string | null = null\n if (payload && payload.status === 'success') {\n const [sigHex, keyHex] = payload.result as readonly [`0x${string}`, `0x${string}`]\n pgpSignature = hexToString(sigHex)\n pgpPublicKey = hexToString(keyHex)\n }\n\n const fingerprint = bytesToFingerprint(row.fingerprint)\n const verification = pgpPublicKey && pgpSignature\n ? await verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress: address })\n : null\n\n const revokedAt = Number(row.revokedAt)\n results.push({\n index: i,\n fingerprint,\n createdAt: Number(row.createdAt),\n revoked: revokedAt !== 0,\n revokedAt: revokedAt === 0 ? null : revokedAt,\n messageVersion: Number(row.messageVersion),\n pgpSignature,\n pgpPublicKey,\n verification,\n })\n }\n return results\n },\n enabled: !!rows && payloadsReady,\n staleTime: 300_000,\n })\n\n const isLoading = rowsLoading || payloadsLoading || verifyLoading || (!!owner && rows !== undefined && !payloadsReady)\n\n const activeClaims = (claims || []).filter((c) => !c.revoked)\n // The current identity is the latest claim that is both active and has a\n // verified signature binding the key to this address. A claim whose signature\n // has not verified must not surface the key's proofs or user data.\n const verifiedClaims = activeClaims.filter((c) => c.verification?.verified)\n const currentFingerprint = verifiedClaims.length > 0\n ? verifiedClaims[verifiedClaims.length - 1].fingerprint\n : null\n\n return {\n claims: claims || [],\n totalClaims: count,\n activeClaims: activeClaims.length,\n currentFingerprint,\n isLoading,\n }\n}\n","import { useQuery } from '@tanstack/react-query'\nimport { fetchEFPGraph } from '../core/efp'\nimport type { EFPGraph } from '../core/types'\n\nexport function useEFPGraph(address: string | undefined | null) {\n const { data, isLoading } = useQuery<EFPGraph | null>({\n queryKey: ['efp-graph', address],\n queryFn: () => fetchEFPGraph(address!),\n enabled: !!address,\n staleTime: 300_000,\n })\n\n return {\n efp: data ?? null,\n isLoading,\n }\n}\n","import { useQuery } from '@tanstack/react-query'\nimport { parsePgpKey } from '../core/pgp'\nimport { identifyProof, verifyProof, displayUrl, proofHref, proofSecondaryHref } from '../core/proofs'\nimport { useIdentityKitConfig } from '../context'\nimport type { PGPKeyInfo, ProofResult } from '../core/types'\n\n/**\n * Proofs for an identity, read from the PGP key stored in its on-chain\n * attestation. No keyserver is consulted: keys.openpgp.org only serves user\n * IDs whose email is verified and drops non-email user IDs entirely, so it can\n * never carry the published (non-email) identity that holds the notations.\n *\n * @param fingerprint the attested fingerprint (proofs must name it)\n * @param armoredKey the attestation's `pgpPublicKey`\n */\nexport function usePGPProofs(fingerprint: string | undefined | null, armoredKey: string | undefined | null) {\n const config = useIdentityKitConfig()\n\n const { data } = useQuery({\n // The key is large; key the query on its length + fingerprint, which\n // changes whenever a different attestation's key is supplied.\n queryKey: ['pgp-proofs', fingerprint, armoredKey?.length ?? 0],\n queryFn: async (): Promise<{ keyInfo: PGPKeyInfo | null; proofs: ProofResult[] }> => {\n if (!fingerprint || !armoredKey) return { keyInfo: null, proofs: [] }\n\n const keyInfo = await parsePgpKey(armoredKey)\n if (!keyInfo) return { keyInfo: null, proofs: [] }\n\n // Identify proofs from notations. Drop unrecognized targets (provider\n // 'unknown') so the card doesn't render \"Unknown\" badges for platforms\n // Thurin has no verifier for — matching the explorer's behavior.\n const identified = keyInfo.notations\n .map((n) => identifyProof(n))\n .filter((p): p is NonNullable<typeof p> => p !== null && p.provider !== 'unknown')\n\n // Verify all proofs in parallel\n const proofs: ProofResult[] = await Promise.all(\n identified.map(async (proof) => {\n const result = await verifyProof(proof, fingerprint, config.neynarApiKey)\n return {\n provider: proof.provider,\n label: proof.label,\n url: proof.url,\n displayUrl: displayUrl(proof),\n href: proofHref(proof),\n secondaryHref: proofSecondaryHref(proof),\n status: result.verified ? 'verified' as const : 'unverified' as const,\n reason: result.reason,\n }\n }),\n )\n\n // Collapse proofs that resolve to the same account — the same target is\n // often listed under both proof@thurin.id and proof@ariadne.id (and can\n // be reached via more than one proof URL). Key by provider + display\n // identity, preferring a verified result.\n const byAccount = new Map<string, ProofResult>()\n for (const p of proofs) {\n const key = `${p.provider}:${p.displayUrl}`\n const prev = byAccount.get(key)\n if (!prev || (p.status === 'verified' && prev.status !== 'verified')) {\n byAccount.set(key, p)\n }\n }\n\n return { keyInfo, proofs: [...byAccount.values()] }\n },\n enabled: !!fingerprint && !!armoredKey,\n staleTime: 300_000,\n })\n\n return {\n keyInfo: data?.keyInfo ?? null,\n proofs: data?.proofs ?? [],\n // Report loading whenever a fingerprint is set but its proofs haven't\n // resolved yet. Using react-query's own isLoading leaves a gap while the\n // query is enabling (fingerprint just became known), during which the card\n // would briefly paint without proof badges and then pop them in.\n isLoading: !!fingerprint && !!armoredKey && data === undefined,\n }\n}\n","import { useEnsText, useReadContract } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { avatarUrl, parseNftAvatar, nftAvatarImage, NFT_AVATAR_ABI } from '../core/avatar'\n\n/**\n * The avatar to show for a normalized ENS name, or null. Reads the raw `avatar` record and\n * loads only what `avatarUrl` allows (see core/avatar.ts); wagmi's useEnsAvatar would fetch\n * whatever host the name's owner chose.\n */\nexport function useSafeAvatar(name: string | undefined, chainId: number): string | null {\n const { data: raw } = useEnsText({ name, key: 'avatar', chainId, query: { enabled: !!name } })\n const direct = avatarUrl(raw)\n const nft = direct ? null : parseNftAvatar(raw)\n const { data: tokenUri } = useReadContract({\n address: nft?.contract,\n abi: NFT_AVATAR_ABI,\n functionName: nft?.standard === 'erc1155' ? 'uri' : 'tokenURI',\n args: nft ? [nft.tokenId] : undefined,\n chainId,\n query: { enabled: !!nft && nft.chainId === chainId },\n })\n const { data: image } = useQuery({\n queryKey: ['thurin-nft-avatar', tokenUri, nft?.tokenId.toString()],\n queryFn: () => nftAvatarImage(tokenUri as string, nft!.tokenId).catch(() => null),\n enabled: typeof tokenUri === 'string' && !!nft,\n })\n return direct ?? image ?? null\n}\n","import { useThurinIdentity } from '../../hooks/useThurinIdentity'\nimport { useIdentityKitConfig } from '../../context'\nimport type { Theme } from '../../core/types'\nimport '../../themes/index.css'\nimport './ThurinCard.css'\n\nfunction ThurinLogo() {\n return (\n <svg className=\"thurin-card-avatar-placeholder\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"50\" cy=\"50\" r=\"50\" fill=\"var(--thurin-surface-deep)\" />\n <path d=\"M25 80 Q25 25 50 25 Q75 25 75 50\" fill=\"none\" stroke=\"#7c9a3e\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n <path d=\"M33 75 Q33 35 50 35 Q67 35 67 52\" fill=\"none\" stroke=\"#7c9a3e\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n <path d=\"M41 70 Q41 45 50 45 Q59 45 59 55\" fill=\"none\" stroke=\"#c9a227\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n <path d=\"M50 65 L50 53\" fill=\"none\" stroke=\"#c9a227\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n </svg>\n )\n}\n\nexport interface ThurinCardProps {\n ens?: string\n address?: string\n theme?: Theme\n}\n\nexport function ThurinCard({ ens, address, theme = 'thurin' }: ThurinCardProps) {\n const input = ens || address\n const identity = useThurinIdentity(input)\n const config = useIdentityKitConfig()\n\n const profileUrl = identity.address\n ? `${config.baseUrl}/eth/${identity.address}`\n : ens\n ? `${config.baseUrl}/ens/${ens}`\n : null\n\n if (identity.isLoading) {\n return (\n <div className=\"thurin-card\" data-thurin-theme={theme}>\n <div className=\"thurin-card-loading\">Loading identity...</div>\n </div>\n )\n }\n\n const displayAddress = identity.address || null\n\n const verifiedProofs = identity.proofs.filter((p) => p.status === 'verified').length\n const hasVerifiedPgp = identity.claims.some((c) => c.verification?.verified && !c.revoked)\n\n return (\n <div className=\"thurin-card\" data-thurin-theme={theme}>\n <a className=\"thurin-card-header\" href={profileUrl || undefined} target=\"_blank\" rel=\"noopener noreferrer\">\n {identity.ensAvatar ? (\n <img\n className=\"thurin-card-avatar\"\n src={identity.ensAvatar}\n alt={identity.ensName || ''}\n />\n ) : (\n <ThurinLogo />\n )}\n <div>\n {identity.ensName && (\n <div className=\"thurin-card-name\">{identity.ensName}</div>\n )}\n {displayAddress && (\n <div className=\"thurin-card-address\">{displayAddress}</div>\n )}\n </div>\n </a>\n\n <div className=\"thurin-card-stats\">\n <div className=\"thurin-card-stat\">\n <span className=\"thurin-card-stat-value\">{identity.activeClaims}</span>\n <span className=\"thurin-card-stat-label\">Attestations</span>\n </div>\n <div className=\"thurin-card-stat\">\n <span className=\"thurin-card-stat-value\">{verifiedProofs}</span>\n <span className=\"thurin-card-stat-label\">Proofs</span>\n </div>\n <div className=\"thurin-card-stat\">\n <span className=\"thurin-card-stat-value\">\n {identity.efp?.followers ?? 0}\n </span>\n <span className=\"thurin-card-stat-label\">Followers</span>\n </div>\n </div>\n\n <div className=\"thurin-card-badges\">\n {hasVerifiedPgp && (\n <span className=\"thurin-card-badge thurin-card-badge--verified\">PGP Verified</span>\n )}\n {identity.efp?.hasEfp && (\n <span className=\"thurin-card-badge thurin-card-badge--verified\">EFP</span>\n )}\n {identity.proofs.map((p, i) => (\n <span\n key={i}\n className={`thurin-card-badge thurin-card-badge--${p.status === 'verified' ? 'verified' : 'unverified'}`}\n >\n {p.label}\n </span>\n ))}\n </div>\n\n {profileUrl && (\n <a\n className=\"thurin-card-link\"\n href={profileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n View on Thurin\n </a>\n )}\n </div>\n )\n}\n","import { useEnsText } from 'wagmi'\nimport { normalize } from 'viem/ens'\nimport { useIdentityKitConfig } from '../context'\nimport { chainFor } from '../provider'\nimport { ENS_HINT_KEY, ensHintFor, type EnsHint } from '../core/ensHint'\n\nfunction safeNormalize(name: string): string | undefined {\n try { return normalize(name) } catch { return undefined }\n}\n\n/**\n * A name's `id.thurin` record against the fingerprint the registry verifies for its\n * address. `state` is `match`, `unset`, or `mismatch`; the last one is the signal worth\n * showing — a name advertising a key its address has not claimed.\n */\nexport function useEnsHint(name: string | undefined | null, verifiedFingerprint: string | null | undefined): EnsHint & { isLoading: boolean; refetch: () => void } {\n const chain = chainFor(useIdentityKitConfig().network)\n const ensName = name ? safeNormalize(name) : undefined\n const { data, isLoading, refetch } = useEnsText({\n name: ensName,\n key: ENS_HINT_KEY,\n chainId: chain.id,\n query: { enabled: !!ensName },\n })\n return { ...ensHintFor(data ?? null, verifiedFingerprint), isLoading: !!ensName && isLoading, refetch: () => { void refetch() } }\n}\n","import { useReadContracts } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { REGISTRY_ABI, getRegistry } from '../core/contract'\nimport { chainFor } from '../provider'\nimport { useIdentityKitConfig } from '../context'\nimport { IDENTITY_KINDS, decodeRecord, parseRecord, recordKind, type ParsedRecord } from '../core/records'\n\n/**\n * The records on one claim, for the kinds given (default: the kinds an identity page shows),\n * read in one multicall and parsed. Kinds with no record are left out.\n */\nexport function useRecords(address: string | undefined | null, index: number | undefined | null, kinds: readonly string[] = IDENTITY_KINDS, armoredKey?: string | null) {\n const config = useIdentityKitConfig()\n const registry = getRegistry(config.network, config.registryAddress)\n const chain = chainFor(config.network)\n const owner = address as `0x${string}` | undefined\n const enabled = !!owner && index !== undefined && index !== null\n\n const contracts = enabled\n ? kinds.map(kind => ({ address: registry.address, abi: REGISTRY_ABI, functionName: 'record' as const, args: [owner!, BigInt(index!), recordKind(kind)] as const, chainId: chain.id }))\n : []\n const { data: raw, isLoading: readLoading, refetch } = useReadContracts({ contracts, query: { enabled: contracts.length > 0 } })\n\n const texts = (raw ?? []).map(r => (r.status === 'success' ? decodeRecord(r.result as `0x${string}`) : ''))\n const { data: records, isLoading: parseLoading } = useQuery({\n queryKey: ['records', config.network, registry.address, address, index, kinds.join(','), texts.join(' '), armoredKey ?? ''],\n queryFn: async (): Promise<ParsedRecord[]> => {\n const out: ParsedRecord[] = []\n for (let i = 0; i < kinds.length; i++) if (texts[i]) out.push(await parseRecord(kinds[i], texts[i], { armoredKey: armoredKey ?? undefined }))\n return out\n },\n enabled: enabled && raw !== undefined,\n })\n\n return { records: records ?? [], isLoading: enabled && (readLoading || parseLoading), refetch: () => { void refetch() } }\n}\n"]}
1
+ {"version":3,"sources":["/home/ben/code/thurinlabs/identity-kit/dist/index.cjs","../src/provider.tsx","../src/context.ts","../src/hooks/useThurinIdentity.ts","../src/hooks/useAttestations.ts","../src/hooks/useEFPGraph.ts","../src/hooks/usePGPProofs.ts","../src/hooks/useSafeAvatar.ts","../src/components/ThurinCard/ThurinCard.tsx","../src/hooks/useEnsHint.ts","../src/hooks/useRecords.ts"],"names":["useQuery","jsx","safeNormalize","normalize"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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BAAA;AACG,MAAA;AAGc,sBAAA;AAGL,MAAA;AACP,QAAA;AAAA,QAAA;AAEY,UAAA;AAEV,UAAA;AAAE,QAAA;AAHE,QAAA;AAKR,MAAA;AACH,IAAA;AAGE,IAAA;AAAC,MAAA;AAAA,MAAA;AACW,QAAA;AACJ,QAAA;AACC,QAAA;AACH,QAAA;AACL,QAAA;AAAA,MAAA;AAED,IAAA;AAEJ,EAAA;AAEJ;ARiVqB;AACA;AS9dZ;AACA;AAKAC;AACH,EAAA;AAASC,IAAAA;AAAwB,EAAA;AAAS,IAAA;AAAU,EAAA;AAC1D;AAO2B;AACX,EAAA;AACE,EAAA;AACF,EAAA;AACN,IAAA;AACD,IAAA;AACU,IAAA;AACN,IAAA;AACV,EAAA;AACW,EAAA;AAAgH,IAAA;AAAI,EAAA;AAClI;AT4dqB;AACA;AUtfZ;AACAH;AAUkB;AACV,EAAA;AACE,EAAA;AACH,EAAA;AACA,EAAA;AACI,EAAA;AAEA,EAAA;AAGC,EAAA;AAEJ,EAAA;AACD,EAAA;AACD,IAAA;AACF,IAAA;AACsB,MAAA;AAChB,MAAA;AACN,MAAA;AACT,IAAA;AACS,IAAA;AACV,EAAA;AAEiB,EAAA;AAAkG,IAAA;AAAI,EAAA;AAC1H;AV4eqB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/ben/code/thurinlabs/identity-kit/dist/index.cjs","sourcesContent":[null,"import { type ReactNode, useMemo } from 'react'\nimport { WagmiProvider, createConfig, http, useConfig } from 'wagmi'\nimport { mainnet, sepolia, foundry } from 'wagmi/chains'\nimport { getRegistry } from './core/contract'\nimport type { NetworkName } from './core/contract'\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\nimport { IdentityKitContext } from './context'\nimport type { IdentityKitConfig } from './core/types'\n\nconst defaultQueryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60_000,\n retry: 1,\n },\n },\n})\n\nexport { chainFor } from './core/contract'\n\nfunction createDefaultWagmiConfig(rpcUrl: string | undefined, network: NetworkName) {\n const url = rpcUrl || getRegistry(network).defaultRpcUrl\n // Spelled out per network: wagmi types `transports` by the exact chain ids.\n if (network === 'sepolia') return createConfig({ chains: [sepolia], transports: { [sepolia.id]: http(url) } })\n if (network === 'local') return createConfig({ chains: [foundry], transports: { [foundry.id]: http(url) } })\n return createConfig({ chains: [mainnet], transports: { [mainnet.id]: http(url) } })\n}\n\nfunction WagmiDetector({ children, rpcUrl, network }: { children: ReactNode; rpcUrl?: string; network: NetworkName }) {\n // Try to use existing wagmi config\n let hasWagmi = false\n try {\n useConfig()\n hasWagmi = true\n } catch {\n // No WagmiProvider above us\n }\n\n const wagmiConfig = useMemo(() => createDefaultWagmiConfig(rpcUrl, network), [rpcUrl, network])\n\n if (hasWagmi) {\n return <>{children}</>\n }\n\n return (\n <WagmiProvider config={wagmiConfig}>\n <QueryClientProvider client={defaultQueryClient}>\n {children}\n </QueryClientProvider>\n </WagmiProvider>\n )\n}\n\nexport interface IdentityKitProviderProps extends IdentityKitConfig {\n children: ReactNode\n}\n\nexport function IdentityKitProvider({\n children,\n rpcUrl,\n neynarApiKey,\n baseUrl = 'https://thurin.id',\n network = 'mainnet',\n registryAddress,\n}: IdentityKitProviderProps) {\n const config = useMemo(\n () => ({ rpcUrl, neynarApiKey, baseUrl, network, registryAddress }),\n [rpcUrl, neynarApiKey, baseUrl, network, registryAddress],\n )\n\n return (\n <IdentityKitContext.Provider value={config}>\n <WagmiDetector rpcUrl={rpcUrl} network={network}>\n {children}\n </WagmiDetector>\n </IdentityKitContext.Provider>\n )\n}\n","import { createContext, useContext } from 'react'\nimport type { IdentityKitConfig } from './core/types'\n\nconst defaultConfig: IdentityKitConfig = {\n baseUrl: 'https://thurin.id',\n network: 'mainnet',\n}\n\nexport const IdentityKitContext = createContext<IdentityKitConfig>(defaultConfig)\n\nexport function useIdentityKitConfig(): IdentityKitConfig {\n return useContext(IdentityKitContext)\n}\n","import { useEnsAddress, useEnsName, usePublicClient } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { identityErrorKind, needsRpcProbe, IDENTITY_ERROR_TEXT } from '../core/identityError'\nimport { useIdentityKitConfig } from '../context'\nimport { chainFor } from '../provider'\nimport { normalize } from 'viem/ens'\nimport { useAttestations } from './useAttestations'\nimport { useEFPGraph } from './useEFPGraph'\nimport { usePGPProofs } from './usePGPProofs'\nimport { useSafeAvatar } from './useSafeAvatar'\nimport type { ThurinIdentity } from '../core/types'\n\nfunction isAddress(value: string): boolean {\n return /^0x[0-9a-fA-F]{40}$/.test(value)\n}\n\nfunction safeNormalize(name: string): string | undefined {\n try {\n return normalize(name)\n } catch {\n return undefined\n }\n}\n\nexport function useThurinIdentity(ensOrAddress: string | undefined | null): ThurinIdentity {\n const chain = chainFor(useIdentityKitConfig().network)\n const isAddr = ensOrAddress ? isAddress(ensOrAddress) : false\n const ensInput = ensOrAddress && !isAddr ? safeNormalize(ensOrAddress) : undefined\n\n // Resolve ENS → address\n const { data: resolvedAddress, error: ensError, isFetched: ensFetched, refetch: refetchEns } = useEnsAddress({\n name: ensInput,\n chainId: chain.id,\n query: { enabled: !!ensInput },\n })\n\n const address = isAddr ? ensOrAddress! : resolvedAddress ?? null\n\n // Reverse resolve address → ENS\n const { data: ensName } = useEnsName({\n address: address as `0x${string}` | undefined,\n chainId: chain.id,\n query: { enabled: !!address },\n })\n\n const displayName = ensInput || ensName || null\n\n const ensAvatar = useSafeAvatar(displayName ? safeNormalize(displayName) : undefined, chain.id)\n\n // On-chain attestations\n const {\n claims,\n totalClaims,\n activeClaims,\n currentFingerprint,\n isLoading: claimsLoading,\n error: claimsError,\n refetch: refetchClaims,\n } = useAttestations(address)\n\n // PGP proofs come from the key stored in the current attestation — the\n // latest claim that is active and whose signature verified (the same rule\n // useAttestations uses to pick currentFingerprint).\n const currentClaim = [...claims].reverse().find(\n (c) => !c.revoked && c.verification?.verified && c.fingerprint === currentFingerprint,\n )\n const {\n keyInfo: pgpKeyInfo,\n proofs,\n isLoading: proofsLoading,\n } = usePGPProofs(currentFingerprint, currentClaim?.pgpPublicKey ?? null)\n\n // EFP social graph\n const { efp, isLoading: efpLoading } = useEFPGraph(address)\n\n // An empty ENS result or a failed read might just be a dead RPC; ask it for the block\n // number before saying anything about the identity (core/identityError.ts).\n const lookup = { ensEmpty: !!ensInput && ensFetched && !resolvedAddress, ensFailed: !!ensError, claimsFailed: !!claimsError }\n const probeNeeded = needsRpcProbe(lookup)\n const client = usePublicClient({ chainId: chain.id })\n const probe = useQuery({\n queryKey: ['thurin-rpc-probe', chain.id, ensOrAddress],\n queryFn: () => client!.getBlockNumber(),\n enabled: probeNeeded && !!client,\n retry: 0,\n staleTime: 0,\n })\n const rpcAnswered = !probeNeeded || probe.isFetching ? undefined : probe.isSuccess ? true : probe.isError ? false : undefined\n const errorKind = identityErrorKind({ ...lookup, rpcAnswered })\n const probing = probeNeeded && rpcAnswered === undefined\n const retry = () => {\n if (ensInput) refetchEns()\n refetchClaims()\n if (probeNeeded) probe.refetch()\n }\n\n return {\n address,\n ensName: displayName,\n ensAvatar,\n claims,\n totalClaims,\n activeClaims,\n currentFingerprint,\n pgpKeyInfo,\n proofs,\n efp,\n // \"Not finished\" counts as loading, including queries paused in a background tab: the card\n // must not render defaults (zeros) for an identity it hasn't looked up yet.\n isLoading: (!!ensInput && !ensFetched) || claimsLoading || proofsLoading || efpLoading || probing,\n error: errorKind ? new Error(IDENTITY_ERROR_TEXT[errorKind]) : null,\n errorKind,\n retry,\n }\n}\n","import { useReadContract, useReadContracts } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { hexToString } from 'viem'\nimport { REGISTRY_ABI, getRegistry } from '../core/contract'\nimport { bytesToFingerprint } from '../core/fingerprint'\nimport { chainFor } from '../provider'\nimport { verifyAttestation } from '../core/pgp'\nimport { useIdentityKitConfig } from '../context'\nimport type { Attestation } from '../core/types'\n\n/**\n * On-chain attestations for an address, read straight from the v2 registry:\n * `attestationsOf` for the history, `getPayload` for each stored signature + key.\n * No event logs, so any RPC works. Each claim is verified off-chain.\n */\nexport function useAttestations(address: string | undefined | null) {\n const config = useIdentityKitConfig()\n const registry = getRegistry(config.network, config.registryAddress)\n const chain = chainFor(config.network)\n const owner = address as `0x${string}` | undefined\n\n const { data: rows, isLoading: rowsLoading, isFetched: rowsFetched, error: rowsError, refetch: refetchRows } = useReadContract({\n address: registry.address,\n abi: REGISTRY_ABI,\n functionName: 'attestationsOf',\n args: owner ? [owner] : undefined,\n chainId: chain.id,\n query: { enabled: !!owner },\n })\n\n const count = rows?.length ?? 0\n\n const contracts = owner && rows\n ? rows.map((_, i) => ({\n address: registry.address,\n abi: REGISTRY_ABI,\n functionName: 'getPayload' as const,\n args: [owner, BigInt(i)] as const,\n chainId: chain.id,\n }))\n : []\n\n const { data: payloads, isLoading: payloadsLoading, error: payloadsError, refetch: refetchPayloads } = useReadContracts({\n contracts,\n query: { enabled: contracts.length > 0 },\n })\n\n const payloadsReady = count === 0 || (payloads !== undefined && payloads.length === count)\n\n const { data: claims, isLoading: verifyLoading } = useQuery({\n queryKey: ['attestations', config.network, registry.address, address, count, payloadsReady],\n queryFn: async (): Promise<Attestation[]> => {\n if (!rows || !address) return []\n const results: Attestation[] = []\n\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i]\n const payload = payloads?.[i]\n let pgpSignature: string | null = null\n let pgpPublicKey: string | null = null\n if (payload && payload.status === 'success') {\n const [sigHex, keyHex] = payload.result as readonly [`0x${string}`, `0x${string}`]\n pgpSignature = hexToString(sigHex)\n pgpPublicKey = hexToString(keyHex)\n }\n\n const fingerprint = bytesToFingerprint(row.fingerprint)\n const verification = pgpPublicKey && pgpSignature\n ? await verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress: address })\n : null\n\n const revokedAt = Number(row.revokedAt)\n results.push({\n index: i,\n fingerprint,\n createdAt: Number(row.createdAt),\n revoked: revokedAt !== 0,\n revokedAt: revokedAt === 0 ? null : revokedAt,\n messageVersion: Number(row.messageVersion),\n pgpSignature,\n pgpPublicKey,\n verification,\n })\n }\n return results\n },\n enabled: !!rows && payloadsReady,\n staleTime: 300_000,\n })\n\n // Not fetched yet counts as loading (a paused query in a background tab is not \"no claims\").\n const isLoading = rowsLoading || (!!owner && !rowsFetched) || payloadsLoading || verifyLoading || (!!owner && rows !== undefined && !payloadsReady)\n\n const activeClaims = (claims || []).filter((c) => !c.revoked)\n // The current identity is the latest claim that is both active and has a\n // verified signature binding the key to this address. A claim whose signature\n // has not verified must not surface the key's proofs or user data.\n const verifiedClaims = activeClaims.filter((c) => c.verification?.verified)\n const currentFingerprint = verifiedClaims.length > 0\n ? verifiedClaims[verifiedClaims.length - 1].fingerprint\n : null\n\n return {\n claims: claims || [],\n totalClaims: count,\n activeClaims: activeClaims.length,\n currentFingerprint,\n isLoading,\n /** A registry read failed (the RPC may be down; useThurinIdentity finds out which). */\n error: (rowsError ?? payloadsError ?? null) as Error | null,\n refetch: () => { if (owner) { refetchRows(); if (contracts.length > 0) refetchPayloads() } },\n }\n}\n","import { useQuery } from '@tanstack/react-query'\nimport { fetchEFPGraph } from '../core/efp'\nimport type { EFPGraph } from '../core/types'\n\nexport function useEFPGraph(address: string | undefined | null) {\n const { data, isLoading } = useQuery<EFPGraph | null>({\n queryKey: ['efp-graph', address],\n queryFn: () => fetchEFPGraph(address!),\n enabled: !!address,\n staleTime: 300_000,\n })\n\n return {\n efp: data ?? null,\n isLoading,\n }\n}\n","import { useQuery } from '@tanstack/react-query'\nimport { parsePgpKey } from '../core/pgp'\nimport { identifyProof, verifyProof, displayUrl, proofHref, proofSecondaryHref } from '../core/proofs'\nimport { useIdentityKitConfig } from '../context'\nimport type { PGPKeyInfo, ProofResult } from '../core/types'\n\n/**\n * Proofs for an identity, read from the PGP key stored in its on-chain\n * attestation. No keyserver is consulted: keys.openpgp.org only serves user\n * IDs whose email is verified and drops non-email user IDs entirely, so it can\n * never carry the published (non-email) identity that holds the notations.\n *\n * @param fingerprint the attested fingerprint (proofs must name it)\n * @param armoredKey the attestation's `pgpPublicKey`\n */\nexport function usePGPProofs(fingerprint: string | undefined | null, armoredKey: string | undefined | null) {\n const config = useIdentityKitConfig()\n\n const { data } = useQuery({\n // The key is large; key the query on its length + fingerprint, which\n // changes whenever a different attestation's key is supplied.\n queryKey: ['pgp-proofs', fingerprint, armoredKey?.length ?? 0],\n queryFn: async (): Promise<{ keyInfo: PGPKeyInfo | null; proofs: ProofResult[] }> => {\n if (!fingerprint || !armoredKey) return { keyInfo: null, proofs: [] }\n\n const keyInfo = await parsePgpKey(armoredKey)\n if (!keyInfo) return { keyInfo: null, proofs: [] }\n\n // Identify proofs from notations. Drop unrecognized targets (provider\n // 'unknown') so the card doesn't render \"Unknown\" badges for platforms\n // Thurin has no verifier for — matching the explorer's behavior.\n const identified = keyInfo.notations\n .map((n) => identifyProof(n))\n .filter((p): p is NonNullable<typeof p> => p !== null && p.provider !== 'unknown')\n\n // Verify all proofs in parallel\n const proofs: ProofResult[] = await Promise.all(\n identified.map(async (proof) => {\n const result = await verifyProof(proof, fingerprint, config.neynarApiKey)\n return {\n provider: proof.provider,\n label: proof.label,\n url: proof.url,\n displayUrl: displayUrl(proof),\n href: proofHref(proof),\n secondaryHref: proofSecondaryHref(proof),\n status: result.verified ? 'verified' as const : 'unverified' as const,\n reason: result.reason,\n }\n }),\n )\n\n // Collapse proofs that resolve to the same account — the same target is\n // often listed under both proof@thurin.id and proof@ariadne.id (and can\n // be reached via more than one proof URL). Key by provider + display\n // identity, preferring a verified result.\n const byAccount = new Map<string, ProofResult>()\n for (const p of proofs) {\n const key = `${p.provider}:${p.displayUrl}`\n const prev = byAccount.get(key)\n if (!prev || (p.status === 'verified' && prev.status !== 'verified')) {\n byAccount.set(key, p)\n }\n }\n\n return { keyInfo, proofs: [...byAccount.values()] }\n },\n enabled: !!fingerprint && !!armoredKey,\n staleTime: 300_000,\n })\n\n return {\n keyInfo: data?.keyInfo ?? null,\n proofs: data?.proofs ?? [],\n // Report loading whenever a fingerprint is set but its proofs haven't\n // resolved yet. Using react-query's own isLoading leaves a gap while the\n // query is enabling (fingerprint just became known), during which the card\n // would briefly paint without proof badges and then pop them in.\n isLoading: !!fingerprint && !!armoredKey && data === undefined,\n }\n}\n","import { useEnsText, useReadContract } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { avatarUrl, parseNftAvatar, nftAvatarImage, NFT_AVATAR_ABI } from '../core/avatar'\n\n/**\n * The avatar to show for a normalized ENS name, or null. Reads the raw `avatar` record and\n * loads only what `avatarUrl` allows (see core/avatar.ts); wagmi's useEnsAvatar would fetch\n * whatever host the name's owner chose.\n */\nexport function useSafeAvatar(name: string | undefined, chainId: number): string | null {\n const { data: raw } = useEnsText({ name, key: 'avatar', chainId, query: { enabled: !!name } })\n const direct = avatarUrl(raw)\n const nft = direct ? null : parseNftAvatar(raw)\n const { data: tokenUri } = useReadContract({\n address: nft?.contract,\n abi: NFT_AVATAR_ABI,\n functionName: nft?.standard === 'erc1155' ? 'uri' : 'tokenURI',\n args: nft ? [nft.tokenId] : undefined,\n chainId,\n query: { enabled: !!nft && nft.chainId === chainId },\n })\n const { data: image } = useQuery({\n queryKey: ['thurin-nft-avatar', tokenUri, nft?.tokenId.toString()],\n queryFn: () => nftAvatarImage(tokenUri as string, nft!.tokenId).catch(() => null),\n enabled: typeof tokenUri === 'string' && !!nft,\n })\n return direct ?? image ?? null\n}\n","import { useThurinIdentity } from '../../hooks/useThurinIdentity'\nimport { useIdentityKitConfig } from '../../context'\nimport type { Theme } from '../../core/types'\nimport '../../themes/index.css'\nimport './ThurinCard.css'\n\nfunction ThurinLogo() {\n return (\n <svg className=\"thurin-card-avatar-placeholder\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"50\" cy=\"50\" r=\"50\" fill=\"var(--thurin-surface-deep)\" />\n <path d=\"M25 80 Q25 25 50 25 Q75 25 75 50\" fill=\"none\" stroke=\"#7c9a3e\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n <path d=\"M33 75 Q33 35 50 35 Q67 35 67 52\" fill=\"none\" stroke=\"#7c9a3e\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n <path d=\"M41 70 Q41 45 50 45 Q59 45 59 55\" fill=\"none\" stroke=\"#c9a227\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n <path d=\"M50 65 L50 53\" fill=\"none\" stroke=\"#c9a227\" strokeWidth=\"4\" strokeLinecap=\"round\"/>\n </svg>\n )\n}\n\nexport interface ThurinCardProps {\n ens?: string\n address?: string\n theme?: Theme\n}\n\nexport function ThurinCard({ ens, address, theme = 'thurin' }: ThurinCardProps) {\n const input = ens || address\n const identity = useThurinIdentity(input)\n const config = useIdentityKitConfig()\n\n const profileUrl = identity.address\n ? `${config.baseUrl}/eth/${identity.address}`\n : ens\n ? `${config.baseUrl}/ens/${ens}`\n : null\n\n if (identity.isLoading) {\n return (\n <div className=\"thurin-card\" data-thurin-theme={theme}>\n <div className=\"thurin-card-loading\">Loading identity...</div>\n </div>\n )\n }\n\n const displayAddress = identity.address || null\n\n // A failed lookup says so, instead of rendering zeros that read as facts.\n if (identity.errorKind) {\n return (\n <div className=\"thurin-card\" data-thurin-theme={theme}>\n <div className=\"thurin-card-header\">\n <ThurinLogo />\n <div>\n <div className=\"thurin-card-name\">{identity.ensName || ens || address}</div>\n </div>\n </div>\n <div className=\"thurin-card-error\" role=\"status\">\n {identity.error?.message}\n {identity.errorKind !== 'not-found' && (\n <button type=\"button\" className=\"thurin-card-retry\" onClick={identity.retry}>Try again</button>\n )}\n </div>\n {profileUrl && identity.errorKind !== 'not-found' && (\n <a className=\"thurin-card-link\" href={profileUrl} target=\"_blank\" rel=\"noopener noreferrer\">View on Thurin</a>\n )}\n </div>\n )\n }\n\n const verifiedProofs = identity.proofs.filter((p) => p.status === 'verified').length\n const hasVerifiedPgp = identity.claims.some((c) => c.verification?.verified && !c.revoked)\n\n return (\n <div className=\"thurin-card\" data-thurin-theme={theme}>\n <a className=\"thurin-card-header\" href={profileUrl || undefined} target=\"_blank\" rel=\"noopener noreferrer\">\n {identity.ensAvatar ? (\n <img\n className=\"thurin-card-avatar\"\n src={identity.ensAvatar}\n alt={identity.ensName || ''}\n />\n ) : (\n <ThurinLogo />\n )}\n <div>\n {identity.ensName && (\n <div className=\"thurin-card-name\">{identity.ensName}</div>\n )}\n {displayAddress && (\n <div className=\"thurin-card-address\">{displayAddress}</div>\n )}\n </div>\n </a>\n\n <div className=\"thurin-card-stats\">\n <div className=\"thurin-card-stat\">\n <span className=\"thurin-card-stat-value\">{identity.activeClaims}</span>\n <span className=\"thurin-card-stat-label\">Attestations</span>\n </div>\n <div className=\"thurin-card-stat\">\n <span className=\"thurin-card-stat-value\">{verifiedProofs}</span>\n <span className=\"thurin-card-stat-label\">Proofs</span>\n </div>\n <div className=\"thurin-card-stat\">\n <span className=\"thurin-card-stat-value\">\n {/* EFP answers separately; a null graph means it didn't, so don't claim zero. */}\n {identity.efp ? identity.efp.followers : '–'}\n </span>\n <span className=\"thurin-card-stat-label\">Followers</span>\n </div>\n </div>\n\n <div className=\"thurin-card-badges\">\n {hasVerifiedPgp && (\n <span className=\"thurin-card-badge thurin-card-badge--verified\">PGP Verified</span>\n )}\n {identity.efp?.hasEfp && (\n <span className=\"thurin-card-badge thurin-card-badge--verified\">EFP</span>\n )}\n {identity.proofs.map((p, i) => (\n <span\n key={i}\n className={`thurin-card-badge thurin-card-badge--${p.status === 'verified' ? 'verified' : 'unverified'}`}\n >\n {p.label}\n </span>\n ))}\n </div>\n\n {profileUrl && (\n <a\n className=\"thurin-card-link\"\n href={profileUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n View on Thurin\n </a>\n )}\n </div>\n )\n}\n","import { useEnsText } from 'wagmi'\nimport { normalize } from 'viem/ens'\nimport { useIdentityKitConfig } from '../context'\nimport { chainFor } from '../provider'\nimport { ENS_HINT_KEY, ensHintFor, type EnsHint } from '../core/ensHint'\n\nfunction safeNormalize(name: string): string | undefined {\n try { return normalize(name) } catch { return undefined }\n}\n\n/**\n * A name's `id.thurin` record against the fingerprint the registry verifies for its\n * address. `state` is `match`, `unset`, or `mismatch`; the last one is the signal worth\n * showing — a name advertising a key its address has not claimed.\n */\nexport function useEnsHint(name: string | undefined | null, verifiedFingerprint: string | null | undefined): EnsHint & { isLoading: boolean; refetch: () => void } {\n const chain = chainFor(useIdentityKitConfig().network)\n const ensName = name ? safeNormalize(name) : undefined\n const { data, isLoading, refetch } = useEnsText({\n name: ensName,\n key: ENS_HINT_KEY,\n chainId: chain.id,\n query: { enabled: !!ensName },\n })\n return { ...ensHintFor(data ?? null, verifiedFingerprint), isLoading: !!ensName && isLoading, refetch: () => { void refetch() } }\n}\n","import { useReadContracts } from 'wagmi'\nimport { useQuery } from '@tanstack/react-query'\nimport { REGISTRY_ABI, getRegistry } from '../core/contract'\nimport { chainFor } from '../provider'\nimport { useIdentityKitConfig } from '../context'\nimport { IDENTITY_KINDS, decodeRecord, parseRecord, recordKind, type ParsedRecord } from '../core/records'\n\n/**\n * The records on one claim, for the kinds given (default: the kinds an identity page shows),\n * read in one multicall and parsed. Kinds with no record are left out.\n */\nexport function useRecords(address: string | undefined | null, index: number | undefined | null, kinds: readonly string[] = IDENTITY_KINDS, armoredKey?: string | null) {\n const config = useIdentityKitConfig()\n const registry = getRegistry(config.network, config.registryAddress)\n const chain = chainFor(config.network)\n const owner = address as `0x${string}` | undefined\n const enabled = !!owner && index !== undefined && index !== null\n\n const contracts = enabled\n ? kinds.map(kind => ({ address: registry.address, abi: REGISTRY_ABI, functionName: 'record' as const, args: [owner!, BigInt(index!), recordKind(kind)] as const, chainId: chain.id }))\n : []\n const { data: raw, isLoading: readLoading, refetch } = useReadContracts({ contracts, query: { enabled: contracts.length > 0 } })\n\n const texts = (raw ?? []).map(r => (r.status === 'success' ? decodeRecord(r.result as `0x${string}`) : ''))\n const { data: records, isLoading: parseLoading } = useQuery({\n queryKey: ['records', config.network, registry.address, address, index, kinds.join(','), texts.join(' '), armoredKey ?? ''],\n queryFn: async (): Promise<ParsedRecord[]> => {\n const out: ParsedRecord[] = []\n for (let i = 0; i < kinds.length; i++) if (texts[i]) out.push(await parseRecord(kinds[i], texts[i], { armoredKey: armoredKey ?? undefined }))\n return out\n },\n enabled: enabled && raw !== undefined,\n })\n\n return { records: records ?? [], isLoading: enabled && (readLoading || parseLoading), refetch: () => { void refetch() } }\n}\n"]}
package/dist/index.css CHANGED
@@ -164,4 +164,22 @@
164
164
  color: var(--thurin-text-muted);
165
165
  font-size: 14px;
166
166
  }
167
+ .thurin-card-error {
168
+ margin: 12px 0;
169
+ font-size: 13px;
170
+ line-height: 1.5;
171
+ color: var(--thurin-text-muted);
172
+ }
173
+ .thurin-card-retry {
174
+ display: inline;
175
+ margin-left: 8px;
176
+ padding: 0;
177
+ background: none;
178
+ border: none;
179
+ font: inherit;
180
+ color: var(--thurin-primary);
181
+ text-decoration: underline;
182
+ text-underline-offset: 3px;
183
+ cursor: pointer;
184
+ }
167
185
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/themes/index.css","../src/components/ThurinCard/ThurinCard.css"],"sourcesContent":["[data-thurin-theme=\"thurin\"] {\n --thurin-bg: #1a1a12;\n --thurin-surface: #252518;\n --thurin-surface-deep: #151510;\n --thurin-border: #3a3a2a;\n --thurin-text: #faf9f5;\n --thurin-text-muted: #a8a598;\n --thurin-heading: #7c9a3e;\n --thurin-primary: #7c9a3e;\n --thurin-primary-dim: #5c7a2e;\n --thurin-secondary: #c9a227;\n --thurin-success: #7c9a3e;\n --thurin-error: #d44a4a;\n}\n\n[data-thurin-theme=\"dark\"] {\n --thurin-bg: #141010;\n --thurin-surface: #1e1918;\n --thurin-surface-deep: #110e0c;\n --thurin-border: #352a22;\n --thurin-text: #ede5d8;\n --thurin-text-muted: #a09080;\n --thurin-heading: #f0ece4;\n --thurin-primary: #c9a227;\n --thurin-primary-dim: #8a7020;\n --thurin-secondary: #d4a04a;\n --thurin-success: #7c9a3e;\n --thurin-error: #d44a4a;\n}\n\n[data-thurin-theme=\"light\"] {\n --thurin-bg: #faf9f5;\n --thurin-surface: #f0efe8;\n --thurin-surface-deep: #e8e7e0;\n --thurin-border: #d0cfc4;\n --thurin-text: #2a2a22;\n --thurin-text-muted: #6b6960;\n --thurin-heading: #5a7228;\n --thurin-primary: #5a7228;\n --thurin-primary-dim: #7c9a3e;\n --thurin-secondary: #a8861e;\n --thurin-success: #5a7228;\n --thurin-error: #b83a3a;\n}\n",".thurin-card {\n font-family: 'Crimson Pro', Georgia, serif;\n background: var(--thurin-surface);\n border: 1px solid var(--thurin-border);\n border-radius: 8px;\n padding: 20px;\n color: var(--thurin-text);\n max-width: 380px;\n width: 100%;\n}\n\n.thurin-card * {\n box-sizing: border-box;\n}\n\n.thurin-card-header {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n text-decoration: none;\n color: inherit;\n cursor: pointer;\n}\n\n.thurin-card-header:hover .thurin-card-name {\n color: var(--thurin-primary);\n}\n\n.thurin-card-avatar {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 2px solid var(--thurin-border);\n object-fit: cover;\n flex-shrink: 0;\n}\n\n.thurin-card-avatar-placeholder {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 2px solid var(--thurin-border);\n flex-shrink: 0;\n overflow: hidden;\n}\n\n.thurin-card-name {\n font-family: 'Cinzel', serif;\n font-size: 18px;\n font-weight: 700;\n color: var(--thurin-heading);\n line-height: 1.2;\n}\n\n.thurin-card-address {\n font-family: 'Share Tech Mono', monospace;\n font-size: 11px;\n color: var(--thurin-text-muted);\n margin-top: 2px;\n word-break: break-all;\n}\n\n.thurin-card-stats {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 8px;\n margin-bottom: 16px;\n}\n\n.thurin-card-stat {\n text-align: center;\n padding: 8px 4px;\n background: var(--thurin-surface-deep);\n border-radius: 4px;\n}\n\n.thurin-card-stat-value {\n font-family: 'Cinzel', serif;\n font-size: 20px;\n font-weight: 700;\n color: var(--thurin-heading);\n display: block;\n}\n\n.thurin-card-stat-label {\n font-family: 'Share Tech Mono', monospace;\n font-size: 10px;\n color: var(--thurin-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.thurin-card-badges {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-bottom: 16px;\n}\n\n.thurin-card-badge {\n font-family: 'Share Tech Mono', monospace;\n font-size: 11px;\n padding: 3px 8px;\n border-radius: 3px;\n border: 1px solid;\n}\n\n.thurin-card-badge--verified {\n color: var(--thurin-success);\n border-color: var(--thurin-success);\n}\n\n.thurin-card-badge--unverified {\n color: var(--thurin-text-muted);\n border-color: var(--thurin-border);\n}\n\n.thurin-card-link {\n display: block;\n text-align: right;\n font-size: 12px;\n color: var(--thurin-text-muted);\n text-decoration: none;\n}\n\n.thurin-card-link:hover {\n color: var(--thurin-primary);\n}\n\n.thurin-card-loading {\n text-align: center;\n padding: 24px;\n color: var(--thurin-text-muted);\n font-size: 14px;\n}\n"],"mappings":";AAAA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,uBAAqB;AACrB,oBAAkB;AAClB,oBAAkB;AAClB,wBAAsB;AACtB,sBAAoB;AACpB,oBAAkB;AAClB,kBAAgB;AAClB;AAEA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,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C;AACC,eAAa,QAAQ,EAAE;AACvB,aAAW;AACX,eAAa;AACb,SAAO,IAAI;AACX,WAAS;AACX;AAEA,CAAC;AACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,SAAO,IAAI;AACX,kBAAgB;AAChB,kBAAgB;AAClB;AAEA,CAAC;AACC,WAAS;AACT,aAAW;AACX,OAAK;AACL,iBAAe;AACjB;AAEA,CAAC;AACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,WAAS,IAAI;AACb,iBAAe;AACf,UAAQ,IAAI;AACd;AAEA,CAAC;AACC,SAAO,IAAI;AACX,gBAAc,IAAI;AACpB;AAEA,CAAC;AACC,SAAO,IAAI;AACX,gBAAc,IAAI;AACpB;AAEA,CAAC;AACC,WAAS;AACT,cAAY;AACZ,aAAW;AACX,SAAO,IAAI;AACX,mBAAiB;AACnB;AAEA,CARC,gBAQgB;AACf,SAAO,IAAI;AACb;AAEA,CAAC;AACC,cAAY;AACZ,WAAS;AACT,SAAO,IAAI;AACX,aAAW;AACb;","names":[]}
1
+ {"version":3,"sources":["../src/themes/index.css","../src/components/ThurinCard/ThurinCard.css"],"sourcesContent":["[data-thurin-theme=\"thurin\"] {\n --thurin-bg: #1a1a12;\n --thurin-surface: #252518;\n --thurin-surface-deep: #151510;\n --thurin-border: #3a3a2a;\n --thurin-text: #faf9f5;\n --thurin-text-muted: #a8a598;\n --thurin-heading: #7c9a3e;\n --thurin-primary: #7c9a3e;\n --thurin-primary-dim: #5c7a2e;\n --thurin-secondary: #c9a227;\n --thurin-success: #7c9a3e;\n --thurin-error: #d44a4a;\n}\n\n[data-thurin-theme=\"dark\"] {\n --thurin-bg: #141010;\n --thurin-surface: #1e1918;\n --thurin-surface-deep: #110e0c;\n --thurin-border: #352a22;\n --thurin-text: #ede5d8;\n --thurin-text-muted: #a09080;\n --thurin-heading: #f0ece4;\n --thurin-primary: #c9a227;\n --thurin-primary-dim: #8a7020;\n --thurin-secondary: #d4a04a;\n --thurin-success: #7c9a3e;\n --thurin-error: #d44a4a;\n}\n\n[data-thurin-theme=\"light\"] {\n --thurin-bg: #faf9f5;\n --thurin-surface: #f0efe8;\n --thurin-surface-deep: #e8e7e0;\n --thurin-border: #d0cfc4;\n --thurin-text: #2a2a22;\n --thurin-text-muted: #6b6960;\n --thurin-heading: #5a7228;\n --thurin-primary: #5a7228;\n --thurin-primary-dim: #7c9a3e;\n --thurin-secondary: #a8861e;\n --thurin-success: #5a7228;\n --thurin-error: #b83a3a;\n}\n",".thurin-card {\n font-family: 'Crimson Pro', Georgia, serif;\n background: var(--thurin-surface);\n border: 1px solid var(--thurin-border);\n border-radius: 8px;\n padding: 20px;\n color: var(--thurin-text);\n max-width: 380px;\n width: 100%;\n}\n\n.thurin-card * {\n box-sizing: border-box;\n}\n\n.thurin-card-header {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n text-decoration: none;\n color: inherit;\n cursor: pointer;\n}\n\n.thurin-card-header:hover .thurin-card-name {\n color: var(--thurin-primary);\n}\n\n.thurin-card-avatar {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 2px solid var(--thurin-border);\n object-fit: cover;\n flex-shrink: 0;\n}\n\n.thurin-card-avatar-placeholder {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 2px solid var(--thurin-border);\n flex-shrink: 0;\n overflow: hidden;\n}\n\n.thurin-card-name {\n font-family: 'Cinzel', serif;\n font-size: 18px;\n font-weight: 700;\n color: var(--thurin-heading);\n line-height: 1.2;\n}\n\n.thurin-card-address {\n font-family: 'Share Tech Mono', monospace;\n font-size: 11px;\n color: var(--thurin-text-muted);\n margin-top: 2px;\n word-break: break-all;\n}\n\n.thurin-card-stats {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 8px;\n margin-bottom: 16px;\n}\n\n.thurin-card-stat {\n text-align: center;\n padding: 8px 4px;\n background: var(--thurin-surface-deep);\n border-radius: 4px;\n}\n\n.thurin-card-stat-value {\n font-family: 'Cinzel', serif;\n font-size: 20px;\n font-weight: 700;\n color: var(--thurin-heading);\n display: block;\n}\n\n.thurin-card-stat-label {\n font-family: 'Share Tech Mono', monospace;\n font-size: 10px;\n color: var(--thurin-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.thurin-card-badges {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-bottom: 16px;\n}\n\n.thurin-card-badge {\n font-family: 'Share Tech Mono', monospace;\n font-size: 11px;\n padding: 3px 8px;\n border-radius: 3px;\n border: 1px solid;\n}\n\n.thurin-card-badge--verified {\n color: var(--thurin-success);\n border-color: var(--thurin-success);\n}\n\n.thurin-card-badge--unverified {\n color: var(--thurin-text-muted);\n border-color: var(--thurin-border);\n}\n\n.thurin-card-link {\n display: block;\n text-align: right;\n font-size: 12px;\n color: var(--thurin-text-muted);\n text-decoration: none;\n}\n\n.thurin-card-link:hover {\n color: var(--thurin-primary);\n}\n\n.thurin-card-loading {\n text-align: center;\n padding: 24px;\n color: var(--thurin-text-muted);\n font-size: 14px;\n}\n\n.thurin-card-error {\n margin: 12px 0;\n font-size: 13px;\n line-height: 1.5;\n color: var(--thurin-text-muted);\n}\n\n.thurin-card-retry {\n display: inline;\n margin-left: 8px;\n padding: 0;\n background: none;\n border: none;\n font: inherit;\n color: var(--thurin-primary);\n text-decoration: underline;\n text-underline-offset: 3px;\n cursor: pointer;\n}\n"],"mappings":";AAAA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,uBAAqB;AACrB,oBAAkB;AAClB,oBAAkB;AAClB,wBAAsB;AACtB,sBAAoB;AACpB,oBAAkB;AAClB,kBAAgB;AAClB;AAEA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,uBAAqB;AACrB,oBAAkB;AAClB,oBAAkB;AAClB,wBAAsB;AACtB,sBAAoB;AACpB,oBAAkB;AAClB,kBAAgB;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ACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,SAAO,IAAI;AACX,kBAAgB;AAChB,kBAAgB;AAClB;AAEA,CAAC;AACC,WAAS;AACT,aAAW;AACX,OAAK;AACL,iBAAe;AACjB;AAEA,CAAC;AACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,WAAS,IAAI;AACb,iBAAe;AACf,UAAQ,IAAI;AACd;AAEA,CAAC;AACC,SAAO,IAAI;AACX,gBAAc,IAAI;AACpB;AAEA,CAAC;AACC,SAAO,IAAI;AACX,gBAAc,IAAI;AACpB;AAEA,CAAC;AACC,WAAS;AACT,cAAY;AACZ,aAAW;AACX,SAAO,IAAI;AACX,mBAAiB;AACnB;AAEA,CARC,gBAQgB;AACf,SAAO,IAAI;AACb;AAEA,CAAC;AACC,cAAY;AACZ,WAAS;AACT,SAAO,IAAI;AACX,aAAW;AACb;AAEA,CAAC;AACC,UAAQ,KAAK;AACb,aAAW;AACX,eAAa;AACb,SAAO,IAAI;AACb;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,WAAS;AACT,cAAY;AACZ,UAAQ;AACR,QAAM;AACN,SAAO,IAAI;AACX,mBAAiB;AACjB,yBAAuB;AACvB,UAAQ;AACV;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { IdentityKitConfig, Theme, ThurinIdentity, Attestation, EFPGraph, PGPKeyInfo, ProofResult, EnsHint, ParsedRecord } from './core.cjs';
4
- export { ARWEAVE_GATEWAY, AUTHORIZATION_TYPES, AttestAuthorization, AuthorizationAction, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, EnsHintState, EnsTextReader, IDENTITY_KINDS, IPFS_GATEWAY, KNOWN_KINDS, KnownKind, MAX_RECORD_BYTES, NETWORKS, NFT_AVATAR_ABI, NetworkName, NftAvatar, Notation, PGPVerification, PointerEntry, PointerRecord, Proof, REGISTRY_ABI, REGISTRY_ADDRESS, ReattestAuthorization, RecordData, RecordReader, RegistryDeployment, RevokeAuthorization, SetRecordAuthorization, StrippedKey, SubkeyInfo, UpdateKeyAuthorization, addPointer, attestTypedData, authorizationDigest, avatarUrl, bytesToFingerprint, chainFor, decodeRecord, displayUrl, encodeRecord, ensHintFor, ensHintValue, ensHintWrite, fetchEFPGraph, fetchEnsHint, fetchRecords, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, isNetworkName, keyIdOf, keyIdToBytes, kindName, nftAvatarImage, normalizeFingerprint, parseNftAvatar, parsePgpKey, parsePointer, parseRecord, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, renderPointer, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyClearsigned, verifyProof } from './core.cjs';
4
+ export { ARWEAVE_GATEWAY, AUTHORIZATION_TYPES, AttestAuthorization, AuthorizationAction, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, EnsHintState, EnsTextReader, IDENTITY_ERROR_TEXT, IDENTITY_KINDS, IPFS_GATEWAY, IdentityErrorKind, IdentityLookupState, KNOWN_KINDS, KnownKind, MAX_RECORD_BYTES, NETWORKS, NFT_AVATAR_ABI, NetworkName, NftAvatar, Notation, PGPVerification, PointerEntry, PointerRecord, Proof, REGISTRY_ABI, REGISTRY_ADDRESS, ReattestAuthorization, RecordData, RecordReader, RegistryDeployment, RevokeAuthorization, SetRecordAuthorization, StrippedKey, SubkeyInfo, UpdateKeyAuthorization, addPointer, attestTypedData, authorizationDigest, avatarUrl, bytesToFingerprint, chainFor, decodeRecord, displayUrl, encodeRecord, ensHintFor, ensHintValue, ensHintWrite, fetchEFPGraph, fetchEnsHint, fetchRecords, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, identityErrorKind, isNetworkName, keyIdOf, keyIdToBytes, kindName, needsRpcProbe, nftAvatarImage, normalizeFingerprint, parseNftAvatar, parsePgpKey, parsePointer, parseRecord, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, renderPointer, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyClearsigned, verifyProof } from './core.cjs';
5
5
  import 'viem';
6
6
 
7
7
  interface IdentityKitProviderProps extends IdentityKitConfig {
@@ -29,6 +29,9 @@ declare function useAttestations(address: string | undefined | null): {
29
29
  activeClaims: number;
30
30
  currentFingerprint: string | null;
31
31
  isLoading: boolean;
32
+ /** A registry read failed (the RPC may be down; useThurinIdentity finds out which). */
33
+ error: Error | null;
34
+ refetch: () => void;
32
35
  };
33
36
 
34
37
  declare function useEFPGraph(address: string | undefined | null): {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { IdentityKitConfig, Theme, ThurinIdentity, Attestation, EFPGraph, PGPKeyInfo, ProofResult, EnsHint, ParsedRecord } from './core.js';
4
- export { ARWEAVE_GATEWAY, AUTHORIZATION_TYPES, AttestAuthorization, AuthorizationAction, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, EnsHintState, EnsTextReader, IDENTITY_KINDS, IPFS_GATEWAY, KNOWN_KINDS, KnownKind, MAX_RECORD_BYTES, NETWORKS, NFT_AVATAR_ABI, NetworkName, NftAvatar, Notation, PGPVerification, PointerEntry, PointerRecord, Proof, REGISTRY_ABI, REGISTRY_ADDRESS, ReattestAuthorization, RecordData, RecordReader, RegistryDeployment, RevokeAuthorization, SetRecordAuthorization, StrippedKey, SubkeyInfo, UpdateKeyAuthorization, addPointer, attestTypedData, authorizationDigest, avatarUrl, bytesToFingerprint, chainFor, decodeRecord, displayUrl, encodeRecord, ensHintFor, ensHintValue, ensHintWrite, fetchEFPGraph, fetchEnsHint, fetchRecords, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, isNetworkName, keyIdOf, keyIdToBytes, kindName, nftAvatarImage, normalizeFingerprint, parseNftAvatar, parsePgpKey, parsePointer, parseRecord, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, renderPointer, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyClearsigned, verifyProof } from './core.js';
4
+ export { ARWEAVE_GATEWAY, AUTHORIZATION_TYPES, AttestAuthorization, AuthorizationAction, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, EnsHintState, EnsTextReader, IDENTITY_ERROR_TEXT, IDENTITY_KINDS, IPFS_GATEWAY, IdentityErrorKind, IdentityLookupState, KNOWN_KINDS, KnownKind, MAX_RECORD_BYTES, NETWORKS, NFT_AVATAR_ABI, NetworkName, NftAvatar, Notation, PGPVerification, PointerEntry, PointerRecord, Proof, REGISTRY_ABI, REGISTRY_ADDRESS, ReattestAuthorization, RecordData, RecordReader, RegistryDeployment, RevokeAuthorization, SetRecordAuthorization, StrippedKey, SubkeyInfo, UpdateKeyAuthorization, addPointer, attestTypedData, authorizationDigest, avatarUrl, bytesToFingerprint, chainFor, decodeRecord, displayUrl, encodeRecord, ensHintFor, ensHintValue, ensHintWrite, fetchEFPGraph, fetchEnsHint, fetchRecords, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, identityErrorKind, isNetworkName, keyIdOf, keyIdToBytes, kindName, needsRpcProbe, nftAvatarImage, normalizeFingerprint, parseNftAvatar, parsePgpKey, parsePointer, parseRecord, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, renderPointer, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyClearsigned, verifyProof } from './core.js';
5
5
  import 'viem';
6
6
 
7
7
  interface IdentityKitProviderProps extends IdentityKitConfig {
@@ -29,6 +29,9 @@ declare function useAttestations(address: string | undefined | null): {
29
29
  activeClaims: number;
30
30
  currentFingerprint: string | null;
31
31
  isLoading: boolean;
32
+ /** A registry read failed (the RPC may be down; useThurinIdentity finds out which). */
33
+ error: Error | null;
34
+ refetch: () => void;
32
35
  };
33
36
 
34
37
  declare function useEFPGraph(address: string | undefined | null): {