@thurinlabs/identity-kit 1.0.3 → 1.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.
@@ -0,0 +1,1552 @@
1
+ import * as viem from 'viem';
2
+ import { Hex, TypedDataDomain } from 'viem';
3
+
4
+ interface Attestation {
5
+ /** Position in the owner's attestation history. */
6
+ index: number;
7
+ /** Lowercase hex fingerprint, no 0x (40 chars for v4 keys, 64 for v6). */
8
+ fingerprint: string;
9
+ /** Unix seconds. */
10
+ createdAt: number;
11
+ revoked: boolean;
12
+ /** Unix seconds, or null while active. */
13
+ revokedAt: number | null;
14
+ /** Format of the clearsigned message (1 = "I control the Ethereum address: <address>"). */
15
+ messageVersion: number;
16
+ /** The clearsigned message stored on-chain (null only if the payload read failed). */
17
+ pgpSignature: string | null;
18
+ /** The armored public key stored on-chain (null only if the payload read failed). */
19
+ pgpPublicKey: string | null;
20
+ verification: PGPVerification | null;
21
+ }
22
+ interface PGPVerification {
23
+ verified: boolean;
24
+ reason?: string;
25
+ }
26
+ interface PGPKeyInfo {
27
+ fingerprint: string;
28
+ userIDs: string[];
29
+ algorithm: string;
30
+ created: string | null;
31
+ expires: string | null;
32
+ notations: Notation[];
33
+ subkeys: SubkeyInfo[];
34
+ }
35
+ interface SubkeyInfo {
36
+ algorithm: string;
37
+ created: string | null;
38
+ fingerprint: string;
39
+ }
40
+ interface Notation {
41
+ name: string;
42
+ value: string;
43
+ }
44
+ interface Proof {
45
+ provider: string;
46
+ label: string;
47
+ url: string;
48
+ user?: string;
49
+ instance?: string;
50
+ repo?: string;
51
+ gistId?: string;
52
+ castHash?: string;
53
+ domain?: string;
54
+ }
55
+ interface ProofResult {
56
+ provider: string;
57
+ label: string;
58
+ url: string;
59
+ displayUrl: string;
60
+ href: string | null;
61
+ secondaryHref: string | null;
62
+ status: 'verified' | 'unverified' | 'pending' | 'skipped';
63
+ reason?: string;
64
+ }
65
+ interface EFPGraph {
66
+ followers: number;
67
+ following: number;
68
+ top8: string[];
69
+ hasEfp: boolean;
70
+ }
71
+ interface ThurinIdentity {
72
+ address: string | null;
73
+ ensName: string | null;
74
+ ensAvatar: string | null;
75
+ claims: Attestation[];
76
+ totalClaims: number;
77
+ activeClaims: number;
78
+ currentFingerprint: string | null;
79
+ pgpKeyInfo: PGPKeyInfo | null;
80
+ proofs: ProofResult[];
81
+ efp: EFPGraph | null;
82
+ isLoading: boolean;
83
+ error: Error | null;
84
+ }
85
+ type Theme = 'thurin' | 'dark' | 'light';
86
+ interface IdentityKitConfig {
87
+ rpcUrl?: string;
88
+ neynarApiKey?: string;
89
+ baseUrl?: string;
90
+ /** Which PGPRegistry deployment to read: 'mainnet' (default) or 'sepolia'. */
91
+ network?: 'mainnet' | 'sepolia' | 'local';
92
+ /** Override the registry address (e.g. a local deploy that landed elsewhere). */
93
+ registryAddress?: string;
94
+ }
95
+
96
+ declare const REGISTRY_ABI: readonly [{
97
+ readonly type: "function";
98
+ readonly name: "ATTEST_TYPEHASH";
99
+ readonly inputs: readonly [];
100
+ readonly outputs: readonly [{
101
+ readonly name: "";
102
+ readonly type: "bytes32";
103
+ readonly internalType: "bytes32";
104
+ }];
105
+ readonly stateMutability: "view";
106
+ }, {
107
+ readonly type: "function";
108
+ readonly name: "DOMAIN_SEPARATOR";
109
+ readonly inputs: readonly [];
110
+ readonly outputs: readonly [{
111
+ readonly name: "";
112
+ readonly type: "bytes32";
113
+ readonly internalType: "bytes32";
114
+ }];
115
+ readonly stateMutability: "view";
116
+ }, {
117
+ readonly type: "function";
118
+ readonly name: "EIP712_NAME";
119
+ readonly inputs: readonly [];
120
+ readonly outputs: readonly [{
121
+ readonly name: "";
122
+ readonly type: "string";
123
+ readonly internalType: "string";
124
+ }];
125
+ readonly stateMutability: "view";
126
+ }, {
127
+ readonly type: "function";
128
+ readonly name: "EIP712_VERSION";
129
+ readonly inputs: readonly [];
130
+ readonly outputs: readonly [{
131
+ readonly name: "";
132
+ readonly type: "string";
133
+ readonly internalType: "string";
134
+ }];
135
+ readonly stateMutability: "view";
136
+ }, {
137
+ readonly type: "function";
138
+ readonly name: "MAX_KEY_BYTES";
139
+ readonly inputs: readonly [];
140
+ readonly outputs: readonly [{
141
+ readonly name: "";
142
+ readonly type: "uint256";
143
+ readonly internalType: "uint256";
144
+ }];
145
+ readonly stateMutability: "view";
146
+ }, {
147
+ readonly type: "function";
148
+ readonly name: "MAX_RECORD_BYTES";
149
+ readonly inputs: readonly [];
150
+ readonly outputs: readonly [{
151
+ readonly name: "";
152
+ readonly type: "uint256";
153
+ readonly internalType: "uint256";
154
+ }];
155
+ readonly stateMutability: "view";
156
+ }, {
157
+ readonly type: "function";
158
+ readonly name: "MAX_SIG_BYTES";
159
+ readonly inputs: readonly [];
160
+ readonly outputs: readonly [{
161
+ readonly name: "";
162
+ readonly type: "uint256";
163
+ readonly internalType: "uint256";
164
+ }];
165
+ readonly stateMutability: "view";
166
+ }, {
167
+ readonly type: "function";
168
+ readonly name: "MESSAGE_VERSION";
169
+ readonly inputs: readonly [];
170
+ readonly outputs: readonly [{
171
+ readonly name: "";
172
+ readonly type: "uint8";
173
+ readonly internalType: "uint8";
174
+ }];
175
+ readonly stateMutability: "view";
176
+ }, {
177
+ readonly type: "function";
178
+ readonly name: "REATTEST_TYPEHASH";
179
+ readonly inputs: readonly [];
180
+ readonly outputs: readonly [{
181
+ readonly name: "";
182
+ readonly type: "bytes32";
183
+ readonly internalType: "bytes32";
184
+ }];
185
+ readonly stateMutability: "view";
186
+ }, {
187
+ readonly type: "function";
188
+ readonly name: "REVOKE_TYPEHASH";
189
+ readonly inputs: readonly [];
190
+ readonly outputs: readonly [{
191
+ readonly name: "";
192
+ readonly type: "bytes32";
193
+ readonly internalType: "bytes32";
194
+ }];
195
+ readonly stateMutability: "view";
196
+ }, {
197
+ readonly type: "function";
198
+ readonly name: "SET_RECORD_TYPEHASH";
199
+ readonly inputs: readonly [];
200
+ readonly outputs: readonly [{
201
+ readonly name: "";
202
+ readonly type: "bytes32";
203
+ readonly internalType: "bytes32";
204
+ }];
205
+ readonly stateMutability: "view";
206
+ }, {
207
+ readonly type: "function";
208
+ readonly name: "UPDATE_KEY_TYPEHASH";
209
+ readonly inputs: readonly [];
210
+ readonly outputs: readonly [{
211
+ readonly name: "";
212
+ readonly type: "bytes32";
213
+ readonly internalType: "bytes32";
214
+ }];
215
+ readonly stateMutability: "view";
216
+ }, {
217
+ readonly type: "function";
218
+ readonly name: "VERSION";
219
+ readonly inputs: readonly [];
220
+ readonly outputs: readonly [{
221
+ readonly name: "";
222
+ readonly type: "uint8";
223
+ readonly internalType: "uint8";
224
+ }];
225
+ readonly stateMutability: "view";
226
+ }, {
227
+ readonly type: "function";
228
+ readonly name: "addressesFor";
229
+ readonly inputs: readonly [{
230
+ readonly name: "fingerprintHash";
231
+ readonly type: "bytes32";
232
+ readonly internalType: "bytes32";
233
+ }];
234
+ readonly outputs: readonly [{
235
+ readonly name: "";
236
+ readonly type: "address[]";
237
+ readonly internalType: "address[]";
238
+ }];
239
+ readonly stateMutability: "view";
240
+ }, {
241
+ readonly type: "function";
242
+ readonly name: "addressesForCount";
243
+ readonly inputs: readonly [{
244
+ readonly name: "fingerprintHash";
245
+ readonly type: "bytes32";
246
+ readonly internalType: "bytes32";
247
+ }];
248
+ readonly outputs: readonly [{
249
+ readonly name: "";
250
+ readonly type: "uint256";
251
+ readonly internalType: "uint256";
252
+ }];
253
+ readonly stateMutability: "view";
254
+ }, {
255
+ readonly type: "function";
256
+ readonly name: "addressesForRange";
257
+ readonly inputs: readonly [{
258
+ readonly name: "fingerprintHash";
259
+ readonly type: "bytes32";
260
+ readonly internalType: "bytes32";
261
+ }, {
262
+ readonly name: "start";
263
+ readonly type: "uint256";
264
+ readonly internalType: "uint256";
265
+ }, {
266
+ readonly name: "count";
267
+ readonly type: "uint256";
268
+ readonly internalType: "uint256";
269
+ }];
270
+ readonly outputs: readonly [{
271
+ readonly name: "out";
272
+ readonly type: "address[]";
273
+ readonly internalType: "address[]";
274
+ }];
275
+ readonly stateMutability: "view";
276
+ }, {
277
+ readonly type: "function";
278
+ readonly name: "attest";
279
+ readonly inputs: readonly [{
280
+ readonly name: "fingerprint";
281
+ readonly type: "bytes";
282
+ readonly internalType: "bytes";
283
+ }, {
284
+ readonly name: "pgpSignature";
285
+ readonly type: "bytes";
286
+ readonly internalType: "bytes";
287
+ }, {
288
+ readonly name: "pgpPublicKey";
289
+ readonly type: "bytes";
290
+ readonly internalType: "bytes";
291
+ }];
292
+ readonly outputs: readonly [{
293
+ readonly name: "index";
294
+ readonly type: "uint256";
295
+ readonly internalType: "uint256";
296
+ }];
297
+ readonly stateMutability: "nonpayable";
298
+ }, {
299
+ readonly type: "function";
300
+ readonly name: "attestFor";
301
+ readonly inputs: readonly [{
302
+ readonly name: "owner";
303
+ readonly type: "address";
304
+ readonly internalType: "address";
305
+ }, {
306
+ readonly name: "fingerprint";
307
+ readonly type: "bytes";
308
+ readonly internalType: "bytes";
309
+ }, {
310
+ readonly name: "pgpSignature";
311
+ readonly type: "bytes";
312
+ readonly internalType: "bytes";
313
+ }, {
314
+ readonly name: "pgpPublicKey";
315
+ readonly type: "bytes";
316
+ readonly internalType: "bytes";
317
+ }, {
318
+ readonly name: "deadline";
319
+ readonly type: "uint256";
320
+ readonly internalType: "uint256";
321
+ }, {
322
+ readonly name: "signature";
323
+ readonly type: "bytes";
324
+ readonly internalType: "bytes";
325
+ }];
326
+ readonly outputs: readonly [{
327
+ readonly name: "index";
328
+ readonly type: "uint256";
329
+ readonly internalType: "uint256";
330
+ }];
331
+ readonly stateMutability: "nonpayable";
332
+ }, {
333
+ readonly type: "function";
334
+ readonly name: "attestationCount";
335
+ readonly inputs: readonly [{
336
+ readonly name: "owner";
337
+ readonly type: "address";
338
+ readonly internalType: "address";
339
+ }];
340
+ readonly outputs: readonly [{
341
+ readonly name: "";
342
+ readonly type: "uint256";
343
+ readonly internalType: "uint256";
344
+ }];
345
+ readonly stateMutability: "view";
346
+ }, {
347
+ readonly type: "function";
348
+ readonly name: "attestationsOf";
349
+ readonly inputs: readonly [{
350
+ readonly name: "owner";
351
+ readonly type: "address";
352
+ readonly internalType: "address";
353
+ }];
354
+ readonly outputs: readonly [{
355
+ readonly name: "";
356
+ readonly type: "tuple[]";
357
+ readonly internalType: "struct PGPRegistry.Attestation[]";
358
+ readonly components: readonly [{
359
+ readonly name: "fingerprint";
360
+ readonly type: "bytes";
361
+ readonly internalType: "bytes";
362
+ }, {
363
+ readonly name: "createdAt";
364
+ readonly type: "uint64";
365
+ readonly internalType: "uint64";
366
+ }, {
367
+ readonly name: "revokedAt";
368
+ readonly type: "uint64";
369
+ readonly internalType: "uint64";
370
+ }, {
371
+ readonly name: "messageVersion";
372
+ readonly type: "uint8";
373
+ readonly internalType: "uint8";
374
+ }, {
375
+ readonly name: "keyPtr";
376
+ readonly type: "address";
377
+ readonly internalType: "address";
378
+ }, {
379
+ readonly name: "sigPtr";
380
+ readonly type: "address";
381
+ readonly internalType: "address";
382
+ }];
383
+ }];
384
+ readonly stateMutability: "view";
385
+ }, {
386
+ readonly type: "function";
387
+ readonly name: "attestationsOfRange";
388
+ readonly inputs: readonly [{
389
+ readonly name: "owner";
390
+ readonly type: "address";
391
+ readonly internalType: "address";
392
+ }, {
393
+ readonly name: "start";
394
+ readonly type: "uint256";
395
+ readonly internalType: "uint256";
396
+ }, {
397
+ readonly name: "count";
398
+ readonly type: "uint256";
399
+ readonly internalType: "uint256";
400
+ }];
401
+ readonly outputs: readonly [{
402
+ readonly name: "out";
403
+ readonly type: "tuple[]";
404
+ readonly internalType: "struct PGPRegistry.Attestation[]";
405
+ readonly components: readonly [{
406
+ readonly name: "fingerprint";
407
+ readonly type: "bytes";
408
+ readonly internalType: "bytes";
409
+ }, {
410
+ readonly name: "createdAt";
411
+ readonly type: "uint64";
412
+ readonly internalType: "uint64";
413
+ }, {
414
+ readonly name: "revokedAt";
415
+ readonly type: "uint64";
416
+ readonly internalType: "uint64";
417
+ }, {
418
+ readonly name: "messageVersion";
419
+ readonly type: "uint8";
420
+ readonly internalType: "uint8";
421
+ }, {
422
+ readonly name: "keyPtr";
423
+ readonly type: "address";
424
+ readonly internalType: "address";
425
+ }, {
426
+ readonly name: "sigPtr";
427
+ readonly type: "address";
428
+ readonly internalType: "address";
429
+ }];
430
+ }];
431
+ readonly stateMutability: "view";
432
+ }, {
433
+ readonly type: "function";
434
+ readonly name: "cancelAuthorization";
435
+ readonly inputs: readonly [];
436
+ readonly outputs: readonly [];
437
+ readonly stateMutability: "nonpayable";
438
+ }, {
439
+ readonly type: "function";
440
+ readonly name: "current";
441
+ readonly inputs: readonly [{
442
+ readonly name: "owner";
443
+ readonly type: "address";
444
+ readonly internalType: "address";
445
+ }];
446
+ readonly outputs: readonly [{
447
+ readonly name: "found";
448
+ readonly type: "bool";
449
+ readonly internalType: "bool";
450
+ }, {
451
+ readonly name: "index";
452
+ readonly type: "uint256";
453
+ readonly internalType: "uint256";
454
+ }, {
455
+ readonly name: "attestation";
456
+ readonly type: "tuple";
457
+ readonly internalType: "struct PGPRegistry.Attestation";
458
+ readonly components: readonly [{
459
+ readonly name: "fingerprint";
460
+ readonly type: "bytes";
461
+ readonly internalType: "bytes";
462
+ }, {
463
+ readonly name: "createdAt";
464
+ readonly type: "uint64";
465
+ readonly internalType: "uint64";
466
+ }, {
467
+ readonly name: "revokedAt";
468
+ readonly type: "uint64";
469
+ readonly internalType: "uint64";
470
+ }, {
471
+ readonly name: "messageVersion";
472
+ readonly type: "uint8";
473
+ readonly internalType: "uint8";
474
+ }, {
475
+ readonly name: "keyPtr";
476
+ readonly type: "address";
477
+ readonly internalType: "address";
478
+ }, {
479
+ readonly name: "sigPtr";
480
+ readonly type: "address";
481
+ readonly internalType: "address";
482
+ }];
483
+ }];
484
+ readonly stateMutability: "view";
485
+ }, {
486
+ readonly type: "function";
487
+ readonly name: "fingerprintsForKeyId";
488
+ readonly inputs: readonly [{
489
+ readonly name: "keyId";
490
+ readonly type: "bytes8";
491
+ readonly internalType: "bytes8";
492
+ }];
493
+ readonly outputs: readonly [{
494
+ readonly name: "";
495
+ readonly type: "bytes[]";
496
+ readonly internalType: "bytes[]";
497
+ }];
498
+ readonly stateMutability: "view";
499
+ }, {
500
+ readonly type: "function";
501
+ readonly name: "fingerprintsForKeyIdCount";
502
+ readonly inputs: readonly [{
503
+ readonly name: "keyId";
504
+ readonly type: "bytes8";
505
+ readonly internalType: "bytes8";
506
+ }];
507
+ readonly outputs: readonly [{
508
+ readonly name: "";
509
+ readonly type: "uint256";
510
+ readonly internalType: "uint256";
511
+ }];
512
+ readonly stateMutability: "view";
513
+ }, {
514
+ readonly type: "function";
515
+ readonly name: "fingerprintsForKeyIdRange";
516
+ readonly inputs: readonly [{
517
+ readonly name: "keyId";
518
+ readonly type: "bytes8";
519
+ readonly internalType: "bytes8";
520
+ }, {
521
+ readonly name: "start";
522
+ readonly type: "uint256";
523
+ readonly internalType: "uint256";
524
+ }, {
525
+ readonly name: "count";
526
+ readonly type: "uint256";
527
+ readonly internalType: "uint256";
528
+ }];
529
+ readonly outputs: readonly [{
530
+ readonly name: "out";
531
+ readonly type: "bytes[]";
532
+ readonly internalType: "bytes[]";
533
+ }];
534
+ readonly stateMutability: "view";
535
+ }, {
536
+ readonly type: "function";
537
+ readonly name: "getAttestation";
538
+ readonly inputs: readonly [{
539
+ readonly name: "owner";
540
+ readonly type: "address";
541
+ readonly internalType: "address";
542
+ }, {
543
+ readonly name: "index";
544
+ readonly type: "uint256";
545
+ readonly internalType: "uint256";
546
+ }];
547
+ readonly outputs: readonly [{
548
+ readonly name: "";
549
+ readonly type: "tuple";
550
+ readonly internalType: "struct PGPRegistry.Attestation";
551
+ readonly components: readonly [{
552
+ readonly name: "fingerprint";
553
+ readonly type: "bytes";
554
+ readonly internalType: "bytes";
555
+ }, {
556
+ readonly name: "createdAt";
557
+ readonly type: "uint64";
558
+ readonly internalType: "uint64";
559
+ }, {
560
+ readonly name: "revokedAt";
561
+ readonly type: "uint64";
562
+ readonly internalType: "uint64";
563
+ }, {
564
+ readonly name: "messageVersion";
565
+ readonly type: "uint8";
566
+ readonly internalType: "uint8";
567
+ }, {
568
+ readonly name: "keyPtr";
569
+ readonly type: "address";
570
+ readonly internalType: "address";
571
+ }, {
572
+ readonly name: "sigPtr";
573
+ readonly type: "address";
574
+ readonly internalType: "address";
575
+ }];
576
+ }];
577
+ readonly stateMutability: "view";
578
+ }, {
579
+ readonly type: "function";
580
+ readonly name: "getPayload";
581
+ readonly inputs: readonly [{
582
+ readonly name: "owner";
583
+ readonly type: "address";
584
+ readonly internalType: "address";
585
+ }, {
586
+ readonly name: "index";
587
+ readonly type: "uint256";
588
+ readonly internalType: "uint256";
589
+ }];
590
+ readonly outputs: readonly [{
591
+ readonly name: "pgpSignature";
592
+ readonly type: "bytes";
593
+ readonly internalType: "bytes";
594
+ }, {
595
+ readonly name: "pgpPublicKey";
596
+ readonly type: "bytes";
597
+ readonly internalType: "bytes";
598
+ }];
599
+ readonly stateMutability: "view";
600
+ }, {
601
+ readonly type: "function";
602
+ readonly name: "nonces";
603
+ readonly inputs: readonly [{
604
+ readonly name: "";
605
+ readonly type: "address";
606
+ readonly internalType: "address";
607
+ }];
608
+ readonly outputs: readonly [{
609
+ readonly name: "";
610
+ readonly type: "uint256";
611
+ readonly internalType: "uint256";
612
+ }];
613
+ readonly stateMutability: "view";
614
+ }, {
615
+ readonly type: "function";
616
+ readonly name: "reattest";
617
+ readonly inputs: readonly [{
618
+ readonly name: "revokeIndex";
619
+ readonly type: "uint256";
620
+ readonly internalType: "uint256";
621
+ }, {
622
+ readonly name: "fingerprint";
623
+ readonly type: "bytes";
624
+ readonly internalType: "bytes";
625
+ }, {
626
+ readonly name: "pgpSignature";
627
+ readonly type: "bytes";
628
+ readonly internalType: "bytes";
629
+ }, {
630
+ readonly name: "pgpPublicKey";
631
+ readonly type: "bytes";
632
+ readonly internalType: "bytes";
633
+ }];
634
+ readonly outputs: readonly [{
635
+ readonly name: "index";
636
+ readonly type: "uint256";
637
+ readonly internalType: "uint256";
638
+ }];
639
+ readonly stateMutability: "nonpayable";
640
+ }, {
641
+ readonly type: "function";
642
+ readonly name: "reattestFor";
643
+ readonly inputs: readonly [{
644
+ readonly name: "owner";
645
+ readonly type: "address";
646
+ readonly internalType: "address";
647
+ }, {
648
+ readonly name: "revokeIndex";
649
+ readonly type: "uint256";
650
+ readonly internalType: "uint256";
651
+ }, {
652
+ readonly name: "fingerprint";
653
+ readonly type: "bytes";
654
+ readonly internalType: "bytes";
655
+ }, {
656
+ readonly name: "pgpSignature";
657
+ readonly type: "bytes";
658
+ readonly internalType: "bytes";
659
+ }, {
660
+ readonly name: "pgpPublicKey";
661
+ readonly type: "bytes";
662
+ readonly internalType: "bytes";
663
+ }, {
664
+ readonly name: "deadline";
665
+ readonly type: "uint256";
666
+ readonly internalType: "uint256";
667
+ }, {
668
+ readonly name: "signature";
669
+ readonly type: "bytes";
670
+ readonly internalType: "bytes";
671
+ }];
672
+ readonly outputs: readonly [{
673
+ readonly name: "index";
674
+ readonly type: "uint256";
675
+ readonly internalType: "uint256";
676
+ }];
677
+ readonly stateMutability: "nonpayable";
678
+ }, {
679
+ readonly type: "function";
680
+ readonly name: "record";
681
+ readonly inputs: readonly [{
682
+ readonly name: "owner";
683
+ readonly type: "address";
684
+ readonly internalType: "address";
685
+ }, {
686
+ readonly name: "index";
687
+ readonly type: "uint256";
688
+ readonly internalType: "uint256";
689
+ }, {
690
+ readonly name: "kind";
691
+ readonly type: "bytes32";
692
+ readonly internalType: "bytes32";
693
+ }];
694
+ readonly outputs: readonly [{
695
+ readonly name: "";
696
+ readonly type: "bytes";
697
+ readonly internalType: "bytes";
698
+ }];
699
+ readonly stateMutability: "view";
700
+ }, {
701
+ readonly type: "function";
702
+ readonly name: "revoke";
703
+ readonly inputs: readonly [{
704
+ readonly name: "index";
705
+ readonly type: "uint256";
706
+ readonly internalType: "uint256";
707
+ }];
708
+ readonly outputs: readonly [];
709
+ readonly stateMutability: "nonpayable";
710
+ }, {
711
+ readonly type: "function";
712
+ readonly name: "revokeFor";
713
+ readonly inputs: readonly [{
714
+ readonly name: "owner";
715
+ readonly type: "address";
716
+ readonly internalType: "address";
717
+ }, {
718
+ readonly name: "index";
719
+ readonly type: "uint256";
720
+ readonly internalType: "uint256";
721
+ }, {
722
+ readonly name: "deadline";
723
+ readonly type: "uint256";
724
+ readonly internalType: "uint256";
725
+ }, {
726
+ readonly name: "signature";
727
+ readonly type: "bytes";
728
+ readonly internalType: "bytes";
729
+ }];
730
+ readonly outputs: readonly [];
731
+ readonly stateMutability: "nonpayable";
732
+ }, {
733
+ readonly type: "function";
734
+ readonly name: "setRecord";
735
+ readonly inputs: readonly [{
736
+ readonly name: "index";
737
+ readonly type: "uint256";
738
+ readonly internalType: "uint256";
739
+ }, {
740
+ readonly name: "kind";
741
+ readonly type: "bytes32";
742
+ readonly internalType: "bytes32";
743
+ }, {
744
+ readonly name: "value";
745
+ readonly type: "bytes";
746
+ readonly internalType: "bytes";
747
+ }];
748
+ readonly outputs: readonly [];
749
+ readonly stateMutability: "nonpayable";
750
+ }, {
751
+ readonly type: "function";
752
+ readonly name: "setRecordFor";
753
+ readonly inputs: readonly [{
754
+ readonly name: "owner";
755
+ readonly type: "address";
756
+ readonly internalType: "address";
757
+ }, {
758
+ readonly name: "index";
759
+ readonly type: "uint256";
760
+ readonly internalType: "uint256";
761
+ }, {
762
+ readonly name: "kind";
763
+ readonly type: "bytes32";
764
+ readonly internalType: "bytes32";
765
+ }, {
766
+ readonly name: "value";
767
+ readonly type: "bytes";
768
+ readonly internalType: "bytes";
769
+ }, {
770
+ readonly name: "deadline";
771
+ readonly type: "uint256";
772
+ readonly internalType: "uint256";
773
+ }, {
774
+ readonly name: "signature";
775
+ readonly type: "bytes";
776
+ readonly internalType: "bytes";
777
+ }];
778
+ readonly outputs: readonly [];
779
+ readonly stateMutability: "nonpayable";
780
+ }, {
781
+ readonly type: "function";
782
+ readonly name: "updateKey";
783
+ readonly inputs: readonly [{
784
+ readonly name: "index";
785
+ readonly type: "uint256";
786
+ readonly internalType: "uint256";
787
+ }, {
788
+ readonly name: "pgpPublicKey";
789
+ readonly type: "bytes";
790
+ readonly internalType: "bytes";
791
+ }];
792
+ readonly outputs: readonly [];
793
+ readonly stateMutability: "nonpayable";
794
+ }, {
795
+ readonly type: "function";
796
+ readonly name: "updateKeyFor";
797
+ readonly inputs: readonly [{
798
+ readonly name: "owner";
799
+ readonly type: "address";
800
+ readonly internalType: "address";
801
+ }, {
802
+ readonly name: "index";
803
+ readonly type: "uint256";
804
+ readonly internalType: "uint256";
805
+ }, {
806
+ readonly name: "pgpPublicKey";
807
+ readonly type: "bytes";
808
+ readonly internalType: "bytes";
809
+ }, {
810
+ readonly name: "deadline";
811
+ readonly type: "uint256";
812
+ readonly internalType: "uint256";
813
+ }, {
814
+ readonly name: "signature";
815
+ readonly type: "bytes";
816
+ readonly internalType: "bytes";
817
+ }];
818
+ readonly outputs: readonly [];
819
+ readonly stateMutability: "nonpayable";
820
+ }, {
821
+ readonly type: "event";
822
+ readonly name: "Attested";
823
+ readonly inputs: readonly [{
824
+ readonly name: "owner";
825
+ readonly type: "address";
826
+ readonly indexed: true;
827
+ readonly internalType: "address";
828
+ }, {
829
+ readonly name: "fingerprintHash";
830
+ readonly type: "bytes32";
831
+ readonly indexed: true;
832
+ readonly internalType: "bytes32";
833
+ }, {
834
+ readonly name: "index";
835
+ readonly type: "uint256";
836
+ readonly indexed: true;
837
+ readonly internalType: "uint256";
838
+ }, {
839
+ readonly name: "fingerprint";
840
+ readonly type: "bytes";
841
+ readonly indexed: false;
842
+ readonly internalType: "bytes";
843
+ }, {
844
+ readonly name: "messageVersion";
845
+ readonly type: "uint8";
846
+ readonly indexed: false;
847
+ readonly internalType: "uint8";
848
+ }, {
849
+ readonly name: "keyPtr";
850
+ readonly type: "address";
851
+ readonly indexed: false;
852
+ readonly internalType: "address";
853
+ }, {
854
+ readonly name: "sigPtr";
855
+ readonly type: "address";
856
+ readonly indexed: false;
857
+ readonly internalType: "address";
858
+ }, {
859
+ readonly name: "submitter";
860
+ readonly type: "address";
861
+ readonly indexed: false;
862
+ readonly internalType: "address";
863
+ }];
864
+ readonly anonymous: false;
865
+ }, {
866
+ readonly type: "event";
867
+ readonly name: "KeyUpdated";
868
+ readonly inputs: readonly [{
869
+ readonly name: "owner";
870
+ readonly type: "address";
871
+ readonly indexed: true;
872
+ readonly internalType: "address";
873
+ }, {
874
+ readonly name: "fingerprintHash";
875
+ readonly type: "bytes32";
876
+ readonly indexed: true;
877
+ readonly internalType: "bytes32";
878
+ }, {
879
+ readonly name: "index";
880
+ readonly type: "uint256";
881
+ readonly indexed: true;
882
+ readonly internalType: "uint256";
883
+ }, {
884
+ readonly name: "oldKeyPtr";
885
+ readonly type: "address";
886
+ readonly indexed: false;
887
+ readonly internalType: "address";
888
+ }, {
889
+ readonly name: "newKeyPtr";
890
+ readonly type: "address";
891
+ readonly indexed: false;
892
+ readonly internalType: "address";
893
+ }, {
894
+ readonly name: "submitter";
895
+ readonly type: "address";
896
+ readonly indexed: false;
897
+ readonly internalType: "address";
898
+ }];
899
+ readonly anonymous: false;
900
+ }, {
901
+ readonly type: "event";
902
+ readonly name: "NonceUsed";
903
+ readonly inputs: readonly [{
904
+ readonly name: "owner";
905
+ readonly type: "address";
906
+ readonly indexed: true;
907
+ readonly internalType: "address";
908
+ }, {
909
+ readonly name: "nonce";
910
+ readonly type: "uint256";
911
+ readonly indexed: false;
912
+ readonly internalType: "uint256";
913
+ }];
914
+ readonly anonymous: false;
915
+ }, {
916
+ readonly type: "event";
917
+ readonly name: "RecordSet";
918
+ readonly inputs: readonly [{
919
+ readonly name: "owner";
920
+ readonly type: "address";
921
+ readonly indexed: true;
922
+ readonly internalType: "address";
923
+ }, {
924
+ readonly name: "index";
925
+ readonly type: "uint256";
926
+ readonly indexed: true;
927
+ readonly internalType: "uint256";
928
+ }, {
929
+ readonly name: "kind";
930
+ readonly type: "bytes32";
931
+ readonly indexed: true;
932
+ readonly internalType: "bytes32";
933
+ }, {
934
+ readonly name: "submitter";
935
+ readonly type: "address";
936
+ readonly indexed: false;
937
+ readonly internalType: "address";
938
+ }];
939
+ readonly anonymous: false;
940
+ }, {
941
+ readonly type: "event";
942
+ readonly name: "Revoked";
943
+ readonly inputs: readonly [{
944
+ readonly name: "owner";
945
+ readonly type: "address";
946
+ readonly indexed: true;
947
+ readonly internalType: "address";
948
+ }, {
949
+ readonly name: "fingerprintHash";
950
+ readonly type: "bytes32";
951
+ readonly indexed: true;
952
+ readonly internalType: "bytes32";
953
+ }, {
954
+ readonly name: "index";
955
+ readonly type: "uint256";
956
+ readonly indexed: true;
957
+ readonly internalType: "uint256";
958
+ }, {
959
+ readonly name: "submitter";
960
+ readonly type: "address";
961
+ readonly indexed: false;
962
+ readonly internalType: "address";
963
+ }];
964
+ readonly anonymous: false;
965
+ }, {
966
+ readonly type: "error";
967
+ readonly name: "AlreadyRevoked";
968
+ readonly inputs: readonly [];
969
+ }, {
970
+ readonly type: "error";
971
+ readonly name: "AuthorizationExpired";
972
+ readonly inputs: readonly [];
973
+ }, {
974
+ readonly type: "error";
975
+ readonly name: "DeploymentFailed";
976
+ readonly inputs: readonly [];
977
+ }, {
978
+ readonly type: "error";
979
+ readonly name: "DuplicateActiveFingerprint";
980
+ readonly inputs: readonly [];
981
+ }, {
982
+ readonly type: "error";
983
+ readonly name: "EmptyPublicKey";
984
+ readonly inputs: readonly [];
985
+ }, {
986
+ readonly type: "error";
987
+ readonly name: "EmptySignature";
988
+ readonly inputs: readonly [];
989
+ }, {
990
+ readonly type: "error";
991
+ readonly name: "IndexOutOfBounds";
992
+ readonly inputs: readonly [];
993
+ }, {
994
+ readonly type: "error";
995
+ readonly name: "InvalidAuthorization";
996
+ readonly inputs: readonly [];
997
+ }, {
998
+ readonly type: "error";
999
+ readonly name: "InvalidFingerprintLength";
1000
+ readonly inputs: readonly [];
1001
+ }, {
1002
+ readonly type: "error";
1003
+ readonly name: "InvalidPointer";
1004
+ readonly inputs: readonly [];
1005
+ }, {
1006
+ readonly type: "error";
1007
+ readonly name: "PublicKeyTooLarge";
1008
+ readonly inputs: readonly [];
1009
+ }, {
1010
+ readonly type: "error";
1011
+ readonly name: "RecordTooLarge";
1012
+ readonly inputs: readonly [];
1013
+ }, {
1014
+ readonly type: "error";
1015
+ readonly name: "SignatureTooLarge";
1016
+ readonly inputs: readonly [];
1017
+ }];
1018
+
1019
+ /**
1020
+ * PGPRegistry v2 is deployed with CREATE2, so it has the same address on every
1021
+ * network. (v1 lived at 0xf7a45BC662A78a6fb417ED5f52b3766cbf13EbBb on mainnet and
1022
+ * is no longer read by Thurin.)
1023
+ */
1024
+ declare const REGISTRY_ADDRESS: "0x9302E02e2869e129aC8516fE5eFFd51EA3082c09";
1025
+ /** Networks the PGPRegistry is deployed on. `mainnet` is the default everywhere. */
1026
+ type NetworkName = 'mainnet' | 'sepolia' | 'local';
1027
+ interface RegistryDeployment {
1028
+ chainId: number;
1029
+ address: `0x${string}`;
1030
+ /** Block the registry was deployed in (informational; v2 needs no log scans). */
1031
+ deployBlock: bigint;
1032
+ /** Block explorer base URL for address/tx links. Empty when there is none. */
1033
+ explorerUrl: string;
1034
+ /** Keyless public RPC used when no rpcUrl is configured. */
1035
+ defaultRpcUrl: string;
1036
+ }
1037
+ declare const NETWORKS: Record<NetworkName, RegistryDeployment>;
1038
+ declare function isNetworkName(value: unknown): value is NetworkName;
1039
+ /**
1040
+ * The registry deployment for a network. `addressOverride` swaps the contract
1041
+ * address (e.g. a local deploy that landed somewhere else).
1042
+ */
1043
+ declare function getRegistry(network?: NetworkName, addressOverride?: string): RegistryDeployment;
1044
+ /** The viem chain object for a network name. */
1045
+ declare function chainFor(network?: NetworkName): {
1046
+ blockExplorers: {
1047
+ readonly default: {
1048
+ readonly name: "Etherscan";
1049
+ readonly url: "https://sepolia.etherscan.io";
1050
+ readonly apiUrl: "https://api-sepolia.etherscan.io/api";
1051
+ };
1052
+ };
1053
+ blockTime?: number | undefined | undefined;
1054
+ contracts: {
1055
+ readonly multicall3: {
1056
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1057
+ readonly blockCreated: 751532;
1058
+ };
1059
+ readonly ensUniversalResolver: {
1060
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
1061
+ readonly blockCreated: 8928790;
1062
+ };
1063
+ };
1064
+ ensTlds?: readonly string[] | undefined;
1065
+ id: 11155111;
1066
+ name: "Sepolia";
1067
+ nativeCurrency: {
1068
+ readonly name: "Sepolia Ether";
1069
+ readonly symbol: "ETH";
1070
+ readonly decimals: 18;
1071
+ };
1072
+ experimental_preconfirmationTime?: number | undefined | undefined;
1073
+ rpcUrls: {
1074
+ readonly default: {
1075
+ readonly http: readonly ["https://11155111.rpc.thirdweb.com"];
1076
+ };
1077
+ };
1078
+ sourceId?: number | undefined | undefined;
1079
+ testnet: true;
1080
+ custom?: Record<string, unknown> | undefined;
1081
+ extendSchema?: Record<string, unknown> | undefined;
1082
+ fees?: viem.ChainFees<undefined> | undefined;
1083
+ formatters?: undefined;
1084
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1085
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1086
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1087
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1088
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1089
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1090
+ }] | undefined;
1091
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1092
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1093
+ } | {
1094
+ blockExplorers?: {
1095
+ [key: string]: {
1096
+ name: string;
1097
+ url: string;
1098
+ apiUrl?: string | undefined;
1099
+ };
1100
+ default: {
1101
+ name: string;
1102
+ url: string;
1103
+ apiUrl?: string | undefined;
1104
+ };
1105
+ } | undefined | undefined;
1106
+ blockTime?: number | undefined | undefined;
1107
+ contracts?: {
1108
+ [x: string]: viem.ChainContract | {
1109
+ [sourceId: number]: viem.ChainContract | undefined;
1110
+ } | undefined;
1111
+ ensRegistry?: viem.ChainContract | undefined;
1112
+ ensUniversalResolver?: viem.ChainContract | undefined;
1113
+ multicall3?: viem.ChainContract | undefined;
1114
+ erc6492Verifier?: viem.ChainContract | undefined;
1115
+ } | undefined;
1116
+ ensTlds?: readonly string[] | undefined;
1117
+ id: 31337;
1118
+ name: "Foundry";
1119
+ nativeCurrency: {
1120
+ readonly decimals: 18;
1121
+ readonly name: "Ether";
1122
+ readonly symbol: "ETH";
1123
+ };
1124
+ experimental_preconfirmationTime?: number | undefined | undefined;
1125
+ rpcUrls: {
1126
+ readonly default: {
1127
+ readonly http: readonly ["http://127.0.0.1:8545"];
1128
+ readonly webSocket: readonly ["ws://127.0.0.1:8545"];
1129
+ };
1130
+ };
1131
+ sourceId?: number | undefined | undefined;
1132
+ testnet?: boolean | undefined | undefined;
1133
+ custom?: Record<string, unknown> | undefined;
1134
+ extendSchema?: Record<string, unknown> | undefined;
1135
+ fees?: viem.ChainFees<undefined> | undefined;
1136
+ formatters?: undefined;
1137
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1138
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1139
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1140
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1141
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1142
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1143
+ }] | undefined;
1144
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1145
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1146
+ } | {
1147
+ blockExplorers: {
1148
+ readonly default: {
1149
+ readonly name: "Etherscan";
1150
+ readonly url: "https://etherscan.io";
1151
+ readonly apiUrl: "https://api.etherscan.io/api";
1152
+ };
1153
+ };
1154
+ blockTime: 12000;
1155
+ contracts: {
1156
+ readonly ensUniversalResolver: {
1157
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
1158
+ readonly blockCreated: 23085558;
1159
+ };
1160
+ readonly multicall3: {
1161
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
1162
+ readonly blockCreated: 14353601;
1163
+ };
1164
+ };
1165
+ ensTlds?: readonly string[] | undefined;
1166
+ id: 1;
1167
+ name: "Ethereum";
1168
+ nativeCurrency: {
1169
+ readonly name: "Ether";
1170
+ readonly symbol: "ETH";
1171
+ readonly decimals: 18;
1172
+ };
1173
+ experimental_preconfirmationTime?: number | undefined | undefined;
1174
+ rpcUrls: {
1175
+ readonly default: {
1176
+ readonly http: readonly ["https://eth.merkle.io"];
1177
+ };
1178
+ };
1179
+ sourceId?: number | undefined | undefined;
1180
+ testnet?: boolean | undefined | undefined;
1181
+ custom?: Record<string, unknown> | undefined;
1182
+ extendSchema?: Record<string, unknown> | undefined;
1183
+ fees?: viem.ChainFees<undefined> | undefined;
1184
+ formatters?: undefined;
1185
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
1186
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1187
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
1188
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
1189
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
1190
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
1191
+ }] | undefined;
1192
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
1193
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
1194
+ };
1195
+
1196
+ declare function identifyProof(notation: Notation): Proof | null;
1197
+ declare function displayUrl(proof: Proof): string;
1198
+ declare function proofHref(proof: Proof): string | null;
1199
+ declare function proofSecondaryHref(proof: Proof): string | null;
1200
+ declare function verifyProof(proof: Proof, fingerprint: string, neynarApiKey?: string): Promise<PGPVerification>;
1201
+
1202
+ declare function parsePgpKey(armoredKey: string): Promise<PGPKeyInfo | null>;
1203
+ declare function verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress, }: {
1204
+ pgpPublicKey: string | null;
1205
+ pgpSignature: string | null;
1206
+ fingerprint: string;
1207
+ ethAddress: string;
1208
+ }): Promise<PGPVerification>;
1209
+ interface StrippedKey {
1210
+ /** Armored public key containing only the non-email user IDs. */
1211
+ armored: string;
1212
+ /** User IDs kept (no `@`). */
1213
+ kept: string[];
1214
+ /** User IDs removed (contained an `@`). */
1215
+ removed: string[];
1216
+ }
1217
+ /**
1218
+ * Remove every user ID that contains an email address, keeping the rest (and
1219
+ * their self-certifications, so proof notations on a non-email user ID survive).
1220
+ * Returns null when nothing would remain — openpgp needs at least one
1221
+ * self-certified user ID to verify signatures, so such a key must not be
1222
+ * published. The key material and subkeys are untouched; the fingerprint is
1223
+ * unchanged.
1224
+ */
1225
+ declare function stripEmailUserIDs(armoredKey: string): Promise<StrippedKey | null>;
1226
+ /** True when any user ID on the key contains an email address. */
1227
+ declare function hasEmailUserID(armoredKey: string): Promise<boolean>;
1228
+ declare function fetchKeyByFingerprint(fingerprint: string): Promise<string | null>;
1229
+ declare function fetchKeyByKeyId(keyId: string): Promise<string | null>;
1230
+
1231
+ /**
1232
+ * EFP social graph for an address. Followers are counted by EFP for any address,
1233
+ * whether or not it has published a list of its own; following and top-8 exist
1234
+ * only when it has (its "primary list"). An address with followers but no list
1235
+ * — a project account that has never followed anyone — is still on EFP.
1236
+ */
1237
+ declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
1238
+
1239
+ /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
1240
+ declare function normalizeFingerprint(input: string): string | null;
1241
+ /** Fingerprint → the raw `bytes` argument the v2 registry takes (0x-prefixed, 20 or 32 bytes). */
1242
+ declare function fingerprintToBytes(fingerprint: string): Hex;
1243
+ /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
1244
+ declare function bytesToFingerprint(bytes: Hex | string): string;
1245
+ /** keccak256 of the raw fingerprint bytes — the `fingerprintHash` the registry indexes by. */
1246
+ declare function fingerprintHash(fingerprint: string): Hex;
1247
+ /**
1248
+ * The long key ID as the `bytes8` the registry indexes by. Per RFC 9580 §5.5.4 it is the
1249
+ * low-order 8 bytes of a v4 (20-byte) fingerprint and the high-order 8 bytes of a v6
1250
+ * (32-byte) fingerprint — the same value `gpg --keyid-format long` prints.
1251
+ */
1252
+ declare function keyIdOf(fingerprint: string): Hex;
1253
+ /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
1254
+ declare function keyIdToBytes(keyId: string): Hex | null;
1255
+
1256
+ /**
1257
+ * EIP-712 authorizations for the registry's relayed writes (`attestFor`, `reattestFor`,
1258
+ * `updateKeyFor`, `revokeFor`, `setRecordFor`). The owner signs one of these typed
1259
+ * structs; anyone can then submit the matching call and pay the gas. Every field is
1260
+ * bound, plus the owner's current `nonce` (read with `nonces(owner)`) and a `deadline`.
1261
+ *
1262
+ * The domain includes the chain id, so an authorization for one network cannot be
1263
+ * replayed on another even though the registry has the same address everywhere.
1264
+ */
1265
+ declare const EIP712_NAME = "Thurin PGPRegistry";
1266
+ declare const EIP712_VERSION = "2";
1267
+ declare function registryDomain(chainId: number, verifyingContract: Hex): TypedDataDomain;
1268
+ declare const AUTHORIZATION_TYPES: {
1269
+ readonly Attest: readonly [{
1270
+ readonly name: "owner";
1271
+ readonly type: "address";
1272
+ }, {
1273
+ readonly name: "fingerprint";
1274
+ readonly type: "bytes";
1275
+ }, {
1276
+ readonly name: "pgpSignature";
1277
+ readonly type: "bytes";
1278
+ }, {
1279
+ readonly name: "pgpPublicKey";
1280
+ readonly type: "bytes";
1281
+ }, {
1282
+ readonly name: "nonce";
1283
+ readonly type: "uint256";
1284
+ }, {
1285
+ readonly name: "deadline";
1286
+ readonly type: "uint256";
1287
+ }];
1288
+ readonly Reattest: readonly [{
1289
+ readonly name: "owner";
1290
+ readonly type: "address";
1291
+ }, {
1292
+ readonly name: "revokeIndex";
1293
+ readonly type: "uint256";
1294
+ }, {
1295
+ readonly name: "fingerprint";
1296
+ readonly type: "bytes";
1297
+ }, {
1298
+ readonly name: "pgpSignature";
1299
+ readonly type: "bytes";
1300
+ }, {
1301
+ readonly name: "pgpPublicKey";
1302
+ readonly type: "bytes";
1303
+ }, {
1304
+ readonly name: "nonce";
1305
+ readonly type: "uint256";
1306
+ }, {
1307
+ readonly name: "deadline";
1308
+ readonly type: "uint256";
1309
+ }];
1310
+ readonly UpdateKey: readonly [{
1311
+ readonly name: "owner";
1312
+ readonly type: "address";
1313
+ }, {
1314
+ readonly name: "index";
1315
+ readonly type: "uint256";
1316
+ }, {
1317
+ readonly name: "pgpPublicKey";
1318
+ readonly type: "bytes";
1319
+ }, {
1320
+ readonly name: "nonce";
1321
+ readonly type: "uint256";
1322
+ }, {
1323
+ readonly name: "deadline";
1324
+ readonly type: "uint256";
1325
+ }];
1326
+ readonly Revoke: readonly [{
1327
+ readonly name: "owner";
1328
+ readonly type: "address";
1329
+ }, {
1330
+ readonly name: "index";
1331
+ readonly type: "uint256";
1332
+ }, {
1333
+ readonly name: "nonce";
1334
+ readonly type: "uint256";
1335
+ }, {
1336
+ readonly name: "deadline";
1337
+ readonly type: "uint256";
1338
+ }];
1339
+ readonly SetRecord: readonly [{
1340
+ readonly name: "owner";
1341
+ readonly type: "address";
1342
+ }, {
1343
+ readonly name: "index";
1344
+ readonly type: "uint256";
1345
+ }, {
1346
+ readonly name: "kind";
1347
+ readonly type: "bytes32";
1348
+ }, {
1349
+ readonly name: "value";
1350
+ readonly type: "bytes";
1351
+ }, {
1352
+ readonly name: "nonce";
1353
+ readonly type: "uint256";
1354
+ }, {
1355
+ readonly name: "deadline";
1356
+ readonly type: "uint256";
1357
+ }];
1358
+ };
1359
+ type AuthorizationAction = keyof typeof AUTHORIZATION_TYPES;
1360
+ interface Common {
1361
+ owner: Hex;
1362
+ nonce: bigint;
1363
+ deadline: bigint;
1364
+ }
1365
+ type AttestAuthorization = Common & {
1366
+ fingerprint: string;
1367
+ pgpSignature: string;
1368
+ pgpPublicKey: string;
1369
+ };
1370
+ type ReattestAuthorization = AttestAuthorization & {
1371
+ revokeIndex: bigint;
1372
+ };
1373
+ type UpdateKeyAuthorization = Common & {
1374
+ index: bigint;
1375
+ pgpPublicKey: string;
1376
+ };
1377
+ type RevokeAuthorization = Common & {
1378
+ index: bigint;
1379
+ };
1380
+ type SetRecordAuthorization = Common & {
1381
+ index: bigint;
1382
+ kind: Hex;
1383
+ value: Hex;
1384
+ };
1385
+ /**
1386
+ * Build the object to pass to viem/wagmi `signTypedData`. `fingerprint` is the hex
1387
+ * fingerprint; `pgpSignature` / `pgpPublicKey` are the armored text exactly as they
1388
+ * will be submitted (they are hashed as UTF-8 bytes).
1389
+ */
1390
+ declare function attestTypedData(chainId: number, registry: Hex, a: AttestAuthorization): {
1391
+ domain: TypedDataDomain;
1392
+ types: {
1393
+ Attest: readonly [{
1394
+ readonly name: "owner";
1395
+ readonly type: "address";
1396
+ }, {
1397
+ readonly name: "fingerprint";
1398
+ readonly type: "bytes";
1399
+ }, {
1400
+ readonly name: "pgpSignature";
1401
+ readonly type: "bytes";
1402
+ }, {
1403
+ readonly name: "pgpPublicKey";
1404
+ readonly type: "bytes";
1405
+ }, {
1406
+ readonly name: "nonce";
1407
+ readonly type: "uint256";
1408
+ }, {
1409
+ readonly name: "deadline";
1410
+ readonly type: "uint256";
1411
+ }];
1412
+ };
1413
+ primaryType: "Attest";
1414
+ message: {
1415
+ owner: `0x${string}`;
1416
+ fingerprint: `0x${string}`;
1417
+ pgpSignature: `0x${string}`;
1418
+ pgpPublicKey: `0x${string}`;
1419
+ nonce: bigint;
1420
+ deadline: bigint;
1421
+ };
1422
+ };
1423
+ declare function reattestTypedData(chainId: number, registry: Hex, a: ReattestAuthorization): {
1424
+ domain: TypedDataDomain;
1425
+ types: {
1426
+ Reattest: readonly [{
1427
+ readonly name: "owner";
1428
+ readonly type: "address";
1429
+ }, {
1430
+ readonly name: "revokeIndex";
1431
+ readonly type: "uint256";
1432
+ }, {
1433
+ readonly name: "fingerprint";
1434
+ readonly type: "bytes";
1435
+ }, {
1436
+ readonly name: "pgpSignature";
1437
+ readonly type: "bytes";
1438
+ }, {
1439
+ readonly name: "pgpPublicKey";
1440
+ readonly type: "bytes";
1441
+ }, {
1442
+ readonly name: "nonce";
1443
+ readonly type: "uint256";
1444
+ }, {
1445
+ readonly name: "deadline";
1446
+ readonly type: "uint256";
1447
+ }];
1448
+ };
1449
+ primaryType: "Reattest";
1450
+ message: {
1451
+ revokeIndex: bigint;
1452
+ owner: `0x${string}`;
1453
+ fingerprint: `0x${string}`;
1454
+ pgpSignature: `0x${string}`;
1455
+ pgpPublicKey: `0x${string}`;
1456
+ nonce: bigint;
1457
+ deadline: bigint;
1458
+ };
1459
+ };
1460
+ declare function updateKeyTypedData(chainId: number, registry: Hex, a: UpdateKeyAuthorization): {
1461
+ domain: TypedDataDomain;
1462
+ types: {
1463
+ UpdateKey: readonly [{
1464
+ readonly name: "owner";
1465
+ readonly type: "address";
1466
+ }, {
1467
+ readonly name: "index";
1468
+ readonly type: "uint256";
1469
+ }, {
1470
+ readonly name: "pgpPublicKey";
1471
+ readonly type: "bytes";
1472
+ }, {
1473
+ readonly name: "nonce";
1474
+ readonly type: "uint256";
1475
+ }, {
1476
+ readonly name: "deadline";
1477
+ readonly type: "uint256";
1478
+ }];
1479
+ };
1480
+ primaryType: "UpdateKey";
1481
+ message: {
1482
+ owner: `0x${string}`;
1483
+ index: bigint;
1484
+ pgpPublicKey: `0x${string}`;
1485
+ nonce: bigint;
1486
+ deadline: bigint;
1487
+ };
1488
+ };
1489
+ declare function revokeTypedData(chainId: number, registry: Hex, a: RevokeAuthorization): {
1490
+ domain: TypedDataDomain;
1491
+ types: {
1492
+ Revoke: readonly [{
1493
+ readonly name: "owner";
1494
+ readonly type: "address";
1495
+ }, {
1496
+ readonly name: "index";
1497
+ readonly type: "uint256";
1498
+ }, {
1499
+ readonly name: "nonce";
1500
+ readonly type: "uint256";
1501
+ }, {
1502
+ readonly name: "deadline";
1503
+ readonly type: "uint256";
1504
+ }];
1505
+ };
1506
+ primaryType: "Revoke";
1507
+ message: {
1508
+ owner: `0x${string}`;
1509
+ index: bigint;
1510
+ nonce: bigint;
1511
+ deadline: bigint;
1512
+ };
1513
+ };
1514
+ declare function setRecordTypedData(chainId: number, registry: Hex, a: SetRecordAuthorization): {
1515
+ domain: TypedDataDomain;
1516
+ types: {
1517
+ SetRecord: readonly [{
1518
+ readonly name: "owner";
1519
+ readonly type: "address";
1520
+ }, {
1521
+ readonly name: "index";
1522
+ readonly type: "uint256";
1523
+ }, {
1524
+ readonly name: "kind";
1525
+ readonly type: "bytes32";
1526
+ }, {
1527
+ readonly name: "value";
1528
+ readonly type: "bytes";
1529
+ }, {
1530
+ readonly name: "nonce";
1531
+ readonly type: "uint256";
1532
+ }, {
1533
+ readonly name: "deadline";
1534
+ readonly type: "uint256";
1535
+ }];
1536
+ };
1537
+ primaryType: "SetRecord";
1538
+ message: {
1539
+ owner: `0x${string}`;
1540
+ index: bigint;
1541
+ kind: `0x${string}`;
1542
+ value: `0x${string}`;
1543
+ nonce: bigint;
1544
+ deadline: bigint;
1545
+ };
1546
+ };
1547
+ /** The digest the registry recovers the signer from — handy for tests and CLIs. */
1548
+ declare function authorizationDigest(typedData: ReturnType<typeof attestTypedData | typeof reattestTypedData | typeof updateKeyTypedData | typeof revokeTypedData | typeof setRecordTypedData>): Hex;
1549
+ /** `bytes32 kind` for a record from a human-readable name, e.g. recordKind('thurin.vouch'). */
1550
+ declare function recordKind(name: string): Hex;
1551
+
1552
+ export { AUTHORIZATION_TYPES, type AttestAuthorization, type Attestation, type AuthorizationAction, type EFPGraph, EIP712_NAME, EIP712_VERSION, type IdentityKitConfig, NETWORKS, type NetworkName, type Notation, type PGPKeyInfo, type PGPVerification, type Proof, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, type ReattestAuthorization, type RegistryDeployment, type RevokeAuthorization, type SetRecordAuthorization, type StrippedKey, type SubkeyInfo, type Theme, type ThurinIdentity, type UpdateKeyAuthorization, attestTypedData, authorizationDigest, bytesToFingerprint, chainFor, displayUrl, fetchEFPGraph, fetchKeyByFingerprint, fetchKeyByKeyId, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, isNetworkName, keyIdOf, keyIdToBytes, normalizeFingerprint, parsePgpKey, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyProof };