@thurinlabs/identity-kit 1.4.0 → 2.1.0

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/core.d.cts CHANGED
@@ -2,7 +2,7 @@ import * as viem from 'viem';
2
2
  import { Hex, TypedDataDomain } from 'viem';
3
3
 
4
4
  interface Attestation {
5
- /** Position in the owner's attestation history. */
5
+ /** Position in the owner's claim history. */
6
6
  index: number;
7
7
  /** Lowercase hex fingerprint, no 0x (40 chars for v4 keys, 64 for v6). */
8
8
  fingerprint: string;
@@ -11,21 +11,28 @@ interface Attestation {
11
11
  revoked: boolean;
12
12
  /** Unix seconds, or null while active. */
13
13
  revokedAt: number | null;
14
- /** Format of the clearsigned message (1 = "I control the Ethereum address: <address>"). */
14
+ /** 'active', 'revoked', or 'replaced' (revoked by a reattest). */
15
+ state: 'active' | 'revoked' | 'replaced';
16
+ /** The claim that replaced this one, when `state` is 'replaced'. */
17
+ replacedBy: number | null;
18
+ /** The owner's revoke reason: '', 'compromised', 'retired', 'superseded', or 'other'. */
19
+ revokeReason: string;
20
+ /** 1 = detached signature over the statement; 0 = a clearsigned message stored as submitted. */
15
21
  messageVersion: number;
16
- /** The clearsigned message stored on-chain (null only if the payload read failed). */
22
+ /** The signature as armored text, or the clearsigned message (null only if the read failed). */
17
23
  pgpSignature: string | null;
18
- /** The armored public key stored on-chain (null only if the payload read failed). */
24
+ /** The armored public key (null only if the read failed). */
19
25
  pgpPublicKey: string | null;
26
+ /** null when the claim wasn't read: older than `readClaims`' limit. */
20
27
  verification: PGPVerification | null;
21
28
  }
22
- /** Why a claim does or doesn't count, in a form a UI can word (see CLAIM_CHECK_LABEL). Since 1.4.0. */
29
+ /** Why a claim does or doesn't count, in a form a UI can word (see CLAIM_CHECK_LABEL). */
23
30
  type ClaimCheckKind = 'verified' | 'expired' | 'signing-key-expired' | 'revoked' | 'compromised' | 'signing-key-revoked' | 'unsupported' | 'bad-signature';
24
31
  interface PGPVerification {
25
32
  verified: boolean;
26
33
  /** The underlying library message, for logs; show `kind` to people instead. */
27
34
  reason?: string;
28
- /** Since 1.4.0. */
35
+ /** Why a claim doesn't count, or `verified`. */
29
36
  kind?: ClaimCheckKind;
30
37
  /** ISO date that goes with `kind`: when the key or subkey expired or was revoked. */
31
38
  at?: string | null;
@@ -46,11 +53,19 @@ interface PGPKeyInfo {
46
53
  expires: string | null;
47
54
  notations: Notation[];
48
55
  subkeys: SubkeyInfo[];
56
+ /** A key or subkey that can take encrypted messages is valid now. */
57
+ canEncrypt: boolean;
49
58
  }
50
59
  interface SubkeyInfo {
51
60
  algorithm: string;
52
61
  created: string | null;
53
62
  fingerprint: string;
63
+ /** What its newest binding signature allows. */
64
+ usage: ('sign' | 'encrypt' | 'auth')[];
65
+ /** ISO, or null if it doesn't expire. */
66
+ expires: string | null;
67
+ /** Usable now: bound, not expired, not revoked. */
68
+ valid: boolean;
54
69
  }
55
70
  interface Notation {
56
71
  name: string;
@@ -67,139 +82,532 @@ interface Proof {
67
82
  castHash?: string;
68
83
  domain?: string;
69
84
  }
70
- interface ProofResult {
71
- provider: string;
72
- label: string;
73
- url: string;
74
- displayUrl: string;
75
- href: string | null;
76
- secondaryHref: string | null;
77
- status: 'verified' | 'unverified' | 'pending' | 'skipped';
78
- reason?: string;
85
+
86
+ declare function identifyProof(notation: Notation): Proof | null;
87
+ declare function displayUrl(proof: Proof): string;
88
+ declare function proofHref(proof: Proof): string | null;
89
+ declare function proofSecondaryHref(proof: Proof): string | null;
90
+ /**
91
+ * Farcaster proofs are read from a Farcaster node's HTTP API (`/v1/userNameProofByName`,
92
+ * `/v1/castsByFid`). The default is Quilibrium's public Hypersnap node, which needs no key and
93
+ * allows browser requests; it sees the visitor's IP and which account was checked. Point
94
+ * `farcasterHub` at your own node to avoid that, or pass a Neynar key to use Neynar's hub.
95
+ */
96
+ declare const FARCASTER_HUB = "https://haatz.quilibrium.com";
97
+ interface ProofOptions {
98
+ /** A Farcaster node's HTTP API base URL. Default: FARCASTER_HUB (keyless). */
99
+ farcasterHub?: string;
100
+ /** Optional: read Farcaster through Neynar's hub with this key instead. */
101
+ neynarApiKey?: string;
79
102
  }
80
- interface EFPGraph {
81
- followers: number;
82
- following: number;
83
- top8: string[];
84
- hasEfp: boolean;
103
+ /** Check one proof against its platform. `options` may also be a Neynar API key. */
104
+ declare function verifyProof(proof: Proof, fingerprint: string, opts?: ProofOptions | string): Promise<PGPVerification>;
105
+
106
+ /** A key or signature as armored text, raw bytes, or the `0x…` hex a contract call returns. */
107
+ type PgpInput = string | Uint8Array;
108
+ /** The line every claim signs (message version 1). The address is lowercased. */
109
+ declare function statementText(address: string): string;
110
+ declare function parsePgpKey(armoredKey: PgpInput): Promise<PGPKeyInfo | null>;
111
+ /** A clearsigned message against a key, judged as gpg would: claims, and records such as `thurin.canary`. */
112
+ declare function verifyClearsigned({ armoredKey, clearsigned }: {
113
+ armoredKey: PgpInput;
114
+ clearsigned: string;
115
+ }): Promise<{
116
+ verified: boolean;
117
+ reason?: string;
118
+ text: string;
119
+ }>;
120
+ /**
121
+ * A detached signature over the claim statement for `address`, exactly as `printf '%s'` gives it
122
+ * (no trailing line break): the only form the registry's `clearsigned()` view can show to gpg.
123
+ */
124
+ declare function verifyStatementSignature({ key, signature, address }: {
125
+ key: PgpInput;
126
+ signature: PgpInput;
127
+ address: string;
128
+ }): Promise<{
129
+ verified: boolean;
130
+ reason?: string;
131
+ text: string;
132
+ }>;
133
+ declare function verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress, }: {
134
+ pgpPublicKey: PgpInput | null;
135
+ pgpSignature: PgpInput | null;
136
+ fingerprint: string;
137
+ ethAddress: string;
138
+ }): Promise<PGPVerification>;
139
+ interface StrippedKey {
140
+ /** Armored public key containing only the non-email user IDs. */
141
+ armored: string;
142
+ /** The same key as raw bytes. */
143
+ binary: Uint8Array;
144
+ /** User IDs kept (no `@`). */
145
+ kept: string[];
146
+ /** User IDs removed (contained an `@`). */
147
+ removed: string[];
85
148
  }
86
- interface ThurinIdentity {
87
- address: string | null;
88
- ensName: string | null;
89
- ensAvatar: string | null;
90
- claims: Attestation[];
91
- totalClaims: number;
92
- activeClaims: number;
93
- currentFingerprint: string | null;
94
- pgpKeyInfo: PGPKeyInfo | null;
95
- proofs: ProofResult[];
96
- efp: EFPGraph | null;
97
- isLoading: boolean;
98
- /** Set when the identity couldn't be shown; the message is plain and safe to display. */
99
- error: Error | null;
100
- /** Why: the RPC didn't answer, the ENS name has no address, or a registry read failed. */
101
- errorKind: 'rpc' | 'not-found' | 'read' | null;
102
- /** Re-run the lookups (for a "Try again" button). */
103
- retry: () => void;
149
+ /**
150
+ * The key without its email user IDs; the rest keep their self-certifications and notations.
151
+ * Null when no user ID would remain: openpgp needs one to verify signatures.
152
+ */
153
+ declare function stripEmailUserIDs(armoredKey: PgpInput): Promise<StrippedKey | null>;
154
+ /** True when any user ID on the key contains an email address. */
155
+ declare function hasEmailUserID(armoredKey: PgpInput): Promise<boolean>;
156
+ interface LeanKey {
157
+ /** The key to store, as raw bytes. */
158
+ binary: Uint8Array;
159
+ kept: string[];
160
+ /** Names left out: they contain an email, or a notation on them does. */
161
+ removed: string[];
162
+ /** Emails in notations on the key itself (not on a name), which can't be left out: refuse to publish these. */
163
+ keyNotationEmails: string[];
104
164
  }
105
- type Theme = 'thurin' | 'dark' | 'light';
106
- interface IdentityKitConfig {
107
- rpcUrl?: string;
108
- /** Optional: read Farcaster proofs through Neynar's hub with this key. Not needed since 1.3.7. */
109
- neynarApiKey?: string;
110
- /** A Farcaster node's HTTP API for Farcaster proofs. Default: Quilibrium's public Hypersnap node (keyless). */
111
- farcasterHub?: string;
112
- baseUrl?: string;
113
- /** Which PGPRegistry deployment to read: 'mainnet' (default) or 'sepolia'. */
114
- network?: 'mainnet' | 'sepolia' | 'local';
115
- /** Override the registry address (e.g. a local deploy that landed elsewhere). */
116
- registryAddress?: string;
165
+ /**
166
+ * The key as a claim stores it, like gpg's export-minimal: raw bytes, the newest self-signature per
167
+ * user ID and subkey, revocations kept. Email user IDs are left out unless `includeEmail`. Every subkey
168
+ * stays, authentication (SSH) ones included. Null when no user ID would remain.
169
+ */
170
+ declare function leanKey(input: PgpInput, { includeEmail }?: {
171
+ includeEmail?: boolean;
172
+ }): Promise<LeanKey | null>;
173
+ /**
174
+ * What to store as a claim's signature. A detached signature is stored as its own raw bytes
175
+ * (message version 1). A clearsigned message is reduced to its signature when that covers the
176
+ * statement exactly; otherwise (e.g. made with `echo`, which signs a trailing line break) the
177
+ * whole message is kept as text (version 0), so gpg can still verify what the registry returns.
178
+ */
179
+ declare function claimSignature({ signature, key, address }: {
180
+ signature: PgpInput;
181
+ key: PgpInput;
182
+ address: string;
183
+ }): Promise<{
184
+ signature: Uint8Array | string;
185
+ messageVersion: 0 | 1;
186
+ } | null>;
187
+ /**
188
+ * The email gpg signed in as the signer's user ID (from `-u me@example.com` or gpg.conf `sender`),
189
+ * or null. It can't be removed without re-signing; `gpg --disable-signer-uid` leaves it out.
190
+ */
191
+ declare function signatureEmail(signature: PgpInput): Promise<string | null>;
192
+ /**
193
+ * A stored key or signature as armored text, for display, copy buttons, and `gpg --import`.
194
+ * A clearsigned message comes back as stored. Accepts the `0x…` hex a contract call returns.
195
+ * Null if it isn't OpenPGP data.
196
+ */
197
+ declare function payloadText(input: PgpInput, kind: 'key' | 'signature'): Promise<string | null>;
198
+ interface SshKey {
199
+ /** An `authorized_keys` line without a comment: `ssh-ed25519 AAAA…`. */
200
+ line: string;
201
+ /** As `ssh-keygen -l` shows it: `SHA256:…`. */
202
+ sha256: string;
203
+ /** The PGP key or subkey it came from. */
204
+ fingerprint: string;
117
205
  }
206
+ /**
207
+ * The key's SSH keys: every authentication key or subkey that is valid now (not expired, not
208
+ * revoked), in a type OpenSSH accepts. What `gpg --export-ssh-key` prints, but every one, not only
209
+ * the newest. Empty when there are none.
210
+ */
211
+ declare function sshKeys(input: PgpInput): Promise<SshKey[]>;
118
212
 
119
- declare const REGISTRY_ABI: readonly [{
120
- readonly type: "function";
121
- readonly name: "ATTEST_TYPEHASH";
122
- readonly inputs: readonly [];
123
- readonly outputs: readonly [{
124
- readonly name: "";
125
- readonly type: "bytes32";
126
- readonly internalType: "bytes32";
213
+ /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
214
+ declare function normalizeFingerprint(input: string): string | null;
215
+ /** Same key, whatever the case, spacing, or 0x of either side. Malformed input never matches. */
216
+ declare function sameFingerprint(a: string | null | undefined, b: string | null | undefined): boolean;
217
+ /** Fingerprint → the raw `bytes` argument the registry takes (0x-prefixed, 20 or 32 bytes). */
218
+ declare function fingerprintToBytes(fingerprint: string): Hex;
219
+ /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
220
+ declare function bytesToFingerprint(bytes: Hex | string): string;
221
+ /** keccak256 of the raw fingerprint bytes: the `fingerprintHash` the registry indexes by. */
222
+ declare function fingerprintHash(fingerprint: string): Hex;
223
+ /**
224
+ * The long key ID as the registry's `bytes8`: the last 8 bytes of a v4 fingerprint, the first 8 of
225
+ * a v6 (RFC 9580 §5.5.4), as `gpg --keyid-format long` prints.
226
+ */
227
+ declare function keyIdOf(fingerprint: string): Hex;
228
+ /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
229
+ declare function keyIdToBytes(keyId: string): Hex | null;
230
+
231
+ /**
232
+ * EIP-712 permissions for the registry's relayed writes (`attestFor`, `reattestFor`,
233
+ * `updateKeyFor`, `revokeFor`, `setRecordFor`, `markCompromisedFor`). The owner signs one; anyone can submit the
234
+ * matching call and pay the gas. Every field is bound, plus the owner's `nonces(owner)` and a
235
+ * `deadline`. The domain includes the chain id, so a permission can't be replayed on another network.
236
+ */
237
+ declare const EIP712_NAME = "Thurin PGPRegistry";
238
+ declare const EIP712_VERSION = "3";
239
+ declare function registryDomain(chainId: number, verifyingContract: Hex): TypedDataDomain;
240
+ declare const AUTHORIZATION_TYPES: {
241
+ readonly Attest: readonly [{
242
+ readonly name: "owner";
243
+ readonly type: "address";
244
+ }, {
245
+ readonly name: "fingerprint";
246
+ readonly type: "bytes";
247
+ }, {
248
+ readonly name: "signature";
249
+ readonly type: "bytes";
250
+ }, {
251
+ readonly name: "key";
252
+ readonly type: "bytes";
253
+ }, {
254
+ readonly name: "nonce";
255
+ readonly type: "uint256";
256
+ }, {
257
+ readonly name: "deadline";
258
+ readonly type: "uint256";
127
259
  }];
128
- readonly stateMutability: "view";
129
- }, {
130
- readonly type: "function";
131
- readonly name: "DOMAIN_SEPARATOR";
132
- readonly inputs: readonly [];
133
- readonly outputs: readonly [{
134
- readonly name: "";
135
- readonly type: "bytes32";
136
- readonly internalType: "bytes32";
260
+ readonly Reattest: readonly [{
261
+ readonly name: "owner";
262
+ readonly type: "address";
263
+ }, {
264
+ readonly name: "revokeIndex";
265
+ readonly type: "uint256";
266
+ }, {
267
+ readonly name: "fingerprint";
268
+ readonly type: "bytes";
269
+ }, {
270
+ readonly name: "signature";
271
+ readonly type: "bytes";
272
+ }, {
273
+ readonly name: "key";
274
+ readonly type: "bytes";
275
+ }, {
276
+ readonly name: "keepRecords";
277
+ readonly type: "bool";
278
+ }, {
279
+ readonly name: "nonce";
280
+ readonly type: "uint256";
281
+ }, {
282
+ readonly name: "deadline";
283
+ readonly type: "uint256";
137
284
  }];
138
- readonly stateMutability: "view";
139
- }, {
140
- readonly type: "function";
141
- readonly name: "EIP712_NAME";
142
- readonly inputs: readonly [];
143
- readonly outputs: readonly [{
144
- readonly name: "";
145
- readonly type: "string";
146
- readonly internalType: "string";
285
+ readonly UpdateKey: readonly [{
286
+ readonly name: "owner";
287
+ readonly type: "address";
288
+ }, {
289
+ readonly name: "index";
290
+ readonly type: "uint256";
291
+ }, {
292
+ readonly name: "key";
293
+ readonly type: "bytes";
294
+ }, {
295
+ readonly name: "nonce";
296
+ readonly type: "uint256";
297
+ }, {
298
+ readonly name: "deadline";
299
+ readonly type: "uint256";
147
300
  }];
148
- readonly stateMutability: "view";
149
- }, {
150
- readonly type: "function";
151
- readonly name: "EIP712_VERSION";
152
- readonly inputs: readonly [];
153
- readonly outputs: readonly [{
154
- readonly name: "";
301
+ readonly Revoke: readonly [{
302
+ readonly name: "owner";
303
+ readonly type: "address";
304
+ }, {
305
+ readonly name: "index";
306
+ readonly type: "uint256";
307
+ }, {
308
+ readonly name: "reason";
155
309
  readonly type: "string";
156
- readonly internalType: "string";
157
- }];
158
- readonly stateMutability: "view";
159
- }, {
160
- readonly type: "function";
161
- readonly name: "MAX_KEY_BYTES";
162
- readonly inputs: readonly [];
163
- readonly outputs: readonly [{
164
- readonly name: "";
310
+ }, {
311
+ readonly name: "nonce";
165
312
  readonly type: "uint256";
166
- readonly internalType: "uint256";
167
- }];
168
- readonly stateMutability: "view";
169
- }, {
170
- readonly type: "function";
171
- readonly name: "MAX_RECORD_BYTES";
172
- readonly inputs: readonly [];
173
- readonly outputs: readonly [{
174
- readonly name: "";
313
+ }, {
314
+ readonly name: "deadline";
175
315
  readonly type: "uint256";
176
- readonly internalType: "uint256";
177
316
  }];
178
- readonly stateMutability: "view";
179
- }, {
180
- readonly type: "function";
181
- readonly name: "MAX_SIG_BYTES";
182
- readonly inputs: readonly [];
183
- readonly outputs: readonly [{
184
- readonly name: "";
317
+ readonly SetRecord: readonly [{
318
+ readonly name: "owner";
319
+ readonly type: "address";
320
+ }, {
321
+ readonly name: "index";
322
+ readonly type: "uint256";
323
+ }, {
324
+ readonly name: "kind";
325
+ readonly type: "string";
326
+ }, {
327
+ readonly name: "value";
328
+ readonly type: "string";
329
+ }, {
330
+ readonly name: "nonce";
331
+ readonly type: "uint256";
332
+ }, {
333
+ readonly name: "deadline";
185
334
  readonly type: "uint256";
186
- readonly internalType: "uint256";
187
335
  }];
188
- readonly stateMutability: "view";
189
- }, {
190
- readonly type: "function";
191
- readonly name: "MESSAGE_VERSION";
192
- readonly inputs: readonly [];
193
- readonly outputs: readonly [{
194
- readonly name: "";
195
- readonly type: "uint8";
196
- readonly internalType: "uint8";
336
+ readonly MarkCompromised: readonly [{
337
+ readonly name: "owner";
338
+ readonly type: "address";
339
+ }, {
340
+ readonly name: "index";
341
+ readonly type: "uint256";
342
+ }, {
343
+ readonly name: "nonce";
344
+ readonly type: "uint256";
345
+ }, {
346
+ readonly name: "deadline";
347
+ readonly type: "uint256";
197
348
  }];
198
- readonly stateMutability: "view";
199
- }, {
200
- readonly type: "function";
201
- readonly name: "REATTEST_TYPEHASH";
202
- readonly inputs: readonly [];
349
+ };
350
+ type AuthorizationAction = keyof typeof AUTHORIZATION_TYPES;
351
+ /** Every revoke reason a claim can show ('' = none given). "superseded" is set only by reattest. */
352
+ declare const REVOKE_REASONS: readonly ["", "compromised", "retired", "superseded", "other"];
353
+ type RevokeReason = (typeof REVOKE_REASONS)[number];
354
+ /** The reasons an owner can give to `revoke`. "compromised" is final: that address can never claim the key again. */
355
+ declare const OWNER_REVOKE_REASONS: readonly ["", "compromised", "retired", "other"];
356
+ interface Common {
357
+ owner: Hex;
358
+ nonce: bigint;
359
+ deadline: bigint;
360
+ }
361
+ /** `signature` and `key` are the raw bytes as `0x…` hex (or a clearsigned message as text). */
362
+ type AttestAuthorization = Common & {
363
+ fingerprint: string;
364
+ signature: string;
365
+ key: string;
366
+ };
367
+ type ReattestAuthorization = AttestAuthorization & {
368
+ revokeIndex: bigint;
369
+ keepRecords: boolean;
370
+ };
371
+ type UpdateKeyAuthorization = Common & {
372
+ index: bigint;
373
+ key: string;
374
+ };
375
+ type RevokeAuthorization = Common & {
376
+ index: bigint;
377
+ reason?: RevokeReason;
378
+ };
379
+ /** `kind` exactly as it will be submitted (the registry adds `thurin.` to undotted names itself). */
380
+ type SetRecordAuthorization = Common & {
381
+ index: bigint;
382
+ kind: string;
383
+ value: string;
384
+ };
385
+ /** Mark an already revoked or replaced claim compromised (`markCompromisedFor`). A Revoke permission never can. */
386
+ type MarkCompromisedAuthorization = Common & {
387
+ index: bigint;
388
+ };
389
+ /** The object to pass to viem/wagmi `signTypedData`. */
390
+ declare function attestTypedData(chainId: number, registry: Hex, a: AttestAuthorization): {
391
+ domain: TypedDataDomain;
392
+ types: {
393
+ Attest: readonly [{
394
+ readonly name: "owner";
395
+ readonly type: "address";
396
+ }, {
397
+ readonly name: "fingerprint";
398
+ readonly type: "bytes";
399
+ }, {
400
+ readonly name: "signature";
401
+ readonly type: "bytes";
402
+ }, {
403
+ readonly name: "key";
404
+ readonly type: "bytes";
405
+ }, {
406
+ readonly name: "nonce";
407
+ readonly type: "uint256";
408
+ }, {
409
+ readonly name: "deadline";
410
+ readonly type: "uint256";
411
+ }];
412
+ };
413
+ primaryType: "Attest";
414
+ message: {
415
+ owner: `0x${string}`;
416
+ fingerprint: `0x${string}`;
417
+ signature: `0x${string}`;
418
+ key: `0x${string}`;
419
+ nonce: bigint;
420
+ deadline: bigint;
421
+ };
422
+ };
423
+ declare function reattestTypedData(chainId: number, registry: Hex, a: ReattestAuthorization): {
424
+ domain: TypedDataDomain;
425
+ types: {
426
+ Reattest: readonly [{
427
+ readonly name: "owner";
428
+ readonly type: "address";
429
+ }, {
430
+ readonly name: "revokeIndex";
431
+ readonly type: "uint256";
432
+ }, {
433
+ readonly name: "fingerprint";
434
+ readonly type: "bytes";
435
+ }, {
436
+ readonly name: "signature";
437
+ readonly type: "bytes";
438
+ }, {
439
+ readonly name: "key";
440
+ readonly type: "bytes";
441
+ }, {
442
+ readonly name: "keepRecords";
443
+ readonly type: "bool";
444
+ }, {
445
+ readonly name: "nonce";
446
+ readonly type: "uint256";
447
+ }, {
448
+ readonly name: "deadline";
449
+ readonly type: "uint256";
450
+ }];
451
+ };
452
+ primaryType: "Reattest";
453
+ message: {
454
+ owner: `0x${string}`;
455
+ revokeIndex: bigint;
456
+ fingerprint: `0x${string}`;
457
+ signature: `0x${string}`;
458
+ key: `0x${string}`;
459
+ keepRecords: boolean;
460
+ nonce: bigint;
461
+ deadline: bigint;
462
+ };
463
+ };
464
+ declare function updateKeyTypedData(chainId: number, registry: Hex, a: UpdateKeyAuthorization): {
465
+ domain: TypedDataDomain;
466
+ types: {
467
+ UpdateKey: readonly [{
468
+ readonly name: "owner";
469
+ readonly type: "address";
470
+ }, {
471
+ readonly name: "index";
472
+ readonly type: "uint256";
473
+ }, {
474
+ readonly name: "key";
475
+ readonly type: "bytes";
476
+ }, {
477
+ readonly name: "nonce";
478
+ readonly type: "uint256";
479
+ }, {
480
+ readonly name: "deadline";
481
+ readonly type: "uint256";
482
+ }];
483
+ };
484
+ primaryType: "UpdateKey";
485
+ message: {
486
+ owner: `0x${string}`;
487
+ index: bigint;
488
+ key: `0x${string}`;
489
+ nonce: bigint;
490
+ deadline: bigint;
491
+ };
492
+ };
493
+ declare function revokeTypedData(chainId: number, registry: Hex, a: RevokeAuthorization): {
494
+ domain: TypedDataDomain;
495
+ types: {
496
+ Revoke: readonly [{
497
+ readonly name: "owner";
498
+ readonly type: "address";
499
+ }, {
500
+ readonly name: "index";
501
+ readonly type: "uint256";
502
+ }, {
503
+ readonly name: "reason";
504
+ readonly type: "string";
505
+ }, {
506
+ readonly name: "nonce";
507
+ readonly type: "uint256";
508
+ }, {
509
+ readonly name: "deadline";
510
+ readonly type: "uint256";
511
+ }];
512
+ };
513
+ primaryType: "Revoke";
514
+ message: {
515
+ owner: `0x${string}`;
516
+ index: bigint;
517
+ reason: "" | "compromised" | "retired" | "superseded" | "other";
518
+ nonce: bigint;
519
+ deadline: bigint;
520
+ };
521
+ };
522
+ declare function setRecordTypedData(chainId: number, registry: Hex, a: SetRecordAuthorization): {
523
+ domain: TypedDataDomain;
524
+ types: {
525
+ SetRecord: readonly [{
526
+ readonly name: "owner";
527
+ readonly type: "address";
528
+ }, {
529
+ readonly name: "index";
530
+ readonly type: "uint256";
531
+ }, {
532
+ readonly name: "kind";
533
+ readonly type: "string";
534
+ }, {
535
+ readonly name: "value";
536
+ readonly type: "string";
537
+ }, {
538
+ readonly name: "nonce";
539
+ readonly type: "uint256";
540
+ }, {
541
+ readonly name: "deadline";
542
+ readonly type: "uint256";
543
+ }];
544
+ };
545
+ primaryType: "SetRecord";
546
+ message: {
547
+ owner: `0x${string}`;
548
+ index: bigint;
549
+ kind: string;
550
+ value: string;
551
+ nonce: bigint;
552
+ deadline: bigint;
553
+ };
554
+ };
555
+ declare function markCompromisedTypedData(chainId: number, registry: Hex, a: MarkCompromisedAuthorization): {
556
+ domain: TypedDataDomain;
557
+ types: {
558
+ MarkCompromised: readonly [{
559
+ readonly name: "owner";
560
+ readonly type: "address";
561
+ }, {
562
+ readonly name: "index";
563
+ readonly type: "uint256";
564
+ }, {
565
+ readonly name: "nonce";
566
+ readonly type: "uint256";
567
+ }, {
568
+ readonly name: "deadline";
569
+ readonly type: "uint256";
570
+ }];
571
+ };
572
+ primaryType: "MarkCompromised";
573
+ message: {
574
+ owner: `0x${string}`;
575
+ index: bigint;
576
+ nonce: bigint;
577
+ deadline: bigint;
578
+ };
579
+ };
580
+ /** The digest the registry recovers the signer from. */
581
+ declare function authorizationDigest(typedData: ReturnType<typeof attestTypedData | typeof reattestTypedData | typeof updateKeyTypedData | typeof revokeTypedData | typeof setRecordTypedData | typeof markCompromisedTypedData>): Hex;
582
+ /** Any client with viem's `getCode` and `readContract` (a viem PublicClient, or a stub in tests). */
583
+ interface PermissionReader {
584
+ getCode(args: {
585
+ address: Hex;
586
+ }): Promise<Hex | undefined>;
587
+ readContract(args: any): Promise<unknown>;
588
+ }
589
+ type PermissionCheck = {
590
+ ok: true;
591
+ } | {
592
+ ok: false;
593
+ reason: string;
594
+ signer?: Hex;
595
+ };
596
+ /**
597
+ * Is `signature` a permission from `owner`? Judged the way the registry judges it: a plain signature
598
+ * from the owner's key (any address, EIP-7702 accounts included), else, for an account with code (a
599
+ * Safe, a smart-account wallet), the account's own answer (EIP-1271). An ERC-6492 signature (from an
600
+ * account not on-chain yet) is refused with the reason: the registry asks the deployed account.
601
+ * `signer` is set when a plain signature came from someone else.
602
+ */
603
+ declare function permissionSigned(client: PermissionReader, typedData: Parameters<typeof authorizationDigest>[0], signature: Hex, owner: Hex): Promise<PermissionCheck>;
604
+ /** The hash the registry indexes a record name by (the `kindHash` in `RecordSet` events). */
605
+ declare function recordKind(name: string): Hex;
606
+
607
+ declare const REGISTRY_ABI: readonly [{
608
+ readonly type: "function";
609
+ readonly name: "ATTEST_TYPEHASH";
610
+ readonly inputs: readonly [];
203
611
  readonly outputs: readonly [{
204
612
  readonly name: "";
205
613
  readonly type: "bytes32";
@@ -208,7 +616,7 @@ declare const REGISTRY_ABI: readonly [{
208
616
  readonly stateMutability: "view";
209
617
  }, {
210
618
  readonly type: "function";
211
- readonly name: "REVOKE_TYPEHASH";
619
+ readonly name: "DOMAIN_SEPARATOR";
212
620
  readonly inputs: readonly [];
213
621
  readonly outputs: readonly [{
214
622
  readonly name: "";
@@ -218,56 +626,68 @@ declare const REGISTRY_ABI: readonly [{
218
626
  readonly stateMutability: "view";
219
627
  }, {
220
628
  readonly type: "function";
221
- readonly name: "SET_RECORD_TYPEHASH";
629
+ readonly name: "EIP712_NAME";
222
630
  readonly inputs: readonly [];
223
631
  readonly outputs: readonly [{
224
632
  readonly name: "";
225
- readonly type: "bytes32";
226
- readonly internalType: "bytes32";
633
+ readonly type: "string";
634
+ readonly internalType: "string";
227
635
  }];
228
636
  readonly stateMutability: "view";
229
637
  }, {
230
638
  readonly type: "function";
231
- readonly name: "UPDATE_KEY_TYPEHASH";
639
+ readonly name: "EIP712_VERSION";
232
640
  readonly inputs: readonly [];
233
641
  readonly outputs: readonly [{
234
642
  readonly name: "";
235
- readonly type: "bytes32";
236
- readonly internalType: "bytes32";
643
+ readonly type: "string";
644
+ readonly internalType: "string";
237
645
  }];
238
646
  readonly stateMutability: "view";
239
647
  }, {
240
648
  readonly type: "function";
241
- readonly name: "VERSION";
649
+ readonly name: "EPOCH";
242
650
  readonly inputs: readonly [];
243
651
  readonly outputs: readonly [{
244
652
  readonly name: "";
245
- readonly type: "uint8";
246
- readonly internalType: "uint8";
653
+ readonly type: "uint256";
654
+ readonly internalType: "uint256";
247
655
  }];
248
656
  readonly stateMutability: "view";
249
657
  }, {
250
658
  readonly type: "function";
251
- readonly name: "addressesFor";
252
- readonly inputs: readonly [{
253
- readonly name: "fingerprintHash";
659
+ readonly name: "MARK_COMPROMISED_TYPEHASH";
660
+ readonly inputs: readonly [];
661
+ readonly outputs: readonly [{
662
+ readonly name: "";
254
663
  readonly type: "bytes32";
255
664
  readonly internalType: "bytes32";
256
665
  }];
666
+ readonly stateMutability: "view";
667
+ }, {
668
+ readonly type: "function";
669
+ readonly name: "MAX_CLAIMS_PER_OWNER";
670
+ readonly inputs: readonly [];
257
671
  readonly outputs: readonly [{
258
672
  readonly name: "";
259
- readonly type: "address[]";
260
- readonly internalType: "address[]";
673
+ readonly type: "uint256";
674
+ readonly internalType: "uint256";
261
675
  }];
262
676
  readonly stateMutability: "view";
263
677
  }, {
264
678
  readonly type: "function";
265
- readonly name: "addressesForCount";
266
- readonly inputs: readonly [{
267
- readonly name: "fingerprintHash";
268
- readonly type: "bytes32";
269
- readonly internalType: "bytes32";
679
+ readonly name: "MAX_KEY_BYTES";
680
+ readonly inputs: readonly [];
681
+ readonly outputs: readonly [{
682
+ readonly name: "";
683
+ readonly type: "uint256";
684
+ readonly internalType: "uint256";
270
685
  }];
686
+ readonly stateMutability: "view";
687
+ }, {
688
+ readonly type: "function";
689
+ readonly name: "MAX_KIND_BYTES";
690
+ readonly inputs: readonly [];
271
691
  readonly outputs: readonly [{
272
692
  readonly name: "";
273
693
  readonly type: "uint256";
@@ -276,24 +696,134 @@ declare const REGISTRY_ABI: readonly [{
276
696
  readonly stateMutability: "view";
277
697
  }, {
278
698
  readonly type: "function";
279
- readonly name: "addressesForRange";
280
- readonly inputs: readonly [{
281
- readonly name: "fingerprintHash";
282
- readonly type: "bytes32";
283
- readonly internalType: "bytes32";
284
- }, {
285
- readonly name: "start";
699
+ readonly name: "MAX_PAYLOAD_BYTES";
700
+ readonly inputs: readonly [];
701
+ readonly outputs: readonly [{
702
+ readonly name: "";
703
+ readonly type: "uint256";
704
+ readonly internalType: "uint256";
705
+ }];
706
+ readonly stateMutability: "view";
707
+ }, {
708
+ readonly type: "function";
709
+ readonly name: "MAX_RECORD_BYTES";
710
+ readonly inputs: readonly [];
711
+ readonly outputs: readonly [{
712
+ readonly name: "";
713
+ readonly type: "uint256";
714
+ readonly internalType: "uint256";
715
+ }];
716
+ readonly stateMutability: "view";
717
+ }, {
718
+ readonly type: "function";
719
+ readonly name: "MAX_SIGNATURE_BYTES";
720
+ readonly inputs: readonly [];
721
+ readonly outputs: readonly [{
722
+ readonly name: "";
286
723
  readonly type: "uint256";
287
724
  readonly internalType: "uint256";
725
+ }];
726
+ readonly stateMutability: "view";
727
+ }, {
728
+ readonly type: "function";
729
+ readonly name: "MESSAGE_CLEARSIGNED";
730
+ readonly inputs: readonly [];
731
+ readonly outputs: readonly [{
732
+ readonly name: "";
733
+ readonly type: "uint8";
734
+ readonly internalType: "uint8";
735
+ }];
736
+ readonly stateMutability: "view";
737
+ }, {
738
+ readonly type: "function";
739
+ readonly name: "MESSAGE_DETACHED";
740
+ readonly inputs: readonly [];
741
+ readonly outputs: readonly [{
742
+ readonly name: "";
743
+ readonly type: "uint8";
744
+ readonly internalType: "uint8";
745
+ }];
746
+ readonly stateMutability: "view";
747
+ }, {
748
+ readonly type: "function";
749
+ readonly name: "REATTEST_TYPEHASH";
750
+ readonly inputs: readonly [];
751
+ readonly outputs: readonly [{
752
+ readonly name: "";
753
+ readonly type: "bytes32";
754
+ readonly internalType: "bytes32";
755
+ }];
756
+ readonly stateMutability: "view";
757
+ }, {
758
+ readonly type: "function";
759
+ readonly name: "REVOKE_TYPEHASH";
760
+ readonly inputs: readonly [];
761
+ readonly outputs: readonly [{
762
+ readonly name: "";
763
+ readonly type: "bytes32";
764
+ readonly internalType: "bytes32";
765
+ }];
766
+ readonly stateMutability: "view";
767
+ }, {
768
+ readonly type: "function";
769
+ readonly name: "SET_RECORD_TYPEHASH";
770
+ readonly inputs: readonly [];
771
+ readonly outputs: readonly [{
772
+ readonly name: "";
773
+ readonly type: "bytes32";
774
+ readonly internalType: "bytes32";
775
+ }];
776
+ readonly stateMutability: "view";
777
+ }, {
778
+ readonly type: "function";
779
+ readonly name: "UPDATE_KEY_TYPEHASH";
780
+ readonly inputs: readonly [];
781
+ readonly outputs: readonly [{
782
+ readonly name: "";
783
+ readonly type: "bytes32";
784
+ readonly internalType: "bytes32";
785
+ }];
786
+ readonly stateMutability: "view";
787
+ }, {
788
+ readonly type: "function";
789
+ readonly name: "VERSION";
790
+ readonly inputs: readonly [];
791
+ readonly outputs: readonly [{
792
+ readonly name: "";
793
+ readonly type: "uint8";
794
+ readonly internalType: "uint8";
795
+ }];
796
+ readonly stateMutability: "view";
797
+ }, {
798
+ readonly type: "function";
799
+ readonly name: "armorToBytes";
800
+ readonly inputs: readonly [{
801
+ readonly name: "armored";
802
+ readonly type: "string";
803
+ readonly internalType: "string";
804
+ }];
805
+ readonly outputs: readonly [{
806
+ readonly name: "";
807
+ readonly type: "bytes";
808
+ readonly internalType: "bytes";
809
+ }];
810
+ readonly stateMutability: "pure";
811
+ }, {
812
+ readonly type: "function";
813
+ readonly name: "armoredKey";
814
+ readonly inputs: readonly [{
815
+ readonly name: "owner";
816
+ readonly type: "address";
817
+ readonly internalType: "address";
288
818
  }, {
289
- readonly name: "count";
819
+ readonly name: "index";
290
820
  readonly type: "uint256";
291
821
  readonly internalType: "uint256";
292
822
  }];
293
823
  readonly outputs: readonly [{
294
- readonly name: "out";
295
- readonly type: "address[]";
296
- readonly internalType: "address[]";
824
+ readonly name: "";
825
+ readonly type: "string";
826
+ readonly internalType: "string";
297
827
  }];
298
828
  readonly stateMutability: "view";
299
829
  }, {
@@ -304,11 +834,11 @@ declare const REGISTRY_ABI: readonly [{
304
834
  readonly type: "bytes";
305
835
  readonly internalType: "bytes";
306
836
  }, {
307
- readonly name: "pgpSignature";
837
+ readonly name: "signature";
308
838
  readonly type: "bytes";
309
839
  readonly internalType: "bytes";
310
840
  }, {
311
- readonly name: "pgpPublicKey";
841
+ readonly name: "key";
312
842
  readonly type: "bytes";
313
843
  readonly internalType: "bytes";
314
844
  }];
@@ -330,11 +860,11 @@ declare const REGISTRY_ABI: readonly [{
330
860
  readonly type: "bytes";
331
861
  readonly internalType: "bytes";
332
862
  }, {
333
- readonly name: "pgpSignature";
863
+ readonly name: "signature";
334
864
  readonly type: "bytes";
335
865
  readonly internalType: "bytes";
336
866
  }, {
337
- readonly name: "pgpPublicKey";
867
+ readonly name: "key";
338
868
  readonly type: "bytes";
339
869
  readonly internalType: "bytes";
340
870
  }, {
@@ -342,7 +872,7 @@ declare const REGISTRY_ABI: readonly [{
342
872
  readonly type: "uint256";
343
873
  readonly internalType: "uint256";
344
874
  }, {
345
- readonly name: "signature";
875
+ readonly name: "permission";
346
876
  readonly type: "bytes";
347
877
  readonly internalType: "bytes";
348
878
  }];
@@ -354,7 +884,76 @@ declare const REGISTRY_ABI: readonly [{
354
884
  readonly stateMutability: "nonpayable";
355
885
  }, {
356
886
  readonly type: "function";
357
- readonly name: "attestationCount";
887
+ readonly name: "cancelAuthorization";
888
+ readonly inputs: readonly [];
889
+ readonly outputs: readonly [];
890
+ readonly stateMutability: "nonpayable";
891
+ }, {
892
+ readonly type: "function";
893
+ readonly name: "claim";
894
+ readonly inputs: readonly [{
895
+ readonly name: "owner";
896
+ readonly type: "address";
897
+ readonly internalType: "address";
898
+ }, {
899
+ readonly name: "index";
900
+ readonly type: "uint256";
901
+ readonly internalType: "uint256";
902
+ }];
903
+ readonly outputs: readonly [{
904
+ readonly name: "details";
905
+ readonly type: "tuple";
906
+ readonly internalType: "struct PGPRegistry.ClaimView";
907
+ readonly components: readonly [{
908
+ readonly name: "index";
909
+ readonly type: "uint256";
910
+ readonly internalType: "uint256";
911
+ }, {
912
+ readonly name: "fingerprint";
913
+ readonly type: "bytes";
914
+ readonly internalType: "bytes";
915
+ }, {
916
+ readonly name: "createdAt";
917
+ readonly type: "uint64";
918
+ readonly internalType: "uint64";
919
+ }, {
920
+ readonly name: "revokedAt";
921
+ readonly type: "uint64";
922
+ readonly internalType: "uint64";
923
+ }, {
924
+ readonly name: "state";
925
+ readonly type: "string";
926
+ readonly internalType: "string";
927
+ }, {
928
+ readonly name: "replacedBy";
929
+ readonly type: "uint256";
930
+ readonly internalType: "uint256";
931
+ }, {
932
+ readonly name: "revokeReason";
933
+ readonly type: "string";
934
+ readonly internalType: "string";
935
+ }, {
936
+ readonly name: "messageVersion";
937
+ readonly type: "uint8";
938
+ readonly internalType: "uint8";
939
+ }];
940
+ }, {
941
+ readonly name: "key";
942
+ readonly type: "string";
943
+ readonly internalType: "string";
944
+ }, {
945
+ readonly name: "statement";
946
+ readonly type: "string";
947
+ readonly internalType: "string";
948
+ }, {
949
+ readonly name: "recordKinds";
950
+ readonly type: "string[]";
951
+ readonly internalType: "string[]";
952
+ }];
953
+ readonly stateMutability: "view";
954
+ }, {
955
+ readonly type: "function";
956
+ readonly name: "claimCount";
358
957
  readonly inputs: readonly [{
359
958
  readonly name: "owner";
360
959
  readonly type: "address";
@@ -368,17 +967,21 @@ declare const REGISTRY_ABI: readonly [{
368
967
  readonly stateMutability: "view";
369
968
  }, {
370
969
  readonly type: "function";
371
- readonly name: "attestationsOf";
970
+ readonly name: "claimsOf";
372
971
  readonly inputs: readonly [{
373
972
  readonly name: "owner";
374
973
  readonly type: "address";
375
974
  readonly internalType: "address";
376
975
  }];
377
976
  readonly outputs: readonly [{
378
- readonly name: "";
977
+ readonly name: "out";
379
978
  readonly type: "tuple[]";
380
- readonly internalType: "struct PGPRegistry.Attestation[]";
979
+ readonly internalType: "struct PGPRegistry.ClaimView[]";
381
980
  readonly components: readonly [{
981
+ readonly name: "index";
982
+ readonly type: "uint256";
983
+ readonly internalType: "uint256";
984
+ }, {
382
985
  readonly name: "fingerprint";
383
986
  readonly type: "bytes";
384
987
  readonly internalType: "bytes";
@@ -390,24 +993,28 @@ declare const REGISTRY_ABI: readonly [{
390
993
  readonly name: "revokedAt";
391
994
  readonly type: "uint64";
392
995
  readonly internalType: "uint64";
996
+ }, {
997
+ readonly name: "state";
998
+ readonly type: "string";
999
+ readonly internalType: "string";
1000
+ }, {
1001
+ readonly name: "replacedBy";
1002
+ readonly type: "uint256";
1003
+ readonly internalType: "uint256";
1004
+ }, {
1005
+ readonly name: "revokeReason";
1006
+ readonly type: "string";
1007
+ readonly internalType: "string";
393
1008
  }, {
394
1009
  readonly name: "messageVersion";
395
1010
  readonly type: "uint8";
396
1011
  readonly internalType: "uint8";
397
- }, {
398
- readonly name: "keyPtr";
399
- readonly type: "address";
400
- readonly internalType: "address";
401
- }, {
402
- readonly name: "sigPtr";
403
- readonly type: "address";
404
- readonly internalType: "address";
405
1012
  }];
406
1013
  }];
407
1014
  readonly stateMutability: "view";
408
1015
  }, {
409
1016
  readonly type: "function";
410
- readonly name: "attestationsOfRange";
1017
+ readonly name: "claimsOfRange";
411
1018
  readonly inputs: readonly [{
412
1019
  readonly name: "owner";
413
1020
  readonly type: "address";
@@ -424,8 +1031,12 @@ declare const REGISTRY_ABI: readonly [{
424
1031
  readonly outputs: readonly [{
425
1032
  readonly name: "out";
426
1033
  readonly type: "tuple[]";
427
- readonly internalType: "struct PGPRegistry.Attestation[]";
1034
+ readonly internalType: "struct PGPRegistry.ClaimView[]";
428
1035
  readonly components: readonly [{
1036
+ readonly name: "index";
1037
+ readonly type: "uint256";
1038
+ readonly internalType: "uint256";
1039
+ }, {
429
1040
  readonly name: "fingerprint";
430
1041
  readonly type: "bytes";
431
1042
  readonly internalType: "bytes";
@@ -437,27 +1048,43 @@ declare const REGISTRY_ABI: readonly [{
437
1048
  readonly name: "revokedAt";
438
1049
  readonly type: "uint64";
439
1050
  readonly internalType: "uint64";
1051
+ }, {
1052
+ readonly name: "state";
1053
+ readonly type: "string";
1054
+ readonly internalType: "string";
1055
+ }, {
1056
+ readonly name: "replacedBy";
1057
+ readonly type: "uint256";
1058
+ readonly internalType: "uint256";
1059
+ }, {
1060
+ readonly name: "revokeReason";
1061
+ readonly type: "string";
1062
+ readonly internalType: "string";
440
1063
  }, {
441
1064
  readonly name: "messageVersion";
442
1065
  readonly type: "uint8";
443
1066
  readonly internalType: "uint8";
444
- }, {
445
- readonly name: "keyPtr";
446
- readonly type: "address";
447
- readonly internalType: "address";
448
- }, {
449
- readonly name: "sigPtr";
450
- readonly type: "address";
451
- readonly internalType: "address";
452
1067
  }];
453
1068
  }];
454
1069
  readonly stateMutability: "view";
455
1070
  }, {
456
1071
  readonly type: "function";
457
- readonly name: "cancelAuthorization";
458
- readonly inputs: readonly [];
459
- readonly outputs: readonly [];
460
- readonly stateMutability: "nonpayable";
1072
+ readonly name: "clearsigned";
1073
+ readonly inputs: readonly [{
1074
+ readonly name: "owner";
1075
+ readonly type: "address";
1076
+ readonly internalType: "address";
1077
+ }, {
1078
+ readonly name: "index";
1079
+ readonly type: "uint256";
1080
+ readonly internalType: "uint256";
1081
+ }];
1082
+ readonly outputs: readonly [{
1083
+ readonly name: "";
1084
+ readonly type: "string";
1085
+ readonly internalType: "string";
1086
+ }];
1087
+ readonly stateMutability: "view";
461
1088
  }, {
462
1089
  readonly type: "function";
463
1090
  readonly name: "current";
@@ -475,10 +1102,14 @@ declare const REGISTRY_ABI: readonly [{
475
1102
  readonly type: "uint256";
476
1103
  readonly internalType: "uint256";
477
1104
  }, {
478
- readonly name: "attestation";
1105
+ readonly name: "details";
479
1106
  readonly type: "tuple";
480
- readonly internalType: "struct PGPRegistry.Attestation";
1107
+ readonly internalType: "struct PGPRegistry.ClaimView";
481
1108
  readonly components: readonly [{
1109
+ readonly name: "index";
1110
+ readonly type: "uint256";
1111
+ readonly internalType: "uint256";
1112
+ }, {
482
1113
  readonly name: "fingerprint";
483
1114
  readonly type: "bytes";
484
1115
  readonly internalType: "bytes";
@@ -490,36 +1121,74 @@ declare const REGISTRY_ABI: readonly [{
490
1121
  readonly name: "revokedAt";
491
1122
  readonly type: "uint64";
492
1123
  readonly internalType: "uint64";
1124
+ }, {
1125
+ readonly name: "state";
1126
+ readonly type: "string";
1127
+ readonly internalType: "string";
1128
+ }, {
1129
+ readonly name: "replacedBy";
1130
+ readonly type: "uint256";
1131
+ readonly internalType: "uint256";
1132
+ }, {
1133
+ readonly name: "revokeReason";
1134
+ readonly type: "string";
1135
+ readonly internalType: "string";
493
1136
  }, {
494
1137
  readonly name: "messageVersion";
495
1138
  readonly type: "uint8";
496
1139
  readonly internalType: "uint8";
497
- }, {
498
- readonly name: "keyPtr";
499
- readonly type: "address";
500
- readonly internalType: "address";
501
- }, {
502
- readonly name: "sigPtr";
503
- readonly type: "address";
504
- readonly internalType: "address";
505
1140
  }];
506
1141
  }];
507
1142
  readonly stateMutability: "view";
508
1143
  }, {
509
1144
  readonly type: "function";
510
- readonly name: "fingerprintsForKeyId";
511
- readonly inputs: readonly [{
512
- readonly name: "keyId";
513
- readonly type: "bytes8";
514
- readonly internalType: "bytes8";
515
- }];
1145
+ readonly name: "eip712Domain";
1146
+ readonly inputs: readonly [];
516
1147
  readonly outputs: readonly [{
517
- readonly name: "";
518
- readonly type: "bytes[]";
519
- readonly internalType: "bytes[]";
520
- }];
521
- readonly stateMutability: "view";
522
- }, {
1148
+ readonly name: "fields";
1149
+ readonly type: "bytes1";
1150
+ readonly internalType: "bytes1";
1151
+ }, {
1152
+ readonly name: "name";
1153
+ readonly type: "string";
1154
+ readonly internalType: "string";
1155
+ }, {
1156
+ readonly name: "version";
1157
+ readonly type: "string";
1158
+ readonly internalType: "string";
1159
+ }, {
1160
+ readonly name: "chainId";
1161
+ readonly type: "uint256";
1162
+ readonly internalType: "uint256";
1163
+ }, {
1164
+ readonly name: "verifyingContract";
1165
+ readonly type: "address";
1166
+ readonly internalType: "address";
1167
+ }, {
1168
+ readonly name: "salt";
1169
+ readonly type: "bytes32";
1170
+ readonly internalType: "bytes32";
1171
+ }, {
1172
+ readonly name: "extensions";
1173
+ readonly type: "uint256[]";
1174
+ readonly internalType: "uint256[]";
1175
+ }];
1176
+ readonly stateMutability: "view";
1177
+ }, {
1178
+ readonly type: "function";
1179
+ readonly name: "fingerprintsForKeyId";
1180
+ readonly inputs: readonly [{
1181
+ readonly name: "keyId";
1182
+ readonly type: "bytes8";
1183
+ readonly internalType: "bytes8";
1184
+ }];
1185
+ readonly outputs: readonly [{
1186
+ readonly name: "";
1187
+ readonly type: "bytes[]";
1188
+ readonly internalType: "bytes[]";
1189
+ }];
1190
+ readonly stateMutability: "view";
1191
+ }, {
523
1192
  readonly type: "function";
524
1193
  readonly name: "fingerprintsForKeyIdCount";
525
1194
  readonly inputs: readonly [{
@@ -557,7 +1226,7 @@ declare const REGISTRY_ABI: readonly [{
557
1226
  readonly stateMutability: "view";
558
1227
  }, {
559
1228
  readonly type: "function";
560
- readonly name: "getAttestation";
1229
+ readonly name: "keyBytes";
561
1230
  readonly inputs: readonly [{
562
1231
  readonly name: "owner";
563
1232
  readonly type: "address";
@@ -567,40 +1236,33 @@ declare const REGISTRY_ABI: readonly [{
567
1236
  readonly type: "uint256";
568
1237
  readonly internalType: "uint256";
569
1238
  }];
1239
+ readonly outputs: readonly [{
1240
+ readonly name: "key";
1241
+ readonly type: "bytes";
1242
+ readonly internalType: "bytes";
1243
+ }];
1244
+ readonly stateMutability: "view";
1245
+ }, {
1246
+ readonly type: "function";
1247
+ readonly name: "keyStatus";
1248
+ readonly inputs: readonly [{
1249
+ readonly name: "owner";
1250
+ readonly type: "address";
1251
+ readonly internalType: "address";
1252
+ }, {
1253
+ readonly name: "fingerprint";
1254
+ readonly type: "bytes";
1255
+ readonly internalType: "bytes";
1256
+ }];
570
1257
  readonly outputs: readonly [{
571
1258
  readonly name: "";
572
- readonly type: "tuple";
573
- readonly internalType: "struct PGPRegistry.Attestation";
574
- readonly components: readonly [{
575
- readonly name: "fingerprint";
576
- readonly type: "bytes";
577
- readonly internalType: "bytes";
578
- }, {
579
- readonly name: "createdAt";
580
- readonly type: "uint64";
581
- readonly internalType: "uint64";
582
- }, {
583
- readonly name: "revokedAt";
584
- readonly type: "uint64";
585
- readonly internalType: "uint64";
586
- }, {
587
- readonly name: "messageVersion";
588
- readonly type: "uint8";
589
- readonly internalType: "uint8";
590
- }, {
591
- readonly name: "keyPtr";
592
- readonly type: "address";
593
- readonly internalType: "address";
594
- }, {
595
- readonly name: "sigPtr";
596
- readonly type: "address";
597
- readonly internalType: "address";
598
- }];
1259
+ readonly type: "string";
1260
+ readonly internalType: "string";
599
1261
  }];
600
1262
  readonly stateMutability: "view";
601
1263
  }, {
602
1264
  readonly type: "function";
603
- readonly name: "getPayload";
1265
+ readonly name: "markCompromisedFor";
604
1266
  readonly inputs: readonly [{
605
1267
  readonly name: "owner";
606
1268
  readonly type: "address";
@@ -609,22 +1271,36 @@ declare const REGISTRY_ABI: readonly [{
609
1271
  readonly name: "index";
610
1272
  readonly type: "uint256";
611
1273
  readonly internalType: "uint256";
612
- }];
613
- readonly outputs: readonly [{
614
- readonly name: "pgpSignature";
615
- readonly type: "bytes";
616
- readonly internalType: "bytes";
617
1274
  }, {
618
- readonly name: "pgpPublicKey";
1275
+ readonly name: "deadline";
1276
+ readonly type: "uint256";
1277
+ readonly internalType: "uint256";
1278
+ }, {
1279
+ readonly name: "permission";
619
1280
  readonly type: "bytes";
620
1281
  readonly internalType: "bytes";
621
1282
  }];
622
- readonly stateMutability: "view";
1283
+ readonly outputs: readonly [];
1284
+ readonly stateMutability: "nonpayable";
1285
+ }, {
1286
+ readonly type: "function";
1287
+ readonly name: "multicall";
1288
+ readonly inputs: readonly [{
1289
+ readonly name: "calls";
1290
+ readonly type: "bytes[]";
1291
+ readonly internalType: "bytes[]";
1292
+ }];
1293
+ readonly outputs: readonly [{
1294
+ readonly name: "results";
1295
+ readonly type: "bytes[]";
1296
+ readonly internalType: "bytes[]";
1297
+ }];
1298
+ readonly stateMutability: "nonpayable";
623
1299
  }, {
624
1300
  readonly type: "function";
625
1301
  readonly name: "nonces";
626
1302
  readonly inputs: readonly [{
627
- readonly name: "";
1303
+ readonly name: "owner";
628
1304
  readonly type: "address";
629
1305
  readonly internalType: "address";
630
1306
  }];
@@ -634,6 +1310,56 @@ declare const REGISTRY_ABI: readonly [{
634
1310
  readonly internalType: "uint256";
635
1311
  }];
636
1312
  readonly stateMutability: "view";
1313
+ }, {
1314
+ readonly type: "function";
1315
+ readonly name: "ownersOf";
1316
+ readonly inputs: readonly [{
1317
+ readonly name: "fingerprint";
1318
+ readonly type: "bytes";
1319
+ readonly internalType: "bytes";
1320
+ }];
1321
+ readonly outputs: readonly [{
1322
+ readonly name: "";
1323
+ readonly type: "address[]";
1324
+ readonly internalType: "address[]";
1325
+ }];
1326
+ readonly stateMutability: "view";
1327
+ }, {
1328
+ readonly type: "function";
1329
+ readonly name: "ownersOfCount";
1330
+ readonly inputs: readonly [{
1331
+ readonly name: "fingerprint";
1332
+ readonly type: "bytes";
1333
+ readonly internalType: "bytes";
1334
+ }];
1335
+ readonly outputs: readonly [{
1336
+ readonly name: "";
1337
+ readonly type: "uint256";
1338
+ readonly internalType: "uint256";
1339
+ }];
1340
+ readonly stateMutability: "view";
1341
+ }, {
1342
+ readonly type: "function";
1343
+ readonly name: "ownersOfRange";
1344
+ readonly inputs: readonly [{
1345
+ readonly name: "fingerprint";
1346
+ readonly type: "bytes";
1347
+ readonly internalType: "bytes";
1348
+ }, {
1349
+ readonly name: "start";
1350
+ readonly type: "uint256";
1351
+ readonly internalType: "uint256";
1352
+ }, {
1353
+ readonly name: "count";
1354
+ readonly type: "uint256";
1355
+ readonly internalType: "uint256";
1356
+ }];
1357
+ readonly outputs: readonly [{
1358
+ readonly name: "out";
1359
+ readonly type: "address[]";
1360
+ readonly internalType: "address[]";
1361
+ }];
1362
+ readonly stateMutability: "view";
637
1363
  }, {
638
1364
  readonly type: "function";
639
1365
  readonly name: "reattest";
@@ -646,13 +1372,17 @@ declare const REGISTRY_ABI: readonly [{
646
1372
  readonly type: "bytes";
647
1373
  readonly internalType: "bytes";
648
1374
  }, {
649
- readonly name: "pgpSignature";
1375
+ readonly name: "signature";
650
1376
  readonly type: "bytes";
651
1377
  readonly internalType: "bytes";
652
1378
  }, {
653
- readonly name: "pgpPublicKey";
1379
+ readonly name: "key";
654
1380
  readonly type: "bytes";
655
1381
  readonly internalType: "bytes";
1382
+ }, {
1383
+ readonly name: "keepRecords";
1384
+ readonly type: "bool";
1385
+ readonly internalType: "bool";
656
1386
  }];
657
1387
  readonly outputs: readonly [{
658
1388
  readonly name: "index";
@@ -676,19 +1406,23 @@ declare const REGISTRY_ABI: readonly [{
676
1406
  readonly type: "bytes";
677
1407
  readonly internalType: "bytes";
678
1408
  }, {
679
- readonly name: "pgpSignature";
1409
+ readonly name: "signature";
680
1410
  readonly type: "bytes";
681
1411
  readonly internalType: "bytes";
682
1412
  }, {
683
- readonly name: "pgpPublicKey";
1413
+ readonly name: "key";
684
1414
  readonly type: "bytes";
685
1415
  readonly internalType: "bytes";
1416
+ }, {
1417
+ readonly name: "keepRecords";
1418
+ readonly type: "bool";
1419
+ readonly internalType: "bool";
686
1420
  }, {
687
1421
  readonly name: "deadline";
688
1422
  readonly type: "uint256";
689
1423
  readonly internalType: "uint256";
690
1424
  }, {
691
- readonly name: "signature";
1425
+ readonly name: "permission";
692
1426
  readonly type: "bytes";
693
1427
  readonly internalType: "bytes";
694
1428
  }];
@@ -700,7 +1434,7 @@ declare const REGISTRY_ABI: readonly [{
700
1434
  readonly stateMutability: "nonpayable";
701
1435
  }, {
702
1436
  readonly type: "function";
703
- readonly name: "record";
1437
+ readonly name: "recordText";
704
1438
  readonly inputs: readonly [{
705
1439
  readonly name: "owner";
706
1440
  readonly type: "address";
@@ -711,13 +1445,35 @@ declare const REGISTRY_ABI: readonly [{
711
1445
  readonly internalType: "uint256";
712
1446
  }, {
713
1447
  readonly name: "kind";
714
- readonly type: "bytes32";
715
- readonly internalType: "bytes32";
1448
+ readonly type: "string";
1449
+ readonly internalType: "string";
716
1450
  }];
717
1451
  readonly outputs: readonly [{
718
1452
  readonly name: "";
719
- readonly type: "bytes";
720
- readonly internalType: "bytes";
1453
+ readonly type: "string";
1454
+ readonly internalType: "string";
1455
+ }];
1456
+ readonly stateMutability: "view";
1457
+ }, {
1458
+ readonly type: "function";
1459
+ readonly name: "recordsOf";
1460
+ readonly inputs: readonly [{
1461
+ readonly name: "owner";
1462
+ readonly type: "address";
1463
+ readonly internalType: "address";
1464
+ }, {
1465
+ readonly name: "index";
1466
+ readonly type: "uint256";
1467
+ readonly internalType: "uint256";
1468
+ }];
1469
+ readonly outputs: readonly [{
1470
+ readonly name: "kinds";
1471
+ readonly type: "string[]";
1472
+ readonly internalType: "string[]";
1473
+ }, {
1474
+ readonly name: "values";
1475
+ readonly type: "string[]";
1476
+ readonly internalType: "string[]";
721
1477
  }];
722
1478
  readonly stateMutability: "view";
723
1479
  }, {
@@ -727,6 +1483,10 @@ declare const REGISTRY_ABI: readonly [{
727
1483
  readonly name: "index";
728
1484
  readonly type: "uint256";
729
1485
  readonly internalType: "uint256";
1486
+ }, {
1487
+ readonly name: "reason";
1488
+ readonly type: "string";
1489
+ readonly internalType: "string";
730
1490
  }];
731
1491
  readonly outputs: readonly [];
732
1492
  readonly stateMutability: "nonpayable";
@@ -741,12 +1501,16 @@ declare const REGISTRY_ABI: readonly [{
741
1501
  readonly name: "index";
742
1502
  readonly type: "uint256";
743
1503
  readonly internalType: "uint256";
1504
+ }, {
1505
+ readonly name: "reason";
1506
+ readonly type: "string";
1507
+ readonly internalType: "string";
744
1508
  }, {
745
1509
  readonly name: "deadline";
746
1510
  readonly type: "uint256";
747
1511
  readonly internalType: "uint256";
748
1512
  }, {
749
- readonly name: "signature";
1513
+ readonly name: "permission";
750
1514
  readonly type: "bytes";
751
1515
  readonly internalType: "bytes";
752
1516
  }];
@@ -761,12 +1525,12 @@ declare const REGISTRY_ABI: readonly [{
761
1525
  readonly internalType: "uint256";
762
1526
  }, {
763
1527
  readonly name: "kind";
764
- readonly type: "bytes32";
765
- readonly internalType: "bytes32";
1528
+ readonly type: "string";
1529
+ readonly internalType: "string";
766
1530
  }, {
767
1531
  readonly name: "value";
768
- readonly type: "bytes";
769
- readonly internalType: "bytes";
1532
+ readonly type: "string";
1533
+ readonly internalType: "string";
770
1534
  }];
771
1535
  readonly outputs: readonly [];
772
1536
  readonly stateMutability: "nonpayable";
@@ -783,23 +1547,81 @@ declare const REGISTRY_ABI: readonly [{
783
1547
  readonly internalType: "uint256";
784
1548
  }, {
785
1549
  readonly name: "kind";
786
- readonly type: "bytes32";
787
- readonly internalType: "bytes32";
1550
+ readonly type: "string";
1551
+ readonly internalType: "string";
788
1552
  }, {
789
1553
  readonly name: "value";
790
- readonly type: "bytes";
791
- readonly internalType: "bytes";
1554
+ readonly type: "string";
1555
+ readonly internalType: "string";
792
1556
  }, {
793
1557
  readonly name: "deadline";
794
1558
  readonly type: "uint256";
795
1559
  readonly internalType: "uint256";
796
1560
  }, {
797
- readonly name: "signature";
1561
+ readonly name: "permission";
798
1562
  readonly type: "bytes";
799
1563
  readonly internalType: "bytes";
800
1564
  }];
801
1565
  readonly outputs: readonly [];
802
1566
  readonly stateMutability: "nonpayable";
1567
+ }, {
1568
+ readonly type: "function";
1569
+ readonly name: "signatureBytes";
1570
+ readonly inputs: readonly [{
1571
+ readonly name: "owner";
1572
+ readonly type: "address";
1573
+ readonly internalType: "address";
1574
+ }, {
1575
+ readonly name: "index";
1576
+ readonly type: "uint256";
1577
+ readonly internalType: "uint256";
1578
+ }];
1579
+ readonly outputs: readonly [{
1580
+ readonly name: "signature";
1581
+ readonly type: "bytes";
1582
+ readonly internalType: "bytes";
1583
+ }];
1584
+ readonly stateMutability: "view";
1585
+ }, {
1586
+ readonly type: "function";
1587
+ readonly name: "statementFor";
1588
+ readonly inputs: readonly [{
1589
+ readonly name: "owner";
1590
+ readonly type: "address";
1591
+ readonly internalType: "address";
1592
+ }];
1593
+ readonly outputs: readonly [{
1594
+ readonly name: "";
1595
+ readonly type: "string";
1596
+ readonly internalType: "string";
1597
+ }];
1598
+ readonly stateMutability: "pure";
1599
+ }, {
1600
+ readonly type: "function";
1601
+ readonly name: "summary";
1602
+ readonly inputs: readonly [{
1603
+ readonly name: "owner";
1604
+ readonly type: "address";
1605
+ readonly internalType: "address";
1606
+ }];
1607
+ readonly outputs: readonly [{
1608
+ readonly name: "total";
1609
+ readonly type: "uint256";
1610
+ readonly internalType: "uint256";
1611
+ }, {
1612
+ readonly name: "active";
1613
+ readonly type: "uint256";
1614
+ readonly internalType: "uint256";
1615
+ }, {
1616
+ readonly name: "hasCurrent";
1617
+ readonly type: "bool";
1618
+ readonly internalType: "bool";
1619
+ }, {
1620
+ readonly name: "currentIndex";
1621
+ readonly type: "uint256";
1622
+ readonly internalType: "uint256";
1623
+ }];
1624
+ readonly stateMutability: "view";
803
1625
  }, {
804
1626
  readonly type: "function";
805
1627
  readonly name: "updateKey";
@@ -808,7 +1630,7 @@ declare const REGISTRY_ABI: readonly [{
808
1630
  readonly type: "uint256";
809
1631
  readonly internalType: "uint256";
810
1632
  }, {
811
- readonly name: "pgpPublicKey";
1633
+ readonly name: "key";
812
1634
  readonly type: "bytes";
813
1635
  readonly internalType: "bytes";
814
1636
  }];
@@ -826,7 +1648,7 @@ declare const REGISTRY_ABI: readonly [{
826
1648
  readonly type: "uint256";
827
1649
  readonly internalType: "uint256";
828
1650
  }, {
829
- readonly name: "pgpPublicKey";
1651
+ readonly name: "key";
830
1652
  readonly type: "bytes";
831
1653
  readonly internalType: "bytes";
832
1654
  }, {
@@ -834,7 +1656,7 @@ declare const REGISTRY_ABI: readonly [{
834
1656
  readonly type: "uint256";
835
1657
  readonly internalType: "uint256";
836
1658
  }, {
837
- readonly name: "signature";
1659
+ readonly name: "permission";
838
1660
  readonly type: "bytes";
839
1661
  readonly internalType: "bytes";
840
1662
  }];
@@ -864,20 +1686,15 @@ declare const REGISTRY_ABI: readonly [{
864
1686
  readonly indexed: false;
865
1687
  readonly internalType: "bytes";
866
1688
  }, {
867
- readonly name: "messageVersion";
868
- readonly type: "uint8";
869
- readonly indexed: false;
870
- readonly internalType: "uint8";
871
- }, {
872
- readonly name: "keyPtr";
1689
+ readonly name: "payload";
873
1690
  readonly type: "address";
874
1691
  readonly indexed: false;
875
1692
  readonly internalType: "address";
876
1693
  }, {
877
- readonly name: "sigPtr";
878
- readonly type: "address";
1694
+ readonly name: "messageVersion";
1695
+ readonly type: "uint8";
879
1696
  readonly indexed: false;
880
- readonly internalType: "address";
1697
+ readonly internalType: "uint8";
881
1698
  }, {
882
1699
  readonly name: "submitter";
883
1700
  readonly type: "address";
@@ -904,12 +1721,12 @@ declare const REGISTRY_ABI: readonly [{
904
1721
  readonly indexed: true;
905
1722
  readonly internalType: "uint256";
906
1723
  }, {
907
- readonly name: "oldKeyPtr";
1724
+ readonly name: "oldPayload";
908
1725
  readonly type: "address";
909
1726
  readonly indexed: false;
910
1727
  readonly internalType: "address";
911
1728
  }, {
912
- readonly name: "newKeyPtr";
1729
+ readonly name: "newPayload";
913
1730
  readonly type: "address";
914
1731
  readonly indexed: false;
915
1732
  readonly internalType: "address";
@@ -949,10 +1766,20 @@ declare const REGISTRY_ABI: readonly [{
949
1766
  readonly indexed: true;
950
1767
  readonly internalType: "uint256";
951
1768
  }, {
952
- readonly name: "kind";
1769
+ readonly name: "kindHash";
953
1770
  readonly type: "bytes32";
954
1771
  readonly indexed: true;
955
1772
  readonly internalType: "bytes32";
1773
+ }, {
1774
+ readonly name: "kind";
1775
+ readonly type: "string";
1776
+ readonly indexed: false;
1777
+ readonly internalType: "string";
1778
+ }, {
1779
+ readonly name: "value";
1780
+ readonly type: "string";
1781
+ readonly indexed: false;
1782
+ readonly internalType: "string";
956
1783
  }, {
957
1784
  readonly name: "submitter";
958
1785
  readonly type: "address";
@@ -960,6 +1787,26 @@ declare const REGISTRY_ABI: readonly [{
960
1787
  readonly internalType: "address";
961
1788
  }];
962
1789
  readonly anonymous: false;
1790
+ }, {
1791
+ readonly type: "event";
1792
+ readonly name: "RecordsMoved";
1793
+ readonly inputs: readonly [{
1794
+ readonly name: "owner";
1795
+ readonly type: "address";
1796
+ readonly indexed: true;
1797
+ readonly internalType: "address";
1798
+ }, {
1799
+ readonly name: "fromIndex";
1800
+ readonly type: "uint256";
1801
+ readonly indexed: true;
1802
+ readonly internalType: "uint256";
1803
+ }, {
1804
+ readonly name: "toIndex";
1805
+ readonly type: "uint256";
1806
+ readonly indexed: true;
1807
+ readonly internalType: "uint256";
1808
+ }];
1809
+ readonly anonymous: false;
963
1810
  }, {
964
1811
  readonly type: "event";
965
1812
  readonly name: "Revoked";
@@ -978,6 +1825,16 @@ declare const REGISTRY_ABI: readonly [{
978
1825
  readonly type: "uint256";
979
1826
  readonly indexed: true;
980
1827
  readonly internalType: "uint256";
1828
+ }, {
1829
+ readonly name: "reason";
1830
+ readonly type: "string";
1831
+ readonly indexed: false;
1832
+ readonly internalType: "string";
1833
+ }, {
1834
+ readonly name: "replacedBy";
1835
+ readonly type: "uint256";
1836
+ readonly indexed: false;
1837
+ readonly internalType: "uint256";
981
1838
  }, {
982
1839
  readonly name: "submitter";
983
1840
  readonly type: "address";
@@ -988,11 +1845,27 @@ declare const REGISTRY_ABI: readonly [{
988
1845
  }, {
989
1846
  readonly type: "error";
990
1847
  readonly name: "AlreadyRevoked";
1848
+ readonly inputs: readonly [{
1849
+ readonly name: "index";
1850
+ readonly type: "uint256";
1851
+ readonly internalType: "uint256";
1852
+ }];
1853
+ }, {
1854
+ readonly type: "error";
1855
+ readonly name: "BadArmorChecksum";
991
1856
  readonly inputs: readonly [];
992
1857
  }, {
993
1858
  readonly type: "error";
994
- readonly name: "AuthorizationExpired";
1859
+ readonly name: "BadBase64";
995
1860
  readonly inputs: readonly [];
1861
+ }, {
1862
+ readonly type: "error";
1863
+ readonly name: "ClaimActive";
1864
+ readonly inputs: readonly [{
1865
+ readonly name: "index";
1866
+ readonly type: "uint256";
1867
+ readonly internalType: "uint256";
1868
+ }];
996
1869
  }, {
997
1870
  readonly type: "error";
998
1871
  readonly name: "DeploymentFailed";
@@ -1000,10 +1873,14 @@ declare const REGISTRY_ABI: readonly [{
1000
1873
  }, {
1001
1874
  readonly type: "error";
1002
1875
  readonly name: "DuplicateActiveFingerprint";
1003
- readonly inputs: readonly [];
1876
+ readonly inputs: readonly [{
1877
+ readonly name: "fingerprint";
1878
+ readonly type: "bytes";
1879
+ readonly internalType: "bytes";
1880
+ }];
1004
1881
  }, {
1005
1882
  readonly type: "error";
1006
- readonly name: "EmptyPublicKey";
1883
+ readonly name: "EmptyKey";
1007
1884
  readonly inputs: readonly [];
1008
1885
  }, {
1009
1886
  readonly type: "error";
@@ -1012,14 +1889,42 @@ declare const REGISTRY_ABI: readonly [{
1012
1889
  }, {
1013
1890
  readonly type: "error";
1014
1891
  readonly name: "IndexOutOfBounds";
1015
- readonly inputs: readonly [];
1892
+ readonly inputs: readonly [{
1893
+ readonly name: "index";
1894
+ readonly type: "uint256";
1895
+ readonly internalType: "uint256";
1896
+ }, {
1897
+ readonly name: "count";
1898
+ readonly type: "uint256";
1899
+ readonly internalType: "uint256";
1900
+ }];
1016
1901
  }, {
1017
1902
  readonly type: "error";
1018
- readonly name: "InvalidAuthorization";
1019
- readonly inputs: readonly [];
1903
+ readonly name: "InvalidFingerprint";
1904
+ readonly inputs: readonly [{
1905
+ readonly name: "fingerprint";
1906
+ readonly type: "bytes";
1907
+ readonly internalType: "bytes";
1908
+ }];
1020
1909
  }, {
1021
1910
  readonly type: "error";
1022
1911
  readonly name: "InvalidFingerprintLength";
1912
+ readonly inputs: readonly [{
1913
+ readonly name: "length";
1914
+ readonly type: "uint256";
1915
+ readonly internalType: "uint256";
1916
+ }];
1917
+ }, {
1918
+ readonly type: "error";
1919
+ readonly name: "InvalidKindName";
1920
+ readonly inputs: readonly [{
1921
+ readonly name: "kind";
1922
+ readonly type: "string";
1923
+ readonly internalType: "string";
1924
+ }];
1925
+ }, {
1926
+ readonly type: "error";
1927
+ readonly name: "InvalidPermission";
1023
1928
  readonly inputs: readonly [];
1024
1929
  }, {
1025
1930
  readonly type: "error";
@@ -1027,31 +1932,125 @@ declare const REGISTRY_ABI: readonly [{
1027
1932
  readonly inputs: readonly [];
1028
1933
  }, {
1029
1934
  readonly type: "error";
1030
- readonly name: "PublicKeyTooLarge";
1935
+ readonly name: "KeyCompromised";
1936
+ readonly inputs: readonly [{
1937
+ readonly name: "fingerprint";
1938
+ readonly type: "bytes";
1939
+ readonly internalType: "bytes";
1940
+ }];
1941
+ }, {
1942
+ readonly type: "error";
1943
+ readonly name: "KeyStillActive";
1944
+ readonly inputs: readonly [{
1945
+ readonly name: "fingerprint";
1946
+ readonly type: "bytes";
1947
+ readonly internalType: "bytes";
1948
+ }];
1949
+ }, {
1950
+ readonly type: "error";
1951
+ readonly name: "KeyTooLarge";
1952
+ readonly inputs: readonly [{
1953
+ readonly name: "size";
1954
+ readonly type: "uint256";
1955
+ readonly internalType: "uint256";
1956
+ }, {
1957
+ readonly name: "max";
1958
+ readonly type: "uint256";
1959
+ readonly internalType: "uint256";
1960
+ }];
1961
+ }, {
1962
+ readonly type: "error";
1963
+ readonly name: "NotAKey";
1964
+ readonly inputs: readonly [{
1965
+ readonly name: "firstByte";
1966
+ readonly type: "bytes1";
1967
+ readonly internalType: "bytes1";
1968
+ }];
1969
+ }, {
1970
+ readonly type: "error";
1971
+ readonly name: "NotASignature";
1972
+ readonly inputs: readonly [{
1973
+ readonly name: "firstByte";
1974
+ readonly type: "bytes1";
1975
+ readonly internalType: "bytes1";
1976
+ }];
1977
+ }, {
1978
+ readonly type: "error";
1979
+ readonly name: "NotArmored";
1031
1980
  readonly inputs: readonly [];
1981
+ }, {
1982
+ readonly type: "error";
1983
+ readonly name: "PayloadTooLarge";
1984
+ readonly inputs: readonly [{
1985
+ readonly name: "size";
1986
+ readonly type: "uint256";
1987
+ readonly internalType: "uint256";
1988
+ }, {
1989
+ readonly name: "max";
1990
+ readonly type: "uint256";
1991
+ readonly internalType: "uint256";
1992
+ }];
1993
+ }, {
1994
+ readonly type: "error";
1995
+ readonly name: "PermissionExpired";
1996
+ readonly inputs: readonly [{
1997
+ readonly name: "deadline";
1998
+ readonly type: "uint256";
1999
+ readonly internalType: "uint256";
2000
+ }];
1032
2001
  }, {
1033
2002
  readonly type: "error";
1034
2003
  readonly name: "RecordTooLarge";
1035
- readonly inputs: readonly [];
2004
+ readonly inputs: readonly [{
2005
+ readonly name: "size";
2006
+ readonly type: "uint256";
2007
+ readonly internalType: "uint256";
2008
+ }, {
2009
+ readonly name: "max";
2010
+ readonly type: "uint256";
2011
+ readonly internalType: "uint256";
2012
+ }];
1036
2013
  }, {
1037
2014
  readonly type: "error";
1038
2015
  readonly name: "SignatureTooLarge";
2016
+ readonly inputs: readonly [{
2017
+ readonly name: "size";
2018
+ readonly type: "uint256";
2019
+ readonly internalType: "uint256";
2020
+ }, {
2021
+ readonly name: "max";
2022
+ readonly type: "uint256";
2023
+ readonly internalType: "uint256";
2024
+ }];
2025
+ }, {
2026
+ readonly type: "error";
2027
+ readonly name: "SupersededIsSetByReattest";
2028
+ readonly inputs: readonly [];
2029
+ }, {
2030
+ readonly type: "error";
2031
+ readonly name: "TooManyClaims";
2032
+ readonly inputs: readonly [];
2033
+ }, {
2034
+ readonly type: "error";
2035
+ readonly name: "UnknownRevokeReason";
2036
+ readonly inputs: readonly [{
2037
+ readonly name: "reason";
2038
+ readonly type: "string";
2039
+ readonly internalType: "string";
2040
+ }];
2041
+ }, {
2042
+ readonly type: "error";
2043
+ readonly name: "UnsupportedHeader";
1039
2044
  readonly inputs: readonly [];
1040
2045
  }];
1041
2046
 
1042
- /**
1043
- * PGPRegistry v2 is deployed with CREATE2, so it has the same address on every
1044
- * network. (v1 lived at 0xf7a45BC662A78a6fb417ED5f52b3766cbf13EbBb on mainnet and
1045
- * is no longer read by Thurin.)
1046
- */
1047
- declare const REGISTRY_ADDRESS: "0x9302E02e2869e129aC8516fE5eFFd51EA3082c09";
2047
+ /** PGPRegistry v3. Deployed with CREATE2, so the address is the same on mainnet, Sepolia, and a local anvil. */
2048
+ declare const REGISTRY_ADDRESS: "0xFa6956c11163517249f8A67F5560a4406B519451";
1048
2049
  /** Networks the PGPRegistry is deployed on. `mainnet` is the default everywhere. */
1049
2050
  type NetworkName = 'mainnet' | 'sepolia' | 'local';
1050
2051
  interface RegistryDeployment {
1051
2052
  chainId: number;
1052
2053
  address: `0x${string}`;
1053
- /** Block the registry was deployed in (informational; v2 needs no log scans). */
1054
- deployBlock: bigint;
1055
2054
  /** Block explorer base URL for address/tx links. Empty when there is none. */
1056
2055
  explorerUrl: string;
1057
2056
  /** Keyless public RPC used when no rpcUrl is configured. */
@@ -1099,14 +2098,17 @@ declare function chainFor(network?: NetworkName): {
1099
2098
  };
1100
2099
  };
1101
2100
  sourceId?: number | undefined | undefined;
2101
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
1102
2102
  testnet: true;
1103
2103
  custom?: Record<string, unknown> | undefined;
1104
2104
  extendSchema?: Record<string, unknown> | undefined;
1105
2105
  fees?: viem.ChainFees<undefined> | undefined;
1106
2106
  formatters?: undefined;
1107
2107
  prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
2108
+ client: viem.Client;
1108
2109
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1109
2110
  }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
2111
+ client: viem.Client;
1110
2112
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1111
2113
  }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1112
2114
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
@@ -1152,14 +2154,17 @@ declare function chainFor(network?: NetworkName): {
1152
2154
  };
1153
2155
  };
1154
2156
  sourceId?: number | undefined | undefined;
2157
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
1155
2158
  testnet?: boolean | undefined | undefined;
1156
2159
  custom?: Record<string, unknown> | undefined;
1157
2160
  extendSchema?: Record<string, unknown> | undefined;
1158
2161
  fees?: viem.ChainFees<undefined> | undefined;
1159
2162
  formatters?: undefined;
1160
2163
  prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
2164
+ client: viem.Client;
1161
2165
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1162
2166
  }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
2167
+ client: viem.Client;
1163
2168
  phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1164
2169
  }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1165
2170
  runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
@@ -1187,479 +2192,178 @@ declare function chainFor(network?: NetworkName): {
1187
2192
  };
1188
2193
  ensTlds?: readonly string[] | undefined;
1189
2194
  id: 1;
1190
- name: "Ethereum";
1191
- nativeCurrency: {
1192
- readonly name: "Ether";
1193
- readonly symbol: "ETH";
1194
- readonly decimals: 18;
1195
- };
1196
- experimental_preconfirmationTime?: number | undefined | undefined;
1197
- rpcUrls: {
1198
- readonly default: {
1199
- readonly http: readonly ["https://eth.merkle.io"];
1200
- };
1201
- };
1202
- sourceId?: number | undefined | undefined;
1203
- testnet?: boolean | undefined | undefined;
1204
- custom?: Record<string, unknown> | undefined;
1205
- extendSchema?: Record<string, unknown> | undefined;
1206
- fees?: viem.ChainFees<undefined> | undefined;
1207
- formatters?: undefined;
1208
- prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1209
- phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1210
- }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1211
- phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1212
- }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1213
- runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1214
- }] | undefined;
1215
- serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1216
- verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1217
- };
1218
-
1219
- /**
1220
- * The `id.thurin` ENS text record: a name points at the PGP key claimed on the Thurin
1221
- * registry by the address the name resolves to. It is a discovery hint, not part of the
1222
- * trust chain — the name owner set the address, the address signed the claim, so a reader
1223
- * verifies by resolving the name and reading the registry. The record only says where to
1224
- * look. `id.thurin` is a service key under ENSIP-5 (reverse-dot of thurin.id); ENSIP-18
1225
- * says service-key values are bare, so the value is the 40-hex fingerprint, uppercase.
1226
- */
1227
- declare const ENS_HINT_KEY: "id.thurin";
1228
- type EnsHintState = 'match' | 'unset' | 'mismatch';
1229
- interface EnsHint {
1230
- key: typeof ENS_HINT_KEY;
1231
- state: EnsHintState;
1232
- /** The raw record value, or null when the name carries no record. */
1233
- record: string | null;
1234
- /** The record as a lowercase fingerprint, or null when it does not parse as one. */
1235
- fingerprint: string | null;
1236
- /** The verified claim's fingerprint (lowercase) the record is compared against, if any. */
1237
- expected: string | null;
1238
- /** Why a record does not match; absent for `match` and `unset`. */
1239
- reason?: string;
1240
- }
1241
- /**
1242
- * Compare a name's `id.thurin` record with the fingerprint the registry verifies for the
1243
- * name's address. Parsing is lenient (case, spaces, 0x); what Thurin writes is strict.
1244
- */
1245
- declare function ensHintFor(record: string | null | undefined, verifiedFingerprint: string | null | undefined): EnsHint;
1246
- /** The value Thurin writes: the fingerprint, uppercase, bare. */
1247
- declare function ensHintValue(fingerprint: string): string;
1248
- /** The `text` / `setText` pair every ENS resolver speaks (ENSIP-5); the same on ENSv2. */
1249
- declare const ENS_TEXT_RESOLVER_ABI: readonly [{
1250
- readonly type: "function";
1251
- readonly name: "text";
1252
- readonly stateMutability: "view";
1253
- readonly inputs: readonly [{
1254
- readonly name: "node";
1255
- readonly type: "bytes32";
1256
- }, {
1257
- readonly name: "key";
1258
- readonly type: "string";
1259
- }];
1260
- readonly outputs: readonly [{
1261
- readonly name: "";
1262
- readonly type: "string";
1263
- }];
1264
- }, {
1265
- readonly type: "function";
1266
- readonly name: "setText";
1267
- readonly stateMutability: "nonpayable";
1268
- readonly inputs: readonly [{
1269
- readonly name: "node";
1270
- readonly type: "bytes32";
1271
- }, {
1272
- readonly name: "key";
1273
- readonly type: "string";
1274
- }, {
1275
- readonly name: "value";
1276
- readonly type: "string";
1277
- }];
1278
- readonly outputs: readonly [];
1279
- }];
1280
- /**
1281
- * The `setText` call that links a name to a claim. The resolver address is not part of it
1282
- * on purpose: look it up at write time (`client.getEnsResolver({ name })`) — on ENSv2 every
1283
- * account has its own resolver, so a cached or hardcoded one is the wrong contract.
1284
- */
1285
- declare function ensHintWrite(name: string, fingerprint: string): {
1286
- abi: readonly [{
1287
- readonly type: "function";
1288
- readonly name: "text";
1289
- readonly stateMutability: "view";
1290
- readonly inputs: readonly [{
1291
- readonly name: "node";
1292
- readonly type: "bytes32";
1293
- }, {
1294
- readonly name: "key";
1295
- readonly type: "string";
1296
- }];
1297
- readonly outputs: readonly [{
1298
- readonly name: "";
1299
- readonly type: "string";
1300
- }];
1301
- }, {
1302
- readonly type: "function";
1303
- readonly name: "setText";
1304
- readonly stateMutability: "nonpayable";
1305
- readonly inputs: readonly [{
1306
- readonly name: "node";
1307
- readonly type: "bytes32";
1308
- }, {
1309
- readonly name: "key";
1310
- readonly type: "string";
1311
- }, {
1312
- readonly name: "value";
1313
- readonly type: "string";
1314
- }];
1315
- readonly outputs: readonly [];
1316
- }];
1317
- functionName: "setText";
1318
- args: readonly [`0x${string}`, "id.thurin", string];
1319
- name: string;
1320
- };
1321
- /** Minimal client shape: viem's PublicClient has both. */
1322
- interface EnsTextReader {
1323
- getEnsText(args: {
1324
- name: string;
1325
- key: string;
1326
- }): Promise<string | null>;
1327
- }
1328
- /** Read a name's `id.thurin` record and compare it with the verified fingerprint. */
1329
- declare function fetchEnsHint(client: EnsTextReader, name: string, verifiedFingerprint: string | null | undefined): Promise<EnsHint>;
1330
-
1331
- /**
1332
- * EIP-712 authorizations for the registry's relayed writes (`attestFor`, `reattestFor`,
1333
- * `updateKeyFor`, `revokeFor`, `setRecordFor`). The owner signs one of these typed
1334
- * structs; anyone can then submit the matching call and pay the gas. Every field is
1335
- * bound, plus the owner's current `nonce` (read with `nonces(owner)`) and a `deadline`.
1336
- *
1337
- * The domain includes the chain id, so an authorization for one network cannot be
1338
- * replayed on another even though the registry has the same address everywhere.
1339
- */
1340
- declare const EIP712_NAME = "Thurin PGPRegistry";
1341
- declare const EIP712_VERSION = "2";
1342
- declare function registryDomain(chainId: number, verifyingContract: Hex): TypedDataDomain;
1343
- declare const AUTHORIZATION_TYPES: {
1344
- readonly Attest: readonly [{
1345
- readonly name: "owner";
1346
- readonly type: "address";
1347
- }, {
1348
- readonly name: "fingerprint";
1349
- readonly type: "bytes";
1350
- }, {
1351
- readonly name: "pgpSignature";
1352
- readonly type: "bytes";
1353
- }, {
1354
- readonly name: "pgpPublicKey";
1355
- readonly type: "bytes";
1356
- }, {
1357
- readonly name: "nonce";
1358
- readonly type: "uint256";
1359
- }, {
1360
- readonly name: "deadline";
1361
- readonly type: "uint256";
1362
- }];
1363
- readonly Reattest: readonly [{
1364
- readonly name: "owner";
1365
- readonly type: "address";
1366
- }, {
1367
- readonly name: "revokeIndex";
1368
- readonly type: "uint256";
1369
- }, {
1370
- readonly name: "fingerprint";
1371
- readonly type: "bytes";
1372
- }, {
1373
- readonly name: "pgpSignature";
1374
- readonly type: "bytes";
1375
- }, {
1376
- readonly name: "pgpPublicKey";
1377
- readonly type: "bytes";
1378
- }, {
1379
- readonly name: "nonce";
1380
- readonly type: "uint256";
1381
- }, {
1382
- readonly name: "deadline";
1383
- readonly type: "uint256";
1384
- }];
1385
- readonly UpdateKey: readonly [{
1386
- readonly name: "owner";
1387
- readonly type: "address";
1388
- }, {
1389
- readonly name: "index";
1390
- readonly type: "uint256";
1391
- }, {
1392
- readonly name: "pgpPublicKey";
1393
- readonly type: "bytes";
1394
- }, {
1395
- readonly name: "nonce";
1396
- readonly type: "uint256";
1397
- }, {
1398
- readonly name: "deadline";
1399
- readonly type: "uint256";
1400
- }];
1401
- readonly Revoke: readonly [{
1402
- readonly name: "owner";
1403
- readonly type: "address";
1404
- }, {
1405
- readonly name: "index";
1406
- readonly type: "uint256";
1407
- }, {
1408
- readonly name: "nonce";
1409
- readonly type: "uint256";
1410
- }, {
1411
- readonly name: "deadline";
1412
- readonly type: "uint256";
1413
- }];
1414
- readonly SetRecord: readonly [{
1415
- readonly name: "owner";
1416
- readonly type: "address";
1417
- }, {
1418
- readonly name: "index";
1419
- readonly type: "uint256";
1420
- }, {
1421
- readonly name: "kind";
1422
- readonly type: "bytes32";
1423
- }, {
1424
- readonly name: "value";
1425
- readonly type: "bytes";
1426
- }, {
1427
- readonly name: "nonce";
1428
- readonly type: "uint256";
1429
- }, {
1430
- readonly name: "deadline";
1431
- readonly type: "uint256";
1432
- }];
1433
- };
1434
- type AuthorizationAction = keyof typeof AUTHORIZATION_TYPES;
1435
- interface Common {
1436
- owner: Hex;
1437
- nonce: bigint;
1438
- deadline: bigint;
1439
- }
1440
- type AttestAuthorization = Common & {
1441
- fingerprint: string;
1442
- pgpSignature: string;
1443
- pgpPublicKey: string;
1444
- };
1445
- type ReattestAuthorization = AttestAuthorization & {
1446
- revokeIndex: bigint;
1447
- };
1448
- type UpdateKeyAuthorization = Common & {
1449
- index: bigint;
1450
- pgpPublicKey: string;
1451
- };
1452
- type RevokeAuthorization = Common & {
1453
- index: bigint;
1454
- };
1455
- type SetRecordAuthorization = Common & {
1456
- index: bigint;
1457
- kind: Hex;
1458
- value: Hex;
1459
- };
1460
- /**
1461
- * Build the object to pass to viem/wagmi `signTypedData`. `fingerprint` is the hex
1462
- * fingerprint; `pgpSignature` / `pgpPublicKey` are the armored text exactly as they
1463
- * will be submitted (they are hashed as UTF-8 bytes).
1464
- */
1465
- declare function attestTypedData(chainId: number, registry: Hex, a: AttestAuthorization): {
1466
- domain: TypedDataDomain;
1467
- types: {
1468
- Attest: readonly [{
1469
- readonly name: "owner";
1470
- readonly type: "address";
1471
- }, {
1472
- readonly name: "fingerprint";
1473
- readonly type: "bytes";
1474
- }, {
1475
- readonly name: "pgpSignature";
1476
- readonly type: "bytes";
1477
- }, {
1478
- readonly name: "pgpPublicKey";
1479
- readonly type: "bytes";
1480
- }, {
1481
- readonly name: "nonce";
1482
- readonly type: "uint256";
1483
- }, {
1484
- readonly name: "deadline";
1485
- readonly type: "uint256";
1486
- }];
1487
- };
1488
- primaryType: "Attest";
1489
- message: {
1490
- owner: `0x${string}`;
1491
- fingerprint: `0x${string}`;
1492
- pgpSignature: `0x${string}`;
1493
- pgpPublicKey: `0x${string}`;
1494
- nonce: bigint;
1495
- deadline: bigint;
1496
- };
1497
- };
1498
- declare function reattestTypedData(chainId: number, registry: Hex, a: ReattestAuthorization): {
1499
- domain: TypedDataDomain;
1500
- types: {
1501
- Reattest: readonly [{
1502
- readonly name: "owner";
1503
- readonly type: "address";
1504
- }, {
1505
- readonly name: "revokeIndex";
1506
- readonly type: "uint256";
1507
- }, {
1508
- readonly name: "fingerprint";
1509
- readonly type: "bytes";
1510
- }, {
1511
- readonly name: "pgpSignature";
1512
- readonly type: "bytes";
1513
- }, {
1514
- readonly name: "pgpPublicKey";
1515
- readonly type: "bytes";
1516
- }, {
1517
- readonly name: "nonce";
1518
- readonly type: "uint256";
1519
- }, {
1520
- readonly name: "deadline";
1521
- readonly type: "uint256";
1522
- }];
1523
- };
1524
- primaryType: "Reattest";
1525
- message: {
1526
- revokeIndex: bigint;
1527
- owner: `0x${string}`;
1528
- fingerprint: `0x${string}`;
1529
- pgpSignature: `0x${string}`;
1530
- pgpPublicKey: `0x${string}`;
1531
- nonce: bigint;
1532
- deadline: bigint;
1533
- };
1534
- };
1535
- declare function updateKeyTypedData(chainId: number, registry: Hex, a: UpdateKeyAuthorization): {
1536
- domain: TypedDataDomain;
1537
- types: {
1538
- UpdateKey: readonly [{
1539
- readonly name: "owner";
1540
- readonly type: "address";
1541
- }, {
1542
- readonly name: "index";
1543
- readonly type: "uint256";
1544
- }, {
1545
- readonly name: "pgpPublicKey";
1546
- readonly type: "bytes";
1547
- }, {
1548
- readonly name: "nonce";
1549
- readonly type: "uint256";
1550
- }, {
1551
- readonly name: "deadline";
1552
- readonly type: "uint256";
1553
- }];
1554
- };
1555
- primaryType: "UpdateKey";
1556
- message: {
1557
- owner: `0x${string}`;
1558
- index: bigint;
1559
- pgpPublicKey: `0x${string}`;
1560
- nonce: bigint;
1561
- deadline: bigint;
1562
- };
1563
- };
1564
- declare function revokeTypedData(chainId: number, registry: Hex, a: RevokeAuthorization): {
1565
- domain: TypedDataDomain;
1566
- types: {
1567
- Revoke: readonly [{
1568
- readonly name: "owner";
1569
- readonly type: "address";
1570
- }, {
1571
- readonly name: "index";
1572
- readonly type: "uint256";
1573
- }, {
1574
- readonly name: "nonce";
1575
- readonly type: "uint256";
1576
- }, {
1577
- readonly name: "deadline";
1578
- readonly type: "uint256";
1579
- }];
2195
+ name: "Ethereum";
2196
+ nativeCurrency: {
2197
+ readonly name: "Ether";
2198
+ readonly symbol: "ETH";
2199
+ readonly decimals: 18;
1580
2200
  };
1581
- primaryType: "Revoke";
1582
- message: {
1583
- owner: `0x${string}`;
1584
- index: bigint;
1585
- nonce: bigint;
1586
- deadline: bigint;
2201
+ experimental_preconfirmationTime?: number | undefined | undefined;
2202
+ rpcUrls: {
2203
+ readonly default: {
2204
+ readonly http: readonly ["https://ethereum.reth.rs/rpc"];
2205
+ };
1587
2206
  };
2207
+ sourceId?: number | undefined | undefined;
2208
+ supportsTransactionReplacementDetection?: boolean | undefined | undefined;
2209
+ testnet?: boolean | undefined | undefined;
2210
+ custom?: Record<string, unknown> | undefined;
2211
+ extendSchema?: Record<string, unknown> | undefined;
2212
+ fees?: viem.ChainFees<undefined> | undefined;
2213
+ formatters?: undefined;
2214
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
2215
+ client: viem.Client;
2216
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
2217
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
2218
+ client: viem.Client;
2219
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
2220
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
2221
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
2222
+ }] | undefined;
2223
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
2224
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1588
2225
  };
1589
- declare function setRecordTypedData(chainId: number, registry: Hex, a: SetRecordAuthorization): {
1590
- domain: TypedDataDomain;
1591
- types: {
1592
- SetRecord: readonly [{
1593
- readonly name: "owner";
1594
- readonly type: "address";
1595
- }, {
1596
- readonly name: "index";
1597
- readonly type: "uint256";
1598
- }, {
1599
- readonly name: "kind";
1600
- readonly type: "bytes32";
1601
- }, {
1602
- readonly name: "value";
1603
- readonly type: "bytes";
1604
- }, {
1605
- readonly name: "nonce";
1606
- readonly type: "uint256";
1607
- }, {
1608
- readonly name: "deadline";
1609
- readonly type: "uint256";
1610
- }];
1611
- };
1612
- primaryType: "SetRecord";
1613
- message: {
1614
- owner: `0x${string}`;
1615
- index: bigint;
1616
- kind: `0x${string}`;
1617
- value: `0x${string}`;
1618
- nonce: bigint;
1619
- deadline: bigint;
2226
+
2227
+ /** Any client with viem's `readContract` (a viem PublicClient, or a stub in tests). */
2228
+ interface ClaimReader {
2229
+ readContract(args: any): Promise<unknown>;
2230
+ }
2231
+ type Address = `0x${string}`;
2232
+ /** How many of the newest claims `readClaims` reads and verifies by default. */
2233
+ declare const CLAIM_LIMIT = 50;
2234
+ /**
2235
+ * An address's claims, oldest first: every row from `claimsOf`, and for the newest `limit` the
2236
+ * stored key and signature, verified. Older claims come back with `verification: null` (not read):
2237
+ * an address can hold 65,535 claims, and each one checked costs two reads and a signature check.
2238
+ * A failed `claimsOf` read throws; a failed key or signature read leaves that claim unverified.
2239
+ */
2240
+ declare function readClaims(client: ClaimReader, owner: Address, { registry, limit }?: {
2241
+ registry?: Address;
2242
+ limit?: number;
2243
+ }): Promise<Attestation[]>;
2244
+ /** Where an address's key stands. verified: the newest active claim that verifies · not-counted: the
2245
+ * newest active claim, none verify (its `verification` says why) · inactive: only ended claims, the
2246
+ * newest · none: never claimed. */
2247
+ type KeyStanding = {
2248
+ kind: 'verified' | 'not-counted' | 'inactive';
2249
+ claim: Attestation;
2250
+ } | {
2251
+ kind: 'none';
2252
+ claim: null;
2253
+ };
2254
+ declare function keyStanding(claims: readonly Attestation[]): KeyStanding;
2255
+ /**
2256
+ * Every address that ever claimed a key, found by fingerprint (`ownersOf`) or long key ID
2257
+ * (`fingerprintsForKeyId`, then `ownersOf`). A key ID can match more than one key, so each owner
2258
+ * comes with the fingerprint it claimed. Malformed input finds nothing.
2259
+ */
2260
+ declare function findOwners(client: ClaimReader, key: {
2261
+ fingerprint: string;
2262
+ } | {
2263
+ keyId: string;
2264
+ }, { registry }?: {
2265
+ registry?: Address;
2266
+ }): Promise<{
2267
+ owner: Address;
2268
+ fingerprint: string;
2269
+ }[]>;
2270
+
2271
+ /** Why an identity can't take an encrypted message. */
2272
+ type EncryptRefusal = 'no-claim' | 'unverified' | 'no-encryption-subkey' | 'encryption-subkey-expired';
2273
+ interface EncryptionKey {
2274
+ ok: true;
2275
+ /** The claim that counts; its key is the one to encrypt to. */
2276
+ claim: Attestation;
2277
+ /** The claim's armored public key. */
2278
+ key: string;
2279
+ /** The key or subkey openpgp will encrypt to. */
2280
+ subkey: {
2281
+ fingerprint: string;
2282
+ algorithm: string;
2283
+ expires: string | null;
1620
2284
  };
2285
+ /** Unix seconds: when this key arrived on the identity (the claim's creation). */
2286
+ addedAt: number;
2287
+ /** Added within `recentDays`: a stolen wallet can only bring in a new key through a new claim. */
2288
+ changedRecently: boolean;
2289
+ }
2290
+ type EncryptionKeyResult = EncryptionKey | {
2291
+ ok: false;
2292
+ reason: EncryptRefusal;
2293
+ claim: Attestation | null;
2294
+ expired?: string | null;
1621
2295
  };
1622
- /** The digest the registry recovers the signer from — handy for tests and CLIs. */
1623
- declare function authorizationDigest(typedData: ReturnType<typeof attestTypedData | typeof reattestTypedData | typeof updateKeyTypedData | typeof revokeTypedData | typeof setRecordTypedData>): Hex;
1624
- /** `bytes32 kind` for a record from a human-readable name, e.g. recordKind('thurin.vouch'). */
1625
- declare function recordKind(name: string): Hex;
2296
+ /**
2297
+ * The key to encrypt to for an address, from its claims: only the claim that counts (`keyStanding`),
2298
+ * and only while an encryption key or subkey is valid. An unverified claim could be someone else's
2299
+ * fake claim for the address, so it is never used.
2300
+ */
2301
+ declare function encryptionKeyFor(claims: readonly Attestation[], { now, recentDays }?: {
2302
+ now?: number;
2303
+ recentDays?: number;
2304
+ }): Promise<EncryptionKeyResult>;
2305
+ /** One plain sentence for a refusal, for the page and the CLI alike. */
2306
+ declare function encryptRefusalText(r: Extract<EncryptionKeyResult, {
2307
+ ok: false;
2308
+ }>, formatDate?: (iso: string | null | undefined) => string): string;
2309
+ /** The warning to show above Encrypt when the key arrived recently; null otherwise. */
2310
+ declare function keyChangedText(k: EncryptionKey, now?: number): string | null;
2311
+ /**
2312
+ * Encrypt text or a file to a public key, with the kit's openpgp config. The recipient is hidden by
2313
+ * default (key ID zero, like gpg's --throw-keyids), so an intercepted message doesn't name its
2314
+ * recipient; their software tries each of their keys. Text comes back armored; a file as bytes.
2315
+ */
2316
+ declare function encryptTo(key: PgpInput, data: string | Uint8Array, { filename, armor, hideRecipient, date }?: {
2317
+ filename?: string;
2318
+ armor?: boolean;
2319
+ hideRecipient?: boolean;
2320
+ date?: Date;
2321
+ }): Promise<string | Uint8Array>;
2322
+
2323
+ /** Each custom error the registry can revert with, as a sentence to show people. From the contract's NatSpec. */
2324
+ declare const CONTRACT_ERROR_TEXT: Record<string, string>;
2325
+ /** The registry's custom error name inside a viem error, following `cause` down; null when it isn't a contract revert. */
2326
+ declare function contractErrorName(err: unknown): string | null;
2327
+ /** The sentence for a registry revert inside a viem error, or null when it isn't one. */
2328
+ declare function contractErrorText(err: unknown): string | null;
1626
2329
 
1627
2330
  /**
1628
- * Records: one small value per claim per kind, set only by the owner (or by anyone holding
1629
- * the owner's `setRecordFor` authorization), readable by anyone, clearable. The contract looks
1630
- * a record up by kind and cannot list them, so readers ask for the kinds they know.
2331
+ * Records: named text values on a claim, set only by the owner (or with the owner's
2332
+ * `setRecordFor` permission), readable by anyone, clearable. `recordsOf(owner, index)` lists them.
1631
2333
  *
1632
- * Conventions: kind = keccak256("thurin.<name>"); simple kinds are UTF-8 text, structured
1633
- * kinds small JSON with a `v`, encrypted kinds an armored PGP message; readers ignore unknown
1634
- * fields. Third parties use reverse-dot names (`com.example.thing`) without asking. 1 KB max.
2334
+ * Conventions: simple kinds are text, structured kinds small JSON with a `v`, encrypted kinds an
2335
+ * armored PGP message; readers ignore unknown fields. Third parties use reverse-dot names
2336
+ * (`com.example.thing`) without asking. 1 KB max.
1635
2337
  */
1636
2338
  declare const MAX_RECORD_BYTES = 1024;
2339
+ /** Longest record name, `thurin.` included. */
2340
+ declare const MAX_KIND_BYTES = 31;
1637
2341
  /** `thurin.` is the default namespace: kindName('canary') === 'thurin.canary'. Dotted names pass through. */
1638
2342
  declare function kindName(input: string): string;
1639
- /** Every kind Thurin defines. `thurin.pointer` is the Thurin Labs release list (CLI only; not shown on identity pages). */
1640
- declare const KNOWN_KINDS: readonly ["thurin.railgun", "thurin.security", "thurin.successor", "thurin.affiliation", "thurin.canary", "thurin.private", "thurin.disclosure", "thurin.pointer"];
2343
+ /** The full record name for `input`, or throws with the registry's rule (a-z 0-9 - . only, 31 bytes). */
2344
+ declare function checkKindName(input: string): string;
2345
+ /** `value` unchanged, or throws if it is over the registry's 1 KB. An empty value clears the record. */
2346
+ declare function checkRecordValue(value: string): string;
2347
+ /** Every kind Thurin defines, in the order an identity page shows them. */
2348
+ declare const KNOWN_KINDS: readonly ["thurin.railgun", "thurin.security", "thurin.successor", "thurin.affiliation", "thurin.canary", "thurin.releases", "thurin.private", "thurin.disclosure"];
1641
2349
  type KnownKind = (typeof KNOWN_KINDS)[number];
1642
- /** The kinds an identity page shows, in display order. */
1643
- declare const IDENTITY_KINDS: readonly KnownKind[];
1644
- declare function encodeRecord(value: string): Hex;
1645
- declare function decodeRecord(hex: Hex): string;
1646
- interface PointerEntry {
2350
+ interface ReleaseEntry {
1647
2351
  name: string;
1648
2352
  sha256: string;
1649
2353
  date: string;
1650
2354
  url?: string;
1651
2355
  }
1652
- interface PointerRecord {
2356
+ interface ReleasesRecord {
1653
2357
  v: 1;
1654
- releases: PointerEntry[];
2358
+ releases: ReleaseEntry[];
1655
2359
  }
1656
- declare function parsePointer(text: string): PointerRecord;
2360
+ declare function parseReleases(text: string): ReleasesRecord;
1657
2361
  /** Add a release, newest first; drop the oldest until it fits the 1 KB slot. */
1658
- declare function addPointer(existing: PointerRecord | null, entry: PointerEntry): {
1659
- record: PointerRecord;
1660
- dropped: PointerEntry[];
2362
+ declare function addRelease(existing: ReleasesRecord | null, entry: ReleaseEntry): {
2363
+ record: ReleasesRecord;
2364
+ dropped: ReleaseEntry[];
1661
2365
  };
1662
- declare function renderPointer(p: PointerRecord): string;
2366
+ declare function renderReleases(p: ReleasesRecord): string;
1663
2367
  /** A record as the identity page shows it: what was stored, and what it means if it parses. */
1664
2368
  interface ParsedRecord {
1665
2369
  kind: string;
@@ -1698,8 +2402,8 @@ type RecordData = {
1698
2402
  type: 'encrypted';
1699
2403
  recipients: number | null;
1700
2404
  } | {
1701
- type: 'pointer';
1702
- releases: PointerEntry[];
2405
+ type: 'releases';
2406
+ releases: ReleaseEntry[];
1703
2407
  } | {
1704
2408
  type: 'text';
1705
2409
  };
@@ -1712,133 +2416,33 @@ type RecordData = {
1712
2416
  declare function parseRecord(kind: string, text: string, opts?: {
1713
2417
  armoredKey?: string;
1714
2418
  }): Promise<ParsedRecord>;
1715
- /** Minimal client shape: viem's PublicClient has it. */
2419
+ /** Anything with viem's `readContract`, such as a viem `PublicClient`. */
1716
2420
  interface RecordReader {
1717
- readContract(args: {
1718
- address: `0x${string}`;
1719
- abi: unknown;
1720
- functionName: 'record';
1721
- args: readonly [`0x${string}`, bigint, Hex];
1722
- }): Promise<unknown>;
1723
- }
1724
- /**
1725
- * Read and parse the given kinds on one claim. Kinds with no record are left out.
1726
- * `registry` is the contract address; pass the kit's REGISTRY_ABI.
1727
- */
1728
- declare function fetchRecords(client: RecordReader, registry: `0x${string}`, abi: unknown, owner: `0x${string}`, index: number | bigint, kinds?: readonly string[], opts?: {
1729
- armoredKey?: string;
1730
- }): Promise<ParsedRecord[]>;
1731
-
1732
- declare function identifyProof(notation: Notation): Proof | null;
1733
- declare function displayUrl(proof: Proof): string;
1734
- declare function proofHref(proof: Proof): string | null;
1735
- declare function proofSecondaryHref(proof: Proof): string | null;
1736
- /**
1737
- * Farcaster proofs are read from a Farcaster node's HTTP API (`/v1/userNameProofByName`,
1738
- * `/v1/castsByFid`). The default is Quilibrium's public Hypersnap node, which needs no key and
1739
- * allows browser requests; it sees the visitor's IP and which account was checked. Point
1740
- * `farcasterHub` at your own node to avoid that, or pass a Neynar key to use Neynar's hub.
1741
- */
1742
- declare const FARCASTER_HUB = "https://haatz.quilibrium.com";
1743
- interface ProofOptions {
1744
- /** A Farcaster node's HTTP API base URL. Default: FARCASTER_HUB (keyless). */
1745
- farcasterHub?: string;
1746
- /** Optional: read Farcaster through Neynar's hub with this key instead. */
1747
- neynarApiKey?: string;
2421
+ readContract(args: any): Promise<unknown>;
1748
2422
  }
1749
2423
  /**
1750
- * Check one proof. The third argument is options; a plain string is still accepted as a
1751
- * Neynar API key (the pre-1.3.7 signature).
1752
- */
1753
- declare function verifyProof(proof: Proof, fingerprint: string, opts?: ProofOptions | string): Promise<PGPVerification>;
1754
-
1755
- declare function parsePgpKey(armoredKey: string): Promise<PGPKeyInfo | null>;
1756
- /**
1757
- * Verify a clearsigned message against an armored public key, the way gpg does: the signing
1758
- * key (or subkey) must be valid *now* — bound to this primary, unrevoked, unexpired — and the
1759
- * signature must be sound. We deliberately do not ask openpgp.verify(), which also demands
1760
- * the key was valid at the instant the signature was made. Thurin's update flow tells people
1761
- * to `export-minimal` after editing notations, which keeps only the newest self-certification;
1762
- * when that postdates the signature (Ben's own key, 2026-09-14: notations edited 16 minutes
1763
- * after signing), openpgp.verify() reports "Could not find valid self-signature" for a
1764
- * signature gpg verifies fine. A key that has since been revoked or expired still fails here.
1765
- * These are internals the .d.ts does not expose (the signature packet list, the
1766
- * CRLF-normalised text, LiteralDataPacket.setText); they are stable across openpgp.js 6 and
1767
- * exercised by the real-data tests in attestation.test.ts.
1768
- *
1769
- * Used for attestation statements and for clearsigned records such as `thurin.canary`.
2424
+ * The records on one claim, from `recordsOf`, as `{ kind, text }` pairs. `kinds` picks and orders
2425
+ * them (full names); `null` keeps every record in the order it was first set.
1770
2426
  */
1771
- declare function verifyClearsigned({ armoredKey, clearsigned }: {
1772
- armoredKey: string;
1773
- clearsigned: string;
1774
- }): Promise<{
1775
- verified: boolean;
1776
- reason?: string;
2427
+ declare function pickRecords(names: readonly string[], values: readonly string[], kinds?: readonly string[] | null): {
2428
+ kind: string;
1777
2429
  text: string;
1778
- }>;
1779
- declare function verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress, }: {
1780
- pgpPublicKey: string | null;
1781
- pgpSignature: string | null;
1782
- fingerprint: string;
1783
- ethAddress: string;
1784
- }): Promise<PGPVerification>;
1785
- interface StrippedKey {
1786
- /** Armored public key containing only the non-email user IDs. */
1787
- armored: string;
1788
- /** User IDs kept (no `@`). */
1789
- kept: string[];
1790
- /** User IDs removed (contained an `@`). */
1791
- removed: string[];
1792
- }
1793
- /**
1794
- * Remove every user ID that contains an email address, keeping the rest (and
1795
- * their self-certifications, so proof notations on a non-email user ID survive).
1796
- * Returns null when nothing would remain — openpgp needs at least one
1797
- * self-certified user ID to verify signatures, so such a key must not be
1798
- * published. The key material and subkeys are untouched; the fingerprint is
1799
- * unchanged.
1800
- */
1801
- declare function stripEmailUserIDs(armoredKey: string): Promise<StrippedKey | null>;
1802
- /** True when any user ID on the key contains an email address. */
1803
- declare function hasEmailUserID(armoredKey: string): Promise<boolean>;
1804
-
1805
- /**
1806
- * EFP social graph for an address. Followers are counted by EFP for any address,
1807
- * whether or not it has published a list of its own; following and top-8 exist
1808
- * only when it has (its "primary list"). An address with followers but no list
1809
- * — a project account that has never followed anyone — is still on EFP.
1810
- */
1811
- declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
1812
-
2430
+ }[];
1813
2431
  /**
1814
- * Why an identity couldn't be shown. A dead RPC must never read as a fact about the identity:
1815
- * viem's ENS lookup turns an unreachable RPC into "no address", and a failed registry read
1816
- * leaves every count at zero. So when a lookup comes back empty or fails, the hook asks the
1817
- * RPC for the block number and this decides which it was.
1818
- *
1819
- * - `rpc`: the RPC didn't answer; nothing about the identity is known
1820
- * - `not-found`: the RPC answered and the ENS name has no address
1821
- * - `read`: the RPC answers, but a registry read failed anyway
2432
+ * The records an identity page shows, in page order: Thurin's kinds in their display order, then
2433
+ * everyone else's in the order they were first set on the claim. Empty values are left out.
1822
2434
  */
1823
- type IdentityErrorKind = 'rpc' | 'not-found' | 'read';
1824
- interface IdentityLookupState {
1825
- /** An ENS name was looked up and came back with no address. */
1826
- ensEmpty: boolean;
1827
- /** The ENS lookup itself errored. */
1828
- ensFailed: boolean;
1829
- /** Reading the owner's claims from the registry errored. */
1830
- claimsFailed: boolean;
1831
- /** The block-number probe: undefined while not run or running. */
1832
- rpcAnswered: boolean | undefined;
1833
- }
1834
- /** Whether the lookup needs the RPC probe to be understood. */
1835
- declare function needsRpcProbe(s: Omit<IdentityLookupState, 'rpcAnswered'>): boolean;
1836
- /** null when nothing went wrong or the probe hasn't answered yet. */
1837
- declare function identityErrorKind(s: IdentityLookupState): IdentityErrorKind | null;
1838
- declare const IDENTITY_ERROR_TEXT: Record<IdentityErrorKind, string>;
2435
+ declare function pageRecords(names: readonly string[], values: readonly string[]): {
2436
+ kind: string;
2437
+ text: string;
2438
+ }[];
2439
+ /** Read and parse the records on one claim. Pass the kit's REGISTRY_ABI. */
2440
+ declare function fetchRecords(client: RecordReader, registry: `0x${string}`, abi: unknown, owner: `0x${string}`, index: number | bigint, kinds?: readonly string[] | null, opts?: {
2441
+ armoredKey?: string;
2442
+ }): Promise<ParsedRecord[]>;
1839
2443
 
1840
2444
  /**
1841
- * Plain words for a claim's state, shared by thurin.id, the CLI, and anyone embedding the kit,
2445
+ * Plain words for a claim's state, shared by thurin.id, the CLI, and anyone using the kit,
1842
2446
  * so every surface says the same thing. `sentence` is for visitors; `fix` is for the owner only
1843
2447
  * (thurin.id shows it when the connected wallet owns the claim).
1844
2448
  */
@@ -1855,6 +2459,11 @@ interface ClaimCheckText {
1855
2459
  }
1856
2460
  /** Label, visitor sentence, and owner fix for a verification result. */
1857
2461
  declare function claimCheckText(v: PGPVerification, formatDate?: (iso: string | null | undefined) => string): ClaimCheckText;
2462
+ /**
2463
+ * What's wrong with a key before it's published, when the problem is the key and not the signature;
2464
+ * null otherwise. For the attest screen and CLI, where claimCheckText's claim wording doesn't fit.
2465
+ */
2466
+ declare function keyProblemText(v: PGPVerification, formatDate?: (iso: string | null | undefined) => string): ClaimCheckText | null;
1858
2467
  /** Days until a verified claim's key (or signing subkey) expires, when that is within `withinDays`. */
1859
2468
  declare function expiresSoon(v: PGPVerification | null | undefined, now?: number, withinDays?: number): {
1860
2469
  days: number;
@@ -1870,36 +2479,27 @@ type ClaimFate = {
1870
2479
  } | {
1871
2480
  state: 'revoked';
1872
2481
  at: number;
2482
+ reason?: string;
1873
2483
  } | {
1874
2484
  state: 'replaced';
1875
2485
  at: number;
1876
2486
  by: number;
2487
+ compromised?: boolean;
1877
2488
  };
1878
- /**
1879
- * Active, revoked, or replaced, for each of one owner's claims (keyed by index). `reattest`
1880
- * revokes and attests in one transaction, so a claim revoked at the very second a newer claim
1881
- * of the same owner was created counts as replaced by it. The contract has no "superseded"
1882
- * event; this reads the same fact from the stored timestamps.
1883
- */
1884
- declare function claimFates(claims: Pick<Attestation, 'index' | 'createdAt' | 'revokedAt'>[]): Map<number, ClaimFate>;
1885
- /** "Revoked by its owner on Oct 3, 2026." / "Replaced by claim #2 on Oct 3, 2026." */
2489
+ /** Active, revoked (with the owner's reason), or replaced, for each of one owner's claims (keyed by index). */
2490
+ declare function claimFates(claims: Pick<Attestation, 'index' | 'revokedAt' | 'state' | 'replacedBy' | 'revokeReason'>[]): Map<number, ClaimFate>;
2491
+ /** "Revoked by its owner on Oct 3, 2026 (compromised)." / "Replaced by claim #2 on Oct 3, 2026." */
1886
2492
  declare function claimFateText(fate: ClaimFate, formatDate?: (seconds: number) => string): string | null;
1887
2493
 
1888
2494
  /**
1889
- * ENS avatars without the tracking pixel. The `avatar` record is a link the name's owner
1890
- * chooses; loading an ordinary https:// link would tell that owner's server the IP and time of
1891
- * everyone who views the card. So only images the owner can't watch load: content-addressed
1892
- * ones (IPFS, Arweave, inline data, or an NFT whose metadata and image are content-addressed)
1893
- * through public gateways, and euc.li, ENS Labs' host behind the ENS app's avatar upload
1894
- * (most avatars; ENS Labs sees the view, the name's owner doesn't). Anything else: no avatar.
1895
- */
1896
- /**
1897
- * Public IPFS gateways, tried in order: when an image fails to load, the next one is used.
1898
- * Any single public gateway can stop serving (ipfs.io and dweb.link went "service worker only"
1899
- * in 2026), so there is always a fallback. The gateway sees the viewer's IP and the avatar.
2495
+ * ENS avatars without the tracking pixel: an ordinary https:// avatar tells the name's owner who
2496
+ * viewed the page. Only images the owner can't watch load: content-addressed ones (IPFS, Arweave,
2497
+ * inline data, an NFT whose metadata and image are content-addressed) through public gateways, and
2498
+ * euc.li, where the ENS app stores uploads (ENS Labs sees the view; the owner doesn't).
1900
2499
  */
2500
+ /** Public IPFS gateways, tried in order when an image fails: any one can stop serving. Each sees the viewer's IP. */
1901
2501
  declare const IPFS_GATEWAYS: readonly ["https://ipfs.filebase.io/ipfs/", "https://gateway.pinata.cloud/ipfs/"];
1902
- /** The first gateway in IPFS_GATEWAYS (kept for code that imported it before 1.3.6). */
2502
+ /** The first gateway in IPFS_GATEWAYS. */
1903
2503
  declare const IPFS_GATEWAY: string;
1904
2504
  declare const ARWEAVE_GATEWAY = "https://arweave.net/";
1905
2505
  /** An image URL safe to load for `uri`, or null if loading it would reach a host the owner picked. */
@@ -1941,21 +2541,112 @@ declare const NFT_AVATAR_ABI: readonly [{
1941
2541
  */
1942
2542
  declare function nftAvatarImage(tokenUri: string, tokenId: bigint, fetchFn?: typeof fetch): Promise<string | null>;
1943
2543
 
1944
- /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
1945
- declare function normalizeFingerprint(input: string): string | null;
1946
- /** Fingerprint → the raw `bytes` argument the v2 registry takes (0x-prefixed, 20 or 32 bytes). */
1947
- declare function fingerprintToBytes(fingerprint: string): Hex;
1948
- /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
1949
- declare function bytesToFingerprint(bytes: Hex | string): string;
1950
- /** keccak256 of the raw fingerprint bytes — the `fingerprintHash` the registry indexes by. */
1951
- declare function fingerprintHash(fingerprint: string): Hex;
1952
2544
  /**
1953
- * The long key ID as the `bytes8` the registry indexes by. Per RFC 9580 §5.5.4 it is the
1954
- * low-order 8 bytes of a v4 (20-byte) fingerprint and the high-order 8 bytes of a v6
1955
- * (32-byte) fingerprint — the same value `gpg --keyid-format long` prints.
2545
+ * The `id.thurin` ENS text record points a name at the key its address claimed. A hint, not trust:
2546
+ * readers still resolve the name and verify the claim. It's an ENSIP-5 service key (reverse-dot of
2547
+ * thurin.id), so per ENSIP-18 the value is bare: the fingerprint, uppercase.
1956
2548
  */
1957
- declare function keyIdOf(fingerprint: string): Hex;
1958
- /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
1959
- declare function keyIdToBytes(keyId: string): Hex | null;
2549
+ declare const ENS_HINT_KEY: "id.thurin";
2550
+ type EnsHintState = 'match' | 'unset' | 'mismatch';
2551
+ interface EnsHint {
2552
+ key: typeof ENS_HINT_KEY;
2553
+ state: EnsHintState;
2554
+ /** The raw record value, or null when the name carries no record. */
2555
+ record: string | null;
2556
+ /** The record as a lowercase fingerprint, or null when it does not parse as one. */
2557
+ fingerprint: string | null;
2558
+ /** The verified claim's fingerprint (lowercase) the record is compared against, if any. */
2559
+ expected: string | null;
2560
+ /** Why a record does not match; absent for `match` and `unset`. */
2561
+ reason?: string;
2562
+ }
2563
+ /**
2564
+ * Compare a name's `id.thurin` record with the fingerprint the registry verifies for the
2565
+ * name's address. Parsing is lenient (case, spaces, 0x); what Thurin writes is strict.
2566
+ */
2567
+ declare function ensHintFor(record: string | null | undefined, verifiedFingerprint: string | null | undefined): EnsHint;
2568
+ /** The value Thurin writes: the fingerprint, uppercase, bare. */
2569
+ declare function ensHintValue(fingerprint: string): string;
2570
+ /** The `text` / `setText` pair every ENS resolver speaks (ENSIP-5); the same on ENSv2. */
2571
+ declare const ENS_TEXT_RESOLVER_ABI: readonly [{
2572
+ readonly type: "function";
2573
+ readonly name: "text";
2574
+ readonly stateMutability: "view";
2575
+ readonly inputs: readonly [{
2576
+ readonly name: "node";
2577
+ readonly type: "bytes32";
2578
+ }, {
2579
+ readonly name: "key";
2580
+ readonly type: "string";
2581
+ }];
2582
+ readonly outputs: readonly [{
2583
+ readonly name: "";
2584
+ readonly type: "string";
2585
+ }];
2586
+ }, {
2587
+ readonly type: "function";
2588
+ readonly name: "setText";
2589
+ readonly stateMutability: "nonpayable";
2590
+ readonly inputs: readonly [{
2591
+ readonly name: "node";
2592
+ readonly type: "bytes32";
2593
+ }, {
2594
+ readonly name: "key";
2595
+ readonly type: "string";
2596
+ }, {
2597
+ readonly name: "value";
2598
+ readonly type: "string";
2599
+ }];
2600
+ readonly outputs: readonly [];
2601
+ }];
2602
+ /**
2603
+ * The `setText` call that links a name to a claim. Look up the resolver at write time
2604
+ * (`client.getEnsResolver({ name })`): on ENSv2 every account has its own.
2605
+ */
2606
+ declare function ensHintWrite(name: string, fingerprint: string): {
2607
+ abi: readonly [{
2608
+ readonly type: "function";
2609
+ readonly name: "text";
2610
+ readonly stateMutability: "view";
2611
+ readonly inputs: readonly [{
2612
+ readonly name: "node";
2613
+ readonly type: "bytes32";
2614
+ }, {
2615
+ readonly name: "key";
2616
+ readonly type: "string";
2617
+ }];
2618
+ readonly outputs: readonly [{
2619
+ readonly name: "";
2620
+ readonly type: "string";
2621
+ }];
2622
+ }, {
2623
+ readonly type: "function";
2624
+ readonly name: "setText";
2625
+ readonly stateMutability: "nonpayable";
2626
+ readonly inputs: readonly [{
2627
+ readonly name: "node";
2628
+ readonly type: "bytes32";
2629
+ }, {
2630
+ readonly name: "key";
2631
+ readonly type: "string";
2632
+ }, {
2633
+ readonly name: "value";
2634
+ readonly type: "string";
2635
+ }];
2636
+ readonly outputs: readonly [];
2637
+ }];
2638
+ functionName: "setText";
2639
+ args: readonly [`0x${string}`, "id.thurin", string];
2640
+ name: string;
2641
+ };
2642
+ /** Minimal client shape: viem's PublicClient has both. */
2643
+ interface EnsTextReader {
2644
+ getEnsText(args: {
2645
+ name: string;
2646
+ key: string;
2647
+ }): Promise<string | null>;
2648
+ }
2649
+ /** Read a name's `id.thurin` record and compare it with the verified fingerprint. */
2650
+ declare function fetchEnsHint(client: EnsTextReader, name: string, verifiedFingerprint: string | null | undefined): Promise<EnsHint>;
1960
2651
 
1961
- export { ARWEAVE_GATEWAY, AUTHORIZATION_TYPES, type AttestAuthorization, type Attestation, type AuthorizationAction, CLAIM_CHECK_LABEL, type ClaimCheckKind, type ClaimCheckText, type ClaimFate, type EFPGraph, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, type EnsHint, type EnsHintState, type EnsTextReader, FARCASTER_HUB, IDENTITY_ERROR_TEXT, IDENTITY_KINDS, IPFS_GATEWAY, IPFS_GATEWAYS, type IdentityErrorKind, type IdentityKitConfig, type IdentityLookupState, KNOWN_KINDS, type KnownKind, MAX_RECORD_BYTES, NETWORKS, NFT_AVATAR_ABI, type NetworkName, type NftAvatar, type Notation, type PGPKeyInfo, type PGPVerification, type ParsedRecord, type PointerEntry, type PointerRecord, type Proof, type ProofOptions, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, type ReattestAuthorization, type RecordData, type RecordReader, type RegistryDeployment, type RevokeAuthorization, type SetRecordAuthorization, type StrippedKey, type SubkeyInfo, type Theme, type ThurinIdentity, type UpdateKeyAuthorization, addPointer, attestTypedData, authorizationDigest, avatarFallbacks, avatarUrl, bytesToFingerprint, chainFor, claimCheckText, claimFateText, claimFates, decodeRecord, displayUrl, encodeRecord, ensHintFor, ensHintValue, ensHintWrite, expiresSoon, expiresSoonText, fetchEFPGraph, fetchEnsHint, fetchRecords, fingerprintHash, fingerprintToBytes, formatClaimDate, 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 };
2652
+ export { ARWEAVE_GATEWAY, AUTHORIZATION_TYPES, type AttestAuthorization, type Attestation, type AuthorizationAction, CLAIM_CHECK_LABEL, CLAIM_LIMIT, CONTRACT_ERROR_TEXT, type ClaimCheckKind, type ClaimCheckText, type ClaimFate, type ClaimReader, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, type EncryptRefusal, type EncryptionKey, type EncryptionKeyResult, type EnsHint, type EnsHintState, type EnsTextReader, FARCASTER_HUB, IPFS_GATEWAY, IPFS_GATEWAYS, KNOWN_KINDS, type KeyStanding, type KnownKind, type LeanKey, MAX_KIND_BYTES, MAX_RECORD_BYTES, type MarkCompromisedAuthorization, NETWORKS, NFT_AVATAR_ABI, type NetworkName, type NftAvatar, type Notation, OWNER_REVOKE_REASONS, type PGPKeyInfo, type PGPVerification, type ParsedRecord, type PermissionCheck, type PermissionReader, type PgpInput, type Proof, type ProofOptions, REGISTRY_ABI, REGISTRY_ADDRESS, REVOKE_REASONS, type ReattestAuthorization, type RecordData, type RecordReader, type RegistryDeployment, type ReleaseEntry, type ReleasesRecord, type RevokeAuthorization, type RevokeReason, type SetRecordAuthorization, type SshKey, type StrippedKey, type SubkeyInfo, type UpdateKeyAuthorization, addRelease, attestTypedData, authorizationDigest, avatarFallbacks, avatarUrl, bytesToFingerprint, chainFor, checkKindName, checkRecordValue, claimCheckText, claimFateText, claimFates, claimSignature, contractErrorName, contractErrorText, displayUrl, encryptRefusalText, encryptTo, encryptionKeyFor, ensHintFor, ensHintValue, ensHintWrite, expiresSoon, expiresSoonText, fetchEnsHint, fetchRecords, findOwners, fingerprintHash, fingerprintToBytes, formatClaimDate, getRegistry, hasEmailUserID, identifyProof, isNetworkName, keyChangedText, keyIdOf, keyIdToBytes, keyProblemText, keyStanding, kindName, leanKey, markCompromisedTypedData, nftAvatarImage, normalizeFingerprint, pageRecords, parseNftAvatar, parsePgpKey, parseRecord, parseReleases, payloadText, permissionSigned, pickRecords, proofHref, proofSecondaryHref, readClaims, reattestTypedData, recordKind, registryDomain, renderReleases, revokeTypedData, sameFingerprint, setRecordTypedData, signatureEmail, sshKeys, statementText, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyClearsigned, verifyProof, verifyStatementSignature };