@gitmyabi-stg/ens--resolver-contracts 0.0.1

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,2145 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * PublicResolver_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const PublicResolver_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "contract ENS",
14
+ "name": "_ens",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "contract INameWrapper",
19
+ "name": "wrapperAddress",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "internalType": "address",
24
+ "name": "_trustedETHController",
25
+ "type": "address"
26
+ },
27
+ {
28
+ "internalType": "address",
29
+ "name": "_trustedReverseRegistrar",
30
+ "type": "address"
31
+ }
32
+ ],
33
+ "stateMutability": "nonpayable",
34
+ "type": "constructor"
35
+ },
36
+ {
37
+ "inputs": [
38
+ {
39
+ "internalType": "bytes",
40
+ "name": "addressBytes",
41
+ "type": "bytes"
42
+ }
43
+ ],
44
+ "name": "InvalidEVMAddress",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "anonymous": false,
49
+ "inputs": [
50
+ {
51
+ "indexed": true,
52
+ "internalType": "bytes32",
53
+ "name": "node",
54
+ "type": "bytes32"
55
+ },
56
+ {
57
+ "indexed": true,
58
+ "internalType": "uint256",
59
+ "name": "contentType",
60
+ "type": "uint256"
61
+ }
62
+ ],
63
+ "name": "ABIChanged",
64
+ "type": "event"
65
+ },
66
+ {
67
+ "anonymous": false,
68
+ "inputs": [
69
+ {
70
+ "indexed": true,
71
+ "internalType": "bytes32",
72
+ "name": "node",
73
+ "type": "bytes32"
74
+ },
75
+ {
76
+ "indexed": false,
77
+ "internalType": "address",
78
+ "name": "a",
79
+ "type": "address"
80
+ }
81
+ ],
82
+ "name": "AddrChanged",
83
+ "type": "event"
84
+ },
85
+ {
86
+ "anonymous": false,
87
+ "inputs": [
88
+ {
89
+ "indexed": true,
90
+ "internalType": "bytes32",
91
+ "name": "node",
92
+ "type": "bytes32"
93
+ },
94
+ {
95
+ "indexed": false,
96
+ "internalType": "uint256",
97
+ "name": "coinType",
98
+ "type": "uint256"
99
+ },
100
+ {
101
+ "indexed": false,
102
+ "internalType": "bytes",
103
+ "name": "newAddress",
104
+ "type": "bytes"
105
+ }
106
+ ],
107
+ "name": "AddressChanged",
108
+ "type": "event"
109
+ },
110
+ {
111
+ "anonymous": false,
112
+ "inputs": [
113
+ {
114
+ "indexed": true,
115
+ "internalType": "address",
116
+ "name": "owner",
117
+ "type": "address"
118
+ },
119
+ {
120
+ "indexed": true,
121
+ "internalType": "address",
122
+ "name": "operator",
123
+ "type": "address"
124
+ },
125
+ {
126
+ "indexed": false,
127
+ "internalType": "bool",
128
+ "name": "approved",
129
+ "type": "bool"
130
+ }
131
+ ],
132
+ "name": "ApprovalForAll",
133
+ "type": "event"
134
+ },
135
+ {
136
+ "anonymous": false,
137
+ "inputs": [
138
+ {
139
+ "indexed": false,
140
+ "internalType": "address",
141
+ "name": "owner",
142
+ "type": "address"
143
+ },
144
+ {
145
+ "indexed": true,
146
+ "internalType": "bytes32",
147
+ "name": "node",
148
+ "type": "bytes32"
149
+ },
150
+ {
151
+ "indexed": true,
152
+ "internalType": "address",
153
+ "name": "delegate",
154
+ "type": "address"
155
+ },
156
+ {
157
+ "indexed": true,
158
+ "internalType": "bool",
159
+ "name": "approved",
160
+ "type": "bool"
161
+ }
162
+ ],
163
+ "name": "Approved",
164
+ "type": "event"
165
+ },
166
+ {
167
+ "anonymous": false,
168
+ "inputs": [
169
+ {
170
+ "indexed": true,
171
+ "internalType": "bytes32",
172
+ "name": "node",
173
+ "type": "bytes32"
174
+ },
175
+ {
176
+ "indexed": false,
177
+ "internalType": "bytes",
178
+ "name": "hash",
179
+ "type": "bytes"
180
+ }
181
+ ],
182
+ "name": "ContenthashChanged",
183
+ "type": "event"
184
+ },
185
+ {
186
+ "anonymous": false,
187
+ "inputs": [
188
+ {
189
+ "indexed": true,
190
+ "internalType": "bytes32",
191
+ "name": "node",
192
+ "type": "bytes32"
193
+ },
194
+ {
195
+ "indexed": false,
196
+ "internalType": "bytes",
197
+ "name": "name",
198
+ "type": "bytes"
199
+ },
200
+ {
201
+ "indexed": false,
202
+ "internalType": "uint16",
203
+ "name": "resource",
204
+ "type": "uint16"
205
+ },
206
+ {
207
+ "indexed": false,
208
+ "internalType": "bytes",
209
+ "name": "record",
210
+ "type": "bytes"
211
+ }
212
+ ],
213
+ "name": "DNSRecordChanged",
214
+ "type": "event"
215
+ },
216
+ {
217
+ "anonymous": false,
218
+ "inputs": [
219
+ {
220
+ "indexed": true,
221
+ "internalType": "bytes32",
222
+ "name": "node",
223
+ "type": "bytes32"
224
+ },
225
+ {
226
+ "indexed": false,
227
+ "internalType": "bytes",
228
+ "name": "name",
229
+ "type": "bytes"
230
+ },
231
+ {
232
+ "indexed": false,
233
+ "internalType": "uint16",
234
+ "name": "resource",
235
+ "type": "uint16"
236
+ }
237
+ ],
238
+ "name": "DNSRecordDeleted",
239
+ "type": "event"
240
+ },
241
+ {
242
+ "anonymous": false,
243
+ "inputs": [
244
+ {
245
+ "indexed": true,
246
+ "internalType": "bytes32",
247
+ "name": "node",
248
+ "type": "bytes32"
249
+ },
250
+ {
251
+ "indexed": false,
252
+ "internalType": "bytes",
253
+ "name": "lastzonehash",
254
+ "type": "bytes"
255
+ },
256
+ {
257
+ "indexed": false,
258
+ "internalType": "bytes",
259
+ "name": "zonehash",
260
+ "type": "bytes"
261
+ }
262
+ ],
263
+ "name": "DNSZonehashChanged",
264
+ "type": "event"
265
+ },
266
+ {
267
+ "anonymous": false,
268
+ "inputs": [
269
+ {
270
+ "indexed": true,
271
+ "internalType": "bytes32",
272
+ "name": "node",
273
+ "type": "bytes32"
274
+ },
275
+ {
276
+ "indexed": true,
277
+ "internalType": "bytes4",
278
+ "name": "interfaceID",
279
+ "type": "bytes4"
280
+ },
281
+ {
282
+ "indexed": false,
283
+ "internalType": "address",
284
+ "name": "implementer",
285
+ "type": "address"
286
+ }
287
+ ],
288
+ "name": "InterfaceChanged",
289
+ "type": "event"
290
+ },
291
+ {
292
+ "anonymous": false,
293
+ "inputs": [
294
+ {
295
+ "indexed": true,
296
+ "internalType": "bytes32",
297
+ "name": "node",
298
+ "type": "bytes32"
299
+ },
300
+ {
301
+ "indexed": false,
302
+ "internalType": "string",
303
+ "name": "name",
304
+ "type": "string"
305
+ }
306
+ ],
307
+ "name": "NameChanged",
308
+ "type": "event"
309
+ },
310
+ {
311
+ "anonymous": false,
312
+ "inputs": [
313
+ {
314
+ "indexed": true,
315
+ "internalType": "bytes32",
316
+ "name": "node",
317
+ "type": "bytes32"
318
+ },
319
+ {
320
+ "indexed": false,
321
+ "internalType": "bytes32",
322
+ "name": "x",
323
+ "type": "bytes32"
324
+ },
325
+ {
326
+ "indexed": false,
327
+ "internalType": "bytes32",
328
+ "name": "y",
329
+ "type": "bytes32"
330
+ }
331
+ ],
332
+ "name": "PubkeyChanged",
333
+ "type": "event"
334
+ },
335
+ {
336
+ "anonymous": false,
337
+ "inputs": [
338
+ {
339
+ "indexed": true,
340
+ "internalType": "bytes32",
341
+ "name": "node",
342
+ "type": "bytes32"
343
+ },
344
+ {
345
+ "indexed": true,
346
+ "internalType": "string",
347
+ "name": "indexedKey",
348
+ "type": "string"
349
+ },
350
+ {
351
+ "indexed": false,
352
+ "internalType": "string",
353
+ "name": "key",
354
+ "type": "string"
355
+ },
356
+ {
357
+ "indexed": false,
358
+ "internalType": "string",
359
+ "name": "value",
360
+ "type": "string"
361
+ }
362
+ ],
363
+ "name": "TextChanged",
364
+ "type": "event"
365
+ },
366
+ {
367
+ "anonymous": false,
368
+ "inputs": [
369
+ {
370
+ "indexed": true,
371
+ "internalType": "bytes32",
372
+ "name": "node",
373
+ "type": "bytes32"
374
+ },
375
+ {
376
+ "indexed": false,
377
+ "internalType": "uint64",
378
+ "name": "newVersion",
379
+ "type": "uint64"
380
+ }
381
+ ],
382
+ "name": "VersionChanged",
383
+ "type": "event"
384
+ },
385
+ {
386
+ "inputs": [
387
+ {
388
+ "internalType": "bytes32",
389
+ "name": "node",
390
+ "type": "bytes32"
391
+ },
392
+ {
393
+ "internalType": "uint256",
394
+ "name": "contentTypes",
395
+ "type": "uint256"
396
+ }
397
+ ],
398
+ "name": "ABI",
399
+ "outputs": [
400
+ {
401
+ "internalType": "uint256",
402
+ "name": "",
403
+ "type": "uint256"
404
+ },
405
+ {
406
+ "internalType": "bytes",
407
+ "name": "",
408
+ "type": "bytes"
409
+ }
410
+ ],
411
+ "stateMutability": "view",
412
+ "type": "function"
413
+ },
414
+ {
415
+ "inputs": [
416
+ {
417
+ "internalType": "bytes32",
418
+ "name": "node",
419
+ "type": "bytes32"
420
+ }
421
+ ],
422
+ "name": "addr",
423
+ "outputs": [
424
+ {
425
+ "internalType": "address payable",
426
+ "name": "",
427
+ "type": "address"
428
+ }
429
+ ],
430
+ "stateMutability": "view",
431
+ "type": "function"
432
+ },
433
+ {
434
+ "inputs": [
435
+ {
436
+ "internalType": "bytes32",
437
+ "name": "node",
438
+ "type": "bytes32"
439
+ },
440
+ {
441
+ "internalType": "uint256",
442
+ "name": "coinType",
443
+ "type": "uint256"
444
+ }
445
+ ],
446
+ "name": "addr",
447
+ "outputs": [
448
+ {
449
+ "internalType": "bytes",
450
+ "name": "addressBytes",
451
+ "type": "bytes"
452
+ }
453
+ ],
454
+ "stateMutability": "view",
455
+ "type": "function"
456
+ },
457
+ {
458
+ "inputs": [
459
+ {
460
+ "internalType": "bytes32",
461
+ "name": "node",
462
+ "type": "bytes32"
463
+ },
464
+ {
465
+ "internalType": "address",
466
+ "name": "delegate",
467
+ "type": "address"
468
+ },
469
+ {
470
+ "internalType": "bool",
471
+ "name": "approved",
472
+ "type": "bool"
473
+ }
474
+ ],
475
+ "name": "approve",
476
+ "outputs": [],
477
+ "stateMutability": "nonpayable",
478
+ "type": "function"
479
+ },
480
+ {
481
+ "inputs": [
482
+ {
483
+ "internalType": "bytes32",
484
+ "name": "node",
485
+ "type": "bytes32"
486
+ }
487
+ ],
488
+ "name": "clearRecords",
489
+ "outputs": [],
490
+ "stateMutability": "nonpayable",
491
+ "type": "function"
492
+ },
493
+ {
494
+ "inputs": [
495
+ {
496
+ "internalType": "bytes32",
497
+ "name": "node",
498
+ "type": "bytes32"
499
+ }
500
+ ],
501
+ "name": "contenthash",
502
+ "outputs": [
503
+ {
504
+ "internalType": "bytes",
505
+ "name": "",
506
+ "type": "bytes"
507
+ }
508
+ ],
509
+ "stateMutability": "view",
510
+ "type": "function"
511
+ },
512
+ {
513
+ "inputs": [
514
+ {
515
+ "internalType": "bytes32",
516
+ "name": "node",
517
+ "type": "bytes32"
518
+ },
519
+ {
520
+ "internalType": "bytes32",
521
+ "name": "name",
522
+ "type": "bytes32"
523
+ },
524
+ {
525
+ "internalType": "uint16",
526
+ "name": "resource",
527
+ "type": "uint16"
528
+ }
529
+ ],
530
+ "name": "dnsRecord",
531
+ "outputs": [
532
+ {
533
+ "internalType": "bytes",
534
+ "name": "",
535
+ "type": "bytes"
536
+ }
537
+ ],
538
+ "stateMutability": "view",
539
+ "type": "function"
540
+ },
541
+ {
542
+ "inputs": [
543
+ {
544
+ "internalType": "bytes32",
545
+ "name": "node",
546
+ "type": "bytes32"
547
+ },
548
+ {
549
+ "internalType": "uint256",
550
+ "name": "coinType",
551
+ "type": "uint256"
552
+ }
553
+ ],
554
+ "name": "hasAddr",
555
+ "outputs": [
556
+ {
557
+ "internalType": "bool",
558
+ "name": "",
559
+ "type": "bool"
560
+ }
561
+ ],
562
+ "stateMutability": "view",
563
+ "type": "function"
564
+ },
565
+ {
566
+ "inputs": [
567
+ {
568
+ "internalType": "bytes32",
569
+ "name": "node",
570
+ "type": "bytes32"
571
+ },
572
+ {
573
+ "internalType": "bytes32",
574
+ "name": "name",
575
+ "type": "bytes32"
576
+ }
577
+ ],
578
+ "name": "hasDNSRecords",
579
+ "outputs": [
580
+ {
581
+ "internalType": "bool",
582
+ "name": "",
583
+ "type": "bool"
584
+ }
585
+ ],
586
+ "stateMutability": "view",
587
+ "type": "function"
588
+ },
589
+ {
590
+ "inputs": [
591
+ {
592
+ "internalType": "bytes32",
593
+ "name": "node",
594
+ "type": "bytes32"
595
+ },
596
+ {
597
+ "internalType": "bytes4",
598
+ "name": "interfaceID",
599
+ "type": "bytes4"
600
+ }
601
+ ],
602
+ "name": "interfaceImplementer",
603
+ "outputs": [
604
+ {
605
+ "internalType": "address",
606
+ "name": "",
607
+ "type": "address"
608
+ }
609
+ ],
610
+ "stateMutability": "view",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "inputs": [
615
+ {
616
+ "internalType": "address",
617
+ "name": "owner",
618
+ "type": "address"
619
+ },
620
+ {
621
+ "internalType": "bytes32",
622
+ "name": "node",
623
+ "type": "bytes32"
624
+ },
625
+ {
626
+ "internalType": "address",
627
+ "name": "delegate",
628
+ "type": "address"
629
+ }
630
+ ],
631
+ "name": "isApprovedFor",
632
+ "outputs": [
633
+ {
634
+ "internalType": "bool",
635
+ "name": "",
636
+ "type": "bool"
637
+ }
638
+ ],
639
+ "stateMutability": "view",
640
+ "type": "function"
641
+ },
642
+ {
643
+ "inputs": [
644
+ {
645
+ "internalType": "address",
646
+ "name": "account",
647
+ "type": "address"
648
+ },
649
+ {
650
+ "internalType": "address",
651
+ "name": "operator",
652
+ "type": "address"
653
+ }
654
+ ],
655
+ "name": "isApprovedForAll",
656
+ "outputs": [
657
+ {
658
+ "internalType": "bool",
659
+ "name": "",
660
+ "type": "bool"
661
+ }
662
+ ],
663
+ "stateMutability": "view",
664
+ "type": "function"
665
+ },
666
+ {
667
+ "inputs": [
668
+ {
669
+ "internalType": "bytes[]",
670
+ "name": "data",
671
+ "type": "bytes[]"
672
+ }
673
+ ],
674
+ "name": "multicall",
675
+ "outputs": [
676
+ {
677
+ "internalType": "bytes[]",
678
+ "name": "results",
679
+ "type": "bytes[]"
680
+ }
681
+ ],
682
+ "stateMutability": "nonpayable",
683
+ "type": "function"
684
+ },
685
+ {
686
+ "inputs": [
687
+ {
688
+ "internalType": "bytes32",
689
+ "name": "nodehash",
690
+ "type": "bytes32"
691
+ },
692
+ {
693
+ "internalType": "bytes[]",
694
+ "name": "data",
695
+ "type": "bytes[]"
696
+ }
697
+ ],
698
+ "name": "multicallWithNodeCheck",
699
+ "outputs": [
700
+ {
701
+ "internalType": "bytes[]",
702
+ "name": "results",
703
+ "type": "bytes[]"
704
+ }
705
+ ],
706
+ "stateMutability": "nonpayable",
707
+ "type": "function"
708
+ },
709
+ {
710
+ "inputs": [
711
+ {
712
+ "internalType": "bytes32",
713
+ "name": "node",
714
+ "type": "bytes32"
715
+ }
716
+ ],
717
+ "name": "name",
718
+ "outputs": [
719
+ {
720
+ "internalType": "string",
721
+ "name": "",
722
+ "type": "string"
723
+ }
724
+ ],
725
+ "stateMutability": "view",
726
+ "type": "function"
727
+ },
728
+ {
729
+ "inputs": [
730
+ {
731
+ "internalType": "bytes32",
732
+ "name": "node",
733
+ "type": "bytes32"
734
+ }
735
+ ],
736
+ "name": "pubkey",
737
+ "outputs": [
738
+ {
739
+ "internalType": "bytes32",
740
+ "name": "x",
741
+ "type": "bytes32"
742
+ },
743
+ {
744
+ "internalType": "bytes32",
745
+ "name": "y",
746
+ "type": "bytes32"
747
+ }
748
+ ],
749
+ "stateMutability": "view",
750
+ "type": "function"
751
+ },
752
+ {
753
+ "inputs": [
754
+ {
755
+ "internalType": "bytes32",
756
+ "name": "",
757
+ "type": "bytes32"
758
+ }
759
+ ],
760
+ "name": "recordVersions",
761
+ "outputs": [
762
+ {
763
+ "internalType": "uint64",
764
+ "name": "",
765
+ "type": "uint64"
766
+ }
767
+ ],
768
+ "stateMutability": "view",
769
+ "type": "function"
770
+ },
771
+ {
772
+ "inputs": [
773
+ {
774
+ "internalType": "bytes32",
775
+ "name": "node",
776
+ "type": "bytes32"
777
+ },
778
+ {
779
+ "internalType": "uint256",
780
+ "name": "contentType",
781
+ "type": "uint256"
782
+ },
783
+ {
784
+ "internalType": "bytes",
785
+ "name": "data",
786
+ "type": "bytes"
787
+ }
788
+ ],
789
+ "name": "setABI",
790
+ "outputs": [],
791
+ "stateMutability": "nonpayable",
792
+ "type": "function"
793
+ },
794
+ {
795
+ "inputs": [
796
+ {
797
+ "internalType": "bytes32",
798
+ "name": "node",
799
+ "type": "bytes32"
800
+ },
801
+ {
802
+ "internalType": "uint256",
803
+ "name": "coinType",
804
+ "type": "uint256"
805
+ },
806
+ {
807
+ "internalType": "bytes",
808
+ "name": "addressBytes",
809
+ "type": "bytes"
810
+ }
811
+ ],
812
+ "name": "setAddr",
813
+ "outputs": [],
814
+ "stateMutability": "nonpayable",
815
+ "type": "function"
816
+ },
817
+ {
818
+ "inputs": [
819
+ {
820
+ "internalType": "bytes32",
821
+ "name": "node",
822
+ "type": "bytes32"
823
+ },
824
+ {
825
+ "internalType": "address",
826
+ "name": "_addr",
827
+ "type": "address"
828
+ }
829
+ ],
830
+ "name": "setAddr",
831
+ "outputs": [],
832
+ "stateMutability": "nonpayable",
833
+ "type": "function"
834
+ },
835
+ {
836
+ "inputs": [
837
+ {
838
+ "internalType": "address",
839
+ "name": "operator",
840
+ "type": "address"
841
+ },
842
+ {
843
+ "internalType": "bool",
844
+ "name": "approved",
845
+ "type": "bool"
846
+ }
847
+ ],
848
+ "name": "setApprovalForAll",
849
+ "outputs": [],
850
+ "stateMutability": "nonpayable",
851
+ "type": "function"
852
+ },
853
+ {
854
+ "inputs": [
855
+ {
856
+ "internalType": "bytes32",
857
+ "name": "node",
858
+ "type": "bytes32"
859
+ },
860
+ {
861
+ "internalType": "bytes",
862
+ "name": "hash",
863
+ "type": "bytes"
864
+ }
865
+ ],
866
+ "name": "setContenthash",
867
+ "outputs": [],
868
+ "stateMutability": "nonpayable",
869
+ "type": "function"
870
+ },
871
+ {
872
+ "inputs": [
873
+ {
874
+ "internalType": "bytes32",
875
+ "name": "node",
876
+ "type": "bytes32"
877
+ },
878
+ {
879
+ "internalType": "bytes",
880
+ "name": "data",
881
+ "type": "bytes"
882
+ }
883
+ ],
884
+ "name": "setDNSRecords",
885
+ "outputs": [],
886
+ "stateMutability": "nonpayable",
887
+ "type": "function"
888
+ },
889
+ {
890
+ "inputs": [
891
+ {
892
+ "internalType": "bytes32",
893
+ "name": "node",
894
+ "type": "bytes32"
895
+ },
896
+ {
897
+ "internalType": "bytes4",
898
+ "name": "interfaceID",
899
+ "type": "bytes4"
900
+ },
901
+ {
902
+ "internalType": "address",
903
+ "name": "implementer",
904
+ "type": "address"
905
+ }
906
+ ],
907
+ "name": "setInterface",
908
+ "outputs": [],
909
+ "stateMutability": "nonpayable",
910
+ "type": "function"
911
+ },
912
+ {
913
+ "inputs": [
914
+ {
915
+ "internalType": "bytes32",
916
+ "name": "node",
917
+ "type": "bytes32"
918
+ },
919
+ {
920
+ "internalType": "string",
921
+ "name": "newName",
922
+ "type": "string"
923
+ }
924
+ ],
925
+ "name": "setName",
926
+ "outputs": [],
927
+ "stateMutability": "nonpayable",
928
+ "type": "function"
929
+ },
930
+ {
931
+ "inputs": [
932
+ {
933
+ "internalType": "bytes32",
934
+ "name": "node",
935
+ "type": "bytes32"
936
+ },
937
+ {
938
+ "internalType": "bytes32",
939
+ "name": "x",
940
+ "type": "bytes32"
941
+ },
942
+ {
943
+ "internalType": "bytes32",
944
+ "name": "y",
945
+ "type": "bytes32"
946
+ }
947
+ ],
948
+ "name": "setPubkey",
949
+ "outputs": [],
950
+ "stateMutability": "nonpayable",
951
+ "type": "function"
952
+ },
953
+ {
954
+ "inputs": [
955
+ {
956
+ "internalType": "bytes32",
957
+ "name": "node",
958
+ "type": "bytes32"
959
+ },
960
+ {
961
+ "internalType": "string",
962
+ "name": "key",
963
+ "type": "string"
964
+ },
965
+ {
966
+ "internalType": "string",
967
+ "name": "value",
968
+ "type": "string"
969
+ }
970
+ ],
971
+ "name": "setText",
972
+ "outputs": [],
973
+ "stateMutability": "nonpayable",
974
+ "type": "function"
975
+ },
976
+ {
977
+ "inputs": [
978
+ {
979
+ "internalType": "bytes32",
980
+ "name": "node",
981
+ "type": "bytes32"
982
+ },
983
+ {
984
+ "internalType": "bytes",
985
+ "name": "hash",
986
+ "type": "bytes"
987
+ }
988
+ ],
989
+ "name": "setZonehash",
990
+ "outputs": [],
991
+ "stateMutability": "nonpayable",
992
+ "type": "function"
993
+ },
994
+ {
995
+ "inputs": [
996
+ {
997
+ "internalType": "bytes4",
998
+ "name": "interfaceID",
999
+ "type": "bytes4"
1000
+ }
1001
+ ],
1002
+ "name": "supportsInterface",
1003
+ "outputs": [
1004
+ {
1005
+ "internalType": "bool",
1006
+ "name": "",
1007
+ "type": "bool"
1008
+ }
1009
+ ],
1010
+ "stateMutability": "view",
1011
+ "type": "function"
1012
+ },
1013
+ {
1014
+ "inputs": [
1015
+ {
1016
+ "internalType": "bytes32",
1017
+ "name": "node",
1018
+ "type": "bytes32"
1019
+ },
1020
+ {
1021
+ "internalType": "string",
1022
+ "name": "key",
1023
+ "type": "string"
1024
+ }
1025
+ ],
1026
+ "name": "text",
1027
+ "outputs": [
1028
+ {
1029
+ "internalType": "string",
1030
+ "name": "",
1031
+ "type": "string"
1032
+ }
1033
+ ],
1034
+ "stateMutability": "view",
1035
+ "type": "function"
1036
+ },
1037
+ {
1038
+ "inputs": [
1039
+ {
1040
+ "internalType": "bytes32",
1041
+ "name": "node",
1042
+ "type": "bytes32"
1043
+ }
1044
+ ],
1045
+ "name": "zonehash",
1046
+ "outputs": [
1047
+ {
1048
+ "internalType": "bytes",
1049
+ "name": "",
1050
+ "type": "bytes"
1051
+ }
1052
+ ],
1053
+ "stateMutability": "view",
1054
+ "type": "function"
1055
+ }
1056
+ ] as const satisfies Abi;
1057
+
1058
+ /**
1059
+ * Type-safe ABI for PublicResolver_json
1060
+ */
1061
+ export type PublicResolver_jsonAbi = typeof PublicResolver_jsonAbi;
1062
+
1063
+ /**
1064
+ * Contract instance type for PublicResolver_json
1065
+ */
1066
+ // Use any for contract type to avoid complex viem type issues
1067
+ // The runtime behavior is type-safe through viem's ABI typing
1068
+ export type PublicResolver_jsonContract = any;
1069
+
1070
+ /**
1071
+ * PublicResolver_json Contract Class
1072
+ *
1073
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
1074
+ *
1075
+ * @example
1076
+ * ```typescript
1077
+ * import { createPublicClient, createWalletClient, http } from 'viem';
1078
+ * import { mainnet } from 'viem/chains';
1079
+ * import { PublicResolver_json } from 'PublicResolver_json';
1080
+ *
1081
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
1082
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
1083
+ *
1084
+ * const contract = new PublicResolver_json('0x...', { publicClient, walletClient });
1085
+ *
1086
+ * // Read functions
1087
+ * const result = await contract.balanceOf('0x...');
1088
+ *
1089
+ * // Write functions
1090
+ * const hash = await contract.transfer('0x...', 1000n);
1091
+ *
1092
+ * // Simulate transactions (dry-run)
1093
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
1094
+ * console.log('Gas estimate:', simulation.request.gas);
1095
+ *
1096
+ * // Watch events
1097
+ * const unwatch = contract.watch.Transfer((event) => {
1098
+ * console.log('Transfer event:', event);
1099
+ * });
1100
+ * ```
1101
+ */
1102
+ export class PublicResolver_json {
1103
+ private contract: PublicResolver_jsonContract;
1104
+ private contractAddress: Address;
1105
+ private publicClient: PublicClient;
1106
+
1107
+ constructor(
1108
+ address: Address,
1109
+ clients: {
1110
+ publicClient: PublicClient;
1111
+ walletClient?: WalletClient;
1112
+ }
1113
+ ) {
1114
+ this.contractAddress = address;
1115
+ this.publicClient = clients.publicClient;
1116
+ this.contract = getContract({
1117
+ address,
1118
+ abi: PublicResolver_jsonAbi,
1119
+ client: {
1120
+ public: clients.publicClient,
1121
+ wallet: clients.walletClient,
1122
+ },
1123
+ });
1124
+ }
1125
+
1126
+ /**
1127
+ * Get the contract address
1128
+ */
1129
+ get address(): Address {
1130
+ return this.contractAddress;
1131
+ }
1132
+
1133
+ /**
1134
+ * Get the underlying viem contract instance
1135
+ */
1136
+ getContract(): PublicResolver_jsonContract {
1137
+ return this.contract;
1138
+ }
1139
+
1140
+ /**
1141
+ * ABI
1142
+ * view
1143
+ */
1144
+ async ABI(node: `0x${string}`, contentTypes: bigint): Promise<[bigint, `0x${string}`]> {
1145
+ return this.contract.read.ABI([node, contentTypes] as const) as Promise<[bigint, `0x${string}`]>;
1146
+ }
1147
+
1148
+ async addr(node: `0x${string}`): Promise<`0x${string}`>;
1149
+ async addr(node: `0x${string}`, coinType: bigint): Promise<`0x${string}`>;
1150
+ async addr(...args: any[]): Promise<any> {
1151
+ return this.contract.read.addr(args as any) as Promise<any>;
1152
+ }
1153
+
1154
+ /**
1155
+ * contenthash
1156
+ * view
1157
+ */
1158
+ async contenthash(node: `0x${string}`): Promise<`0x${string}`> {
1159
+ return this.contract.read.contenthash([node] as const) as Promise<`0x${string}`>;
1160
+ }
1161
+
1162
+ /**
1163
+ * dnsRecord
1164
+ * view
1165
+ */
1166
+ async dnsRecord(node: `0x${string}`, name: `0x${string}`, resource: bigint): Promise<`0x${string}`> {
1167
+ return this.contract.read.dnsRecord([node, name, resource] as const) as Promise<`0x${string}`>;
1168
+ }
1169
+
1170
+ /**
1171
+ * hasAddr
1172
+ * view
1173
+ */
1174
+ async hasAddr(node: `0x${string}`, coinType: bigint): Promise<boolean> {
1175
+ return this.contract.read.hasAddr([node, coinType] as const) as Promise<boolean>;
1176
+ }
1177
+
1178
+ /**
1179
+ * hasDNSRecords
1180
+ * view
1181
+ */
1182
+ async hasDNSRecords(node: `0x${string}`, name: `0x${string}`): Promise<boolean> {
1183
+ return this.contract.read.hasDNSRecords([node, name] as const) as Promise<boolean>;
1184
+ }
1185
+
1186
+ /**
1187
+ * interfaceImplementer
1188
+ * view
1189
+ */
1190
+ async interfaceImplementer(node: `0x${string}`, interfaceID: `0x${string}`): Promise<`0x${string}`> {
1191
+ return this.contract.read.interfaceImplementer([node, interfaceID] as const) as Promise<`0x${string}`>;
1192
+ }
1193
+
1194
+ /**
1195
+ * isApprovedFor
1196
+ * view
1197
+ */
1198
+ async isApprovedFor(owner: `0x${string}`, node: `0x${string}`, delegate: `0x${string}`): Promise<boolean> {
1199
+ return this.contract.read.isApprovedFor([owner, node, delegate] as const) as Promise<boolean>;
1200
+ }
1201
+
1202
+ /**
1203
+ * isApprovedForAll
1204
+ * view
1205
+ */
1206
+ async isApprovedForAll(account: `0x${string}`, operator: `0x${string}`): Promise<boolean> {
1207
+ return this.contract.read.isApprovedForAll([account, operator] as const) as Promise<boolean>;
1208
+ }
1209
+
1210
+ /**
1211
+ * name
1212
+ * view
1213
+ */
1214
+ async name(node: `0x${string}`): Promise<string> {
1215
+ return this.contract.read.name([node] as const) as Promise<string>;
1216
+ }
1217
+
1218
+ /**
1219
+ * pubkey
1220
+ * view
1221
+ */
1222
+ async pubkey(node: `0x${string}`): Promise<[`0x${string}`, `0x${string}`]> {
1223
+ return this.contract.read.pubkey([node] as const) as Promise<[`0x${string}`, `0x${string}`]>;
1224
+ }
1225
+
1226
+ /**
1227
+ * recordVersions
1228
+ * view
1229
+ */
1230
+ async recordVersions(arg0: `0x${string}`): Promise<bigint> {
1231
+ return this.contract.read.recordVersions([arg0] as const) as Promise<bigint>;
1232
+ }
1233
+
1234
+ /**
1235
+ * supportsInterface
1236
+ * view
1237
+ */
1238
+ async supportsInterface(interfaceID: `0x${string}`): Promise<boolean> {
1239
+ return this.contract.read.supportsInterface([interfaceID] as const) as Promise<boolean>;
1240
+ }
1241
+
1242
+ /**
1243
+ * text
1244
+ * view
1245
+ */
1246
+ async text(node: `0x${string}`, key: string): Promise<string> {
1247
+ return this.contract.read.text([node, key] as const) as Promise<string>;
1248
+ }
1249
+
1250
+ /**
1251
+ * zonehash
1252
+ * view
1253
+ */
1254
+ async zonehash(node: `0x${string}`): Promise<`0x${string}`> {
1255
+ return this.contract.read.zonehash([node] as const) as Promise<`0x${string}`>;
1256
+ }
1257
+
1258
+ /**
1259
+ * approve
1260
+ * nonpayable
1261
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1262
+ */
1263
+ async approve(node: `0x${string}`, delegate: `0x${string}`, approved: boolean, options?: {
1264
+ accessList?: import('viem').AccessList;
1265
+ authorizationList?: import('viem').AuthorizationList;
1266
+ chain?: import('viem').Chain | null;
1267
+ dataSuffix?: `0x${string}`;
1268
+ gas?: bigint;
1269
+ gasPrice?: bigint;
1270
+ maxFeePerGas?: bigint;
1271
+ maxPriorityFeePerGas?: bigint;
1272
+ nonce?: number;
1273
+ value?: bigint;
1274
+ }): Promise<`0x${string}`> {
1275
+ if (!this.contract.write) {
1276
+ throw new Error('Wallet client is required for write operations');
1277
+ }
1278
+ return this.contract.write.approve([node, delegate, approved] as const, options) as Promise<`0x${string}`>;
1279
+ }
1280
+
1281
+ /**
1282
+ * clearRecords
1283
+ * nonpayable
1284
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1285
+ */
1286
+ async clearRecords(node: `0x${string}`, options?: {
1287
+ accessList?: import('viem').AccessList;
1288
+ authorizationList?: import('viem').AuthorizationList;
1289
+ chain?: import('viem').Chain | null;
1290
+ dataSuffix?: `0x${string}`;
1291
+ gas?: bigint;
1292
+ gasPrice?: bigint;
1293
+ maxFeePerGas?: bigint;
1294
+ maxPriorityFeePerGas?: bigint;
1295
+ nonce?: number;
1296
+ value?: bigint;
1297
+ }): Promise<`0x${string}`> {
1298
+ if (!this.contract.write) {
1299
+ throw new Error('Wallet client is required for write operations');
1300
+ }
1301
+ return this.contract.write.clearRecords([node] as const, options) as Promise<`0x${string}`>;
1302
+ }
1303
+
1304
+ /**
1305
+ * multicall
1306
+ * nonpayable
1307
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1308
+ */
1309
+ async multicall(data: `0x${string}`[], options?: {
1310
+ accessList?: import('viem').AccessList;
1311
+ authorizationList?: import('viem').AuthorizationList;
1312
+ chain?: import('viem').Chain | null;
1313
+ dataSuffix?: `0x${string}`;
1314
+ gas?: bigint;
1315
+ gasPrice?: bigint;
1316
+ maxFeePerGas?: bigint;
1317
+ maxPriorityFeePerGas?: bigint;
1318
+ nonce?: number;
1319
+ value?: bigint;
1320
+ }): Promise<`0x${string}`> {
1321
+ if (!this.contract.write) {
1322
+ throw new Error('Wallet client is required for write operations');
1323
+ }
1324
+ return this.contract.write.multicall([data] as const, options) as Promise<`0x${string}`>;
1325
+ }
1326
+
1327
+ /**
1328
+ * multicallWithNodeCheck
1329
+ * nonpayable
1330
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1331
+ */
1332
+ async multicallWithNodeCheck(nodehash: `0x${string}`, data: `0x${string}`[], options?: {
1333
+ accessList?: import('viem').AccessList;
1334
+ authorizationList?: import('viem').AuthorizationList;
1335
+ chain?: import('viem').Chain | null;
1336
+ dataSuffix?: `0x${string}`;
1337
+ gas?: bigint;
1338
+ gasPrice?: bigint;
1339
+ maxFeePerGas?: bigint;
1340
+ maxPriorityFeePerGas?: bigint;
1341
+ nonce?: number;
1342
+ value?: bigint;
1343
+ }): Promise<`0x${string}`> {
1344
+ if (!this.contract.write) {
1345
+ throw new Error('Wallet client is required for write operations');
1346
+ }
1347
+ return this.contract.write.multicallWithNodeCheck([nodehash, data] as const, options) as Promise<`0x${string}`>;
1348
+ }
1349
+
1350
+ /**
1351
+ * setABI
1352
+ * nonpayable
1353
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1354
+ */
1355
+ async setABI(node: `0x${string}`, contentType: bigint, data: `0x${string}`, options?: {
1356
+ accessList?: import('viem').AccessList;
1357
+ authorizationList?: import('viem').AuthorizationList;
1358
+ chain?: import('viem').Chain | null;
1359
+ dataSuffix?: `0x${string}`;
1360
+ gas?: bigint;
1361
+ gasPrice?: bigint;
1362
+ maxFeePerGas?: bigint;
1363
+ maxPriorityFeePerGas?: bigint;
1364
+ nonce?: number;
1365
+ value?: bigint;
1366
+ }): Promise<`0x${string}`> {
1367
+ if (!this.contract.write) {
1368
+ throw new Error('Wallet client is required for write operations');
1369
+ }
1370
+ return this.contract.write.setABI([node, contentType, data] as const, options) as Promise<`0x${string}`>;
1371
+ }
1372
+
1373
+ async setAddr(node: `0x${string}`, coinType: bigint, addressBytes: `0x${string}`, options?: {
1374
+ accessList?: import('viem').AccessList;
1375
+ authorizationList?: import('viem').AuthorizationList;
1376
+ chain?: import('viem').Chain | null;
1377
+ dataSuffix?: `0x${string}`;
1378
+ gas?: bigint;
1379
+ gasPrice?: bigint;
1380
+ maxFeePerGas?: bigint;
1381
+ maxPriorityFeePerGas?: bigint;
1382
+ nonce?: number;
1383
+ value?: bigint;
1384
+ }): Promise<`0x${string}`>;
1385
+ async setAddr(node: `0x${string}`, _addr: `0x${string}`, options?: {
1386
+ accessList?: import('viem').AccessList;
1387
+ authorizationList?: import('viem').AuthorizationList;
1388
+ chain?: import('viem').Chain | null;
1389
+ dataSuffix?: `0x${string}`;
1390
+ gas?: bigint;
1391
+ gasPrice?: bigint;
1392
+ maxFeePerGas?: bigint;
1393
+ maxPriorityFeePerGas?: bigint;
1394
+ nonce?: number;
1395
+ value?: bigint;
1396
+ }): Promise<`0x${string}`>;
1397
+ async setAddr(...args: any[]): Promise<`0x${string}`> {
1398
+ if (!this.contract.write) {
1399
+ throw new Error('Wallet client is required for write operations');
1400
+ }
1401
+ return this.contract.write.setAddr(args as any) as Promise<`0x${string}`>;
1402
+ }
1403
+
1404
+ /**
1405
+ * setApprovalForAll
1406
+ * nonpayable
1407
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1408
+ */
1409
+ async setApprovalForAll(operator: `0x${string}`, approved: boolean, options?: {
1410
+ accessList?: import('viem').AccessList;
1411
+ authorizationList?: import('viem').AuthorizationList;
1412
+ chain?: import('viem').Chain | null;
1413
+ dataSuffix?: `0x${string}`;
1414
+ gas?: bigint;
1415
+ gasPrice?: bigint;
1416
+ maxFeePerGas?: bigint;
1417
+ maxPriorityFeePerGas?: bigint;
1418
+ nonce?: number;
1419
+ value?: bigint;
1420
+ }): Promise<`0x${string}`> {
1421
+ if (!this.contract.write) {
1422
+ throw new Error('Wallet client is required for write operations');
1423
+ }
1424
+ return this.contract.write.setApprovalForAll([operator, approved] as const, options) as Promise<`0x${string}`>;
1425
+ }
1426
+
1427
+ /**
1428
+ * setContenthash
1429
+ * nonpayable
1430
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1431
+ */
1432
+ async setContenthash(node: `0x${string}`, hash: `0x${string}`, options?: {
1433
+ accessList?: import('viem').AccessList;
1434
+ authorizationList?: import('viem').AuthorizationList;
1435
+ chain?: import('viem').Chain | null;
1436
+ dataSuffix?: `0x${string}`;
1437
+ gas?: bigint;
1438
+ gasPrice?: bigint;
1439
+ maxFeePerGas?: bigint;
1440
+ maxPriorityFeePerGas?: bigint;
1441
+ nonce?: number;
1442
+ value?: bigint;
1443
+ }): Promise<`0x${string}`> {
1444
+ if (!this.contract.write) {
1445
+ throw new Error('Wallet client is required for write operations');
1446
+ }
1447
+ return this.contract.write.setContenthash([node, hash] as const, options) as Promise<`0x${string}`>;
1448
+ }
1449
+
1450
+ /**
1451
+ * setDNSRecords
1452
+ * nonpayable
1453
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1454
+ */
1455
+ async setDNSRecords(node: `0x${string}`, data: `0x${string}`, options?: {
1456
+ accessList?: import('viem').AccessList;
1457
+ authorizationList?: import('viem').AuthorizationList;
1458
+ chain?: import('viem').Chain | null;
1459
+ dataSuffix?: `0x${string}`;
1460
+ gas?: bigint;
1461
+ gasPrice?: bigint;
1462
+ maxFeePerGas?: bigint;
1463
+ maxPriorityFeePerGas?: bigint;
1464
+ nonce?: number;
1465
+ value?: bigint;
1466
+ }): Promise<`0x${string}`> {
1467
+ if (!this.contract.write) {
1468
+ throw new Error('Wallet client is required for write operations');
1469
+ }
1470
+ return this.contract.write.setDNSRecords([node, data] as const, options) as Promise<`0x${string}`>;
1471
+ }
1472
+
1473
+ /**
1474
+ * setInterface
1475
+ * nonpayable
1476
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1477
+ */
1478
+ async setInterface(node: `0x${string}`, interfaceID: `0x${string}`, implementer: `0x${string}`, options?: {
1479
+ accessList?: import('viem').AccessList;
1480
+ authorizationList?: import('viem').AuthorizationList;
1481
+ chain?: import('viem').Chain | null;
1482
+ dataSuffix?: `0x${string}`;
1483
+ gas?: bigint;
1484
+ gasPrice?: bigint;
1485
+ maxFeePerGas?: bigint;
1486
+ maxPriorityFeePerGas?: bigint;
1487
+ nonce?: number;
1488
+ value?: bigint;
1489
+ }): Promise<`0x${string}`> {
1490
+ if (!this.contract.write) {
1491
+ throw new Error('Wallet client is required for write operations');
1492
+ }
1493
+ return this.contract.write.setInterface([node, interfaceID, implementer] as const, options) as Promise<`0x${string}`>;
1494
+ }
1495
+
1496
+ /**
1497
+ * setName
1498
+ * nonpayable
1499
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1500
+ */
1501
+ async setName(node: `0x${string}`, newName: string, options?: {
1502
+ accessList?: import('viem').AccessList;
1503
+ authorizationList?: import('viem').AuthorizationList;
1504
+ chain?: import('viem').Chain | null;
1505
+ dataSuffix?: `0x${string}`;
1506
+ gas?: bigint;
1507
+ gasPrice?: bigint;
1508
+ maxFeePerGas?: bigint;
1509
+ maxPriorityFeePerGas?: bigint;
1510
+ nonce?: number;
1511
+ value?: bigint;
1512
+ }): Promise<`0x${string}`> {
1513
+ if (!this.contract.write) {
1514
+ throw new Error('Wallet client is required for write operations');
1515
+ }
1516
+ return this.contract.write.setName([node, newName] as const, options) as Promise<`0x${string}`>;
1517
+ }
1518
+
1519
+ /**
1520
+ * setPubkey
1521
+ * nonpayable
1522
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1523
+ */
1524
+ async setPubkey(node: `0x${string}`, x: `0x${string}`, y: `0x${string}`, options?: {
1525
+ accessList?: import('viem').AccessList;
1526
+ authorizationList?: import('viem').AuthorizationList;
1527
+ chain?: import('viem').Chain | null;
1528
+ dataSuffix?: `0x${string}`;
1529
+ gas?: bigint;
1530
+ gasPrice?: bigint;
1531
+ maxFeePerGas?: bigint;
1532
+ maxPriorityFeePerGas?: bigint;
1533
+ nonce?: number;
1534
+ value?: bigint;
1535
+ }): Promise<`0x${string}`> {
1536
+ if (!this.contract.write) {
1537
+ throw new Error('Wallet client is required for write operations');
1538
+ }
1539
+ return this.contract.write.setPubkey([node, x, y] as const, options) as Promise<`0x${string}`>;
1540
+ }
1541
+
1542
+ /**
1543
+ * setText
1544
+ * nonpayable
1545
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1546
+ */
1547
+ async setText(node: `0x${string}`, key: string, value: string, options?: {
1548
+ accessList?: import('viem').AccessList;
1549
+ authorizationList?: import('viem').AuthorizationList;
1550
+ chain?: import('viem').Chain | null;
1551
+ dataSuffix?: `0x${string}`;
1552
+ gas?: bigint;
1553
+ gasPrice?: bigint;
1554
+ maxFeePerGas?: bigint;
1555
+ maxPriorityFeePerGas?: bigint;
1556
+ nonce?: number;
1557
+ value?: bigint;
1558
+ }): Promise<`0x${string}`> {
1559
+ if (!this.contract.write) {
1560
+ throw new Error('Wallet client is required for write operations');
1561
+ }
1562
+ return this.contract.write.setText([node, key, value] as const, options) as Promise<`0x${string}`>;
1563
+ }
1564
+
1565
+ /**
1566
+ * setZonehash
1567
+ * nonpayable
1568
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1569
+ */
1570
+ async setZonehash(node: `0x${string}`, hash: `0x${string}`, options?: {
1571
+ accessList?: import('viem').AccessList;
1572
+ authorizationList?: import('viem').AuthorizationList;
1573
+ chain?: import('viem').Chain | null;
1574
+ dataSuffix?: `0x${string}`;
1575
+ gas?: bigint;
1576
+ gasPrice?: bigint;
1577
+ maxFeePerGas?: bigint;
1578
+ maxPriorityFeePerGas?: bigint;
1579
+ nonce?: number;
1580
+ value?: bigint;
1581
+ }): Promise<`0x${string}`> {
1582
+ if (!this.contract.write) {
1583
+ throw new Error('Wallet client is required for write operations');
1584
+ }
1585
+ return this.contract.write.setZonehash([node, hash] as const, options) as Promise<`0x${string}`>;
1586
+ }
1587
+
1588
+
1589
+
1590
+ /**
1591
+ * Simulate contract write operations (dry-run without sending transaction)
1592
+ *
1593
+ * @example
1594
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1595
+ * console.log('Gas estimate:', result.request.gas);
1596
+ * console.log('Would succeed:', result.result);
1597
+ */
1598
+ get simulate() {
1599
+ const contract = this.contract;
1600
+ if (!contract.simulate) {
1601
+ throw new Error('Public client is required for simulation');
1602
+ }
1603
+ return {
1604
+ /**
1605
+ * Simulate approve
1606
+ * Returns gas estimate and result without sending transaction
1607
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1608
+ */
1609
+ async approve(node: `0x${string}`, delegate: `0x${string}`, approved: boolean, options?: {
1610
+ accessList?: import('viem').AccessList;
1611
+ authorizationList?: import('viem').AuthorizationList;
1612
+ chain?: import('viem').Chain | null;
1613
+ dataSuffix?: `0x${string}`;
1614
+ gas?: bigint;
1615
+ gasPrice?: bigint;
1616
+ maxFeePerGas?: bigint;
1617
+ maxPriorityFeePerGas?: bigint;
1618
+ nonce?: number;
1619
+ value?: bigint;
1620
+ }): Promise<void> {
1621
+ return contract.simulate.approve([node, delegate, approved] as const, options) as Promise<void>;
1622
+ },
1623
+ /**
1624
+ * Simulate clearRecords
1625
+ * Returns gas estimate and result without sending transaction
1626
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1627
+ */
1628
+ async clearRecords(node: `0x${string}`, options?: {
1629
+ accessList?: import('viem').AccessList;
1630
+ authorizationList?: import('viem').AuthorizationList;
1631
+ chain?: import('viem').Chain | null;
1632
+ dataSuffix?: `0x${string}`;
1633
+ gas?: bigint;
1634
+ gasPrice?: bigint;
1635
+ maxFeePerGas?: bigint;
1636
+ maxPriorityFeePerGas?: bigint;
1637
+ nonce?: number;
1638
+ value?: bigint;
1639
+ }): Promise<void> {
1640
+ return contract.simulate.clearRecords([node] as const, options) as Promise<void>;
1641
+ },
1642
+ /**
1643
+ * Simulate multicall
1644
+ * Returns gas estimate and result without sending transaction
1645
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1646
+ */
1647
+ async multicall(data: `0x${string}`[], options?: {
1648
+ accessList?: import('viem').AccessList;
1649
+ authorizationList?: import('viem').AuthorizationList;
1650
+ chain?: import('viem').Chain | null;
1651
+ dataSuffix?: `0x${string}`;
1652
+ gas?: bigint;
1653
+ gasPrice?: bigint;
1654
+ maxFeePerGas?: bigint;
1655
+ maxPriorityFeePerGas?: bigint;
1656
+ nonce?: number;
1657
+ value?: bigint;
1658
+ }): Promise<`0x${string}`[]> {
1659
+ return contract.simulate.multicall([data] as const, options) as Promise<`0x${string}`[]>;
1660
+ },
1661
+ /**
1662
+ * Simulate multicallWithNodeCheck
1663
+ * Returns gas estimate and result without sending transaction
1664
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1665
+ */
1666
+ async multicallWithNodeCheck(nodehash: `0x${string}`, data: `0x${string}`[], options?: {
1667
+ accessList?: import('viem').AccessList;
1668
+ authorizationList?: import('viem').AuthorizationList;
1669
+ chain?: import('viem').Chain | null;
1670
+ dataSuffix?: `0x${string}`;
1671
+ gas?: bigint;
1672
+ gasPrice?: bigint;
1673
+ maxFeePerGas?: bigint;
1674
+ maxPriorityFeePerGas?: bigint;
1675
+ nonce?: number;
1676
+ value?: bigint;
1677
+ }): Promise<`0x${string}`[]> {
1678
+ return contract.simulate.multicallWithNodeCheck([nodehash, data] as const, options) as Promise<`0x${string}`[]>;
1679
+ },
1680
+ /**
1681
+ * Simulate setABI
1682
+ * Returns gas estimate and result without sending transaction
1683
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1684
+ */
1685
+ async setABI(node: `0x${string}`, contentType: bigint, data: `0x${string}`, options?: {
1686
+ accessList?: import('viem').AccessList;
1687
+ authorizationList?: import('viem').AuthorizationList;
1688
+ chain?: import('viem').Chain | null;
1689
+ dataSuffix?: `0x${string}`;
1690
+ gas?: bigint;
1691
+ gasPrice?: bigint;
1692
+ maxFeePerGas?: bigint;
1693
+ maxPriorityFeePerGas?: bigint;
1694
+ nonce?: number;
1695
+ value?: bigint;
1696
+ }): Promise<void> {
1697
+ return contract.simulate.setABI([node, contentType, data] as const, options) as Promise<void>;
1698
+ },
1699
+ /**
1700
+ * Simulate setAddr
1701
+ * Returns gas estimate and result without sending transaction
1702
+ * Supports multiple overloads: (bytes32, uint256, bytes), (bytes32, address)
1703
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1704
+ */
1705
+ async setAddr(...args: any[]): Promise<any> {
1706
+ return contract.simulate.setAddr(args as any) as Promise<any>;
1707
+ },
1708
+ /**
1709
+ * Simulate setApprovalForAll
1710
+ * Returns gas estimate and result without sending transaction
1711
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1712
+ */
1713
+ async setApprovalForAll(operator: `0x${string}`, approved: boolean, options?: {
1714
+ accessList?: import('viem').AccessList;
1715
+ authorizationList?: import('viem').AuthorizationList;
1716
+ chain?: import('viem').Chain | null;
1717
+ dataSuffix?: `0x${string}`;
1718
+ gas?: bigint;
1719
+ gasPrice?: bigint;
1720
+ maxFeePerGas?: bigint;
1721
+ maxPriorityFeePerGas?: bigint;
1722
+ nonce?: number;
1723
+ value?: bigint;
1724
+ }): Promise<void> {
1725
+ return contract.simulate.setApprovalForAll([operator, approved] as const, options) as Promise<void>;
1726
+ },
1727
+ /**
1728
+ * Simulate setContenthash
1729
+ * Returns gas estimate and result without sending transaction
1730
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1731
+ */
1732
+ async setContenthash(node: `0x${string}`, hash: `0x${string}`, options?: {
1733
+ accessList?: import('viem').AccessList;
1734
+ authorizationList?: import('viem').AuthorizationList;
1735
+ chain?: import('viem').Chain | null;
1736
+ dataSuffix?: `0x${string}`;
1737
+ gas?: bigint;
1738
+ gasPrice?: bigint;
1739
+ maxFeePerGas?: bigint;
1740
+ maxPriorityFeePerGas?: bigint;
1741
+ nonce?: number;
1742
+ value?: bigint;
1743
+ }): Promise<void> {
1744
+ return contract.simulate.setContenthash([node, hash] as const, options) as Promise<void>;
1745
+ },
1746
+ /**
1747
+ * Simulate setDNSRecords
1748
+ * Returns gas estimate and result without sending transaction
1749
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1750
+ */
1751
+ async setDNSRecords(node: `0x${string}`, data: `0x${string}`, options?: {
1752
+ accessList?: import('viem').AccessList;
1753
+ authorizationList?: import('viem').AuthorizationList;
1754
+ chain?: import('viem').Chain | null;
1755
+ dataSuffix?: `0x${string}`;
1756
+ gas?: bigint;
1757
+ gasPrice?: bigint;
1758
+ maxFeePerGas?: bigint;
1759
+ maxPriorityFeePerGas?: bigint;
1760
+ nonce?: number;
1761
+ value?: bigint;
1762
+ }): Promise<void> {
1763
+ return contract.simulate.setDNSRecords([node, data] as const, options) as Promise<void>;
1764
+ },
1765
+ /**
1766
+ * Simulate setInterface
1767
+ * Returns gas estimate and result without sending transaction
1768
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1769
+ */
1770
+ async setInterface(node: `0x${string}`, interfaceID: `0x${string}`, implementer: `0x${string}`, options?: {
1771
+ accessList?: import('viem').AccessList;
1772
+ authorizationList?: import('viem').AuthorizationList;
1773
+ chain?: import('viem').Chain | null;
1774
+ dataSuffix?: `0x${string}`;
1775
+ gas?: bigint;
1776
+ gasPrice?: bigint;
1777
+ maxFeePerGas?: bigint;
1778
+ maxPriorityFeePerGas?: bigint;
1779
+ nonce?: number;
1780
+ value?: bigint;
1781
+ }): Promise<void> {
1782
+ return contract.simulate.setInterface([node, interfaceID, implementer] as const, options) as Promise<void>;
1783
+ },
1784
+ /**
1785
+ * Simulate setName
1786
+ * Returns gas estimate and result without sending transaction
1787
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1788
+ */
1789
+ async setName(node: `0x${string}`, newName: string, options?: {
1790
+ accessList?: import('viem').AccessList;
1791
+ authorizationList?: import('viem').AuthorizationList;
1792
+ chain?: import('viem').Chain | null;
1793
+ dataSuffix?: `0x${string}`;
1794
+ gas?: bigint;
1795
+ gasPrice?: bigint;
1796
+ maxFeePerGas?: bigint;
1797
+ maxPriorityFeePerGas?: bigint;
1798
+ nonce?: number;
1799
+ value?: bigint;
1800
+ }): Promise<void> {
1801
+ return contract.simulate.setName([node, newName] as const, options) as Promise<void>;
1802
+ },
1803
+ /**
1804
+ * Simulate setPubkey
1805
+ * Returns gas estimate and result without sending transaction
1806
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1807
+ */
1808
+ async setPubkey(node: `0x${string}`, x: `0x${string}`, y: `0x${string}`, options?: {
1809
+ accessList?: import('viem').AccessList;
1810
+ authorizationList?: import('viem').AuthorizationList;
1811
+ chain?: import('viem').Chain | null;
1812
+ dataSuffix?: `0x${string}`;
1813
+ gas?: bigint;
1814
+ gasPrice?: bigint;
1815
+ maxFeePerGas?: bigint;
1816
+ maxPriorityFeePerGas?: bigint;
1817
+ nonce?: number;
1818
+ value?: bigint;
1819
+ }): Promise<void> {
1820
+ return contract.simulate.setPubkey([node, x, y] as const, options) as Promise<void>;
1821
+ },
1822
+ /**
1823
+ * Simulate setText
1824
+ * Returns gas estimate and result without sending transaction
1825
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1826
+ */
1827
+ async setText(node: `0x${string}`, key: string, value: string, options?: {
1828
+ accessList?: import('viem').AccessList;
1829
+ authorizationList?: import('viem').AuthorizationList;
1830
+ chain?: import('viem').Chain | null;
1831
+ dataSuffix?: `0x${string}`;
1832
+ gas?: bigint;
1833
+ gasPrice?: bigint;
1834
+ maxFeePerGas?: bigint;
1835
+ maxPriorityFeePerGas?: bigint;
1836
+ nonce?: number;
1837
+ value?: bigint;
1838
+ }): Promise<void> {
1839
+ return contract.simulate.setText([node, key, value] as const, options) as Promise<void>;
1840
+ },
1841
+ /**
1842
+ * Simulate setZonehash
1843
+ * Returns gas estimate and result without sending transaction
1844
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1845
+ */
1846
+ async setZonehash(node: `0x${string}`, hash: `0x${string}`, options?: {
1847
+ accessList?: import('viem').AccessList;
1848
+ authorizationList?: import('viem').AuthorizationList;
1849
+ chain?: import('viem').Chain | null;
1850
+ dataSuffix?: `0x${string}`;
1851
+ gas?: bigint;
1852
+ gasPrice?: bigint;
1853
+ maxFeePerGas?: bigint;
1854
+ maxPriorityFeePerGas?: bigint;
1855
+ nonce?: number;
1856
+ value?: bigint;
1857
+ }): Promise<void> {
1858
+ return contract.simulate.setZonehash([node, hash] as const, options) as Promise<void>;
1859
+ }
1860
+ };
1861
+ }
1862
+
1863
+ /**
1864
+ * Watch contract events
1865
+ *
1866
+ * @example
1867
+ * // Watch all Transfer events
1868
+ * const unwatch = contract.watch.Transfer((event) => {
1869
+ * console.log('Transfer:', event);
1870
+ * });
1871
+ *
1872
+ * // Stop watching
1873
+ * unwatch();
1874
+ */
1875
+ get watch() {
1876
+ return {
1877
+ /**
1878
+ * Watch ABIChanged events
1879
+ * @param callback Function to call when event is emitted
1880
+ * @param filter Optional filter for indexed parameters
1881
+ * @returns Unwatch function to stop listening
1882
+ */
1883
+ ABIChanged: (callback: (event: { node: `0x${string}`; contentType: bigint }) => void, filter?: { node: `0x${string}`; contentType: bigint }) => {
1884
+ return this.publicClient.watchContractEvent({
1885
+ address: this.contractAddress,
1886
+ abi: PublicResolver_jsonAbi,
1887
+ eventName: 'ABIChanged',
1888
+ args: filter,
1889
+ onLogs: (logs: any[]) => {
1890
+ logs.forEach((log: any) => {
1891
+ callback(log.args as any);
1892
+ });
1893
+ },
1894
+ }) as () => void;
1895
+ },
1896
+ /**
1897
+ * Watch AddrChanged events
1898
+ * @param callback Function to call when event is emitted
1899
+ * @param filter Optional filter for indexed parameters
1900
+ * @returns Unwatch function to stop listening
1901
+ */
1902
+ AddrChanged: (callback: (event: { node: `0x${string}`; a: `0x${string}` }) => void, filter?: { node: `0x${string}` }) => {
1903
+ return this.publicClient.watchContractEvent({
1904
+ address: this.contractAddress,
1905
+ abi: PublicResolver_jsonAbi,
1906
+ eventName: 'AddrChanged',
1907
+ args: filter,
1908
+ onLogs: (logs: any[]) => {
1909
+ logs.forEach((log: any) => {
1910
+ callback(log.args as any);
1911
+ });
1912
+ },
1913
+ }) as () => void;
1914
+ },
1915
+ /**
1916
+ * Watch AddressChanged events
1917
+ * @param callback Function to call when event is emitted
1918
+ * @param filter Optional filter for indexed parameters
1919
+ * @returns Unwatch function to stop listening
1920
+ */
1921
+ AddressChanged: (callback: (event: { node: `0x${string}`; coinType: bigint; newAddress: `0x${string}` }) => void, filter?: { node: `0x${string}` }) => {
1922
+ return this.publicClient.watchContractEvent({
1923
+ address: this.contractAddress,
1924
+ abi: PublicResolver_jsonAbi,
1925
+ eventName: 'AddressChanged',
1926
+ args: filter,
1927
+ onLogs: (logs: any[]) => {
1928
+ logs.forEach((log: any) => {
1929
+ callback(log.args as any);
1930
+ });
1931
+ },
1932
+ }) as () => void;
1933
+ },
1934
+ /**
1935
+ * Watch ApprovalForAll events
1936
+ * @param callback Function to call when event is emitted
1937
+ * @param filter Optional filter for indexed parameters
1938
+ * @returns Unwatch function to stop listening
1939
+ */
1940
+ ApprovalForAll: (callback: (event: { owner: `0x${string}`; operator: `0x${string}`; approved: boolean }) => void, filter?: { owner: `0x${string}`; operator: `0x${string}` }) => {
1941
+ return this.publicClient.watchContractEvent({
1942
+ address: this.contractAddress,
1943
+ abi: PublicResolver_jsonAbi,
1944
+ eventName: 'ApprovalForAll',
1945
+ args: filter,
1946
+ onLogs: (logs: any[]) => {
1947
+ logs.forEach((log: any) => {
1948
+ callback(log.args as any);
1949
+ });
1950
+ },
1951
+ }) as () => void;
1952
+ },
1953
+ /**
1954
+ * Watch Approved events
1955
+ * @param callback Function to call when event is emitted
1956
+ * @param filter Optional filter for indexed parameters
1957
+ * @returns Unwatch function to stop listening
1958
+ */
1959
+ Approved: (callback: (event: { node: `0x${string}`; delegate: `0x${string}`; approved: boolean; owner: `0x${string}` }) => void, filter?: { node: `0x${string}`; delegate: `0x${string}`; approved: boolean }) => {
1960
+ return this.publicClient.watchContractEvent({
1961
+ address: this.contractAddress,
1962
+ abi: PublicResolver_jsonAbi,
1963
+ eventName: 'Approved',
1964
+ args: filter,
1965
+ onLogs: (logs: any[]) => {
1966
+ logs.forEach((log: any) => {
1967
+ callback(log.args as any);
1968
+ });
1969
+ },
1970
+ }) as () => void;
1971
+ },
1972
+ /**
1973
+ * Watch ContenthashChanged events
1974
+ * @param callback Function to call when event is emitted
1975
+ * @param filter Optional filter for indexed parameters
1976
+ * @returns Unwatch function to stop listening
1977
+ */
1978
+ ContenthashChanged: (callback: (event: { node: `0x${string}`; hash: `0x${string}` }) => void, filter?: { node: `0x${string}` }) => {
1979
+ return this.publicClient.watchContractEvent({
1980
+ address: this.contractAddress,
1981
+ abi: PublicResolver_jsonAbi,
1982
+ eventName: 'ContenthashChanged',
1983
+ args: filter,
1984
+ onLogs: (logs: any[]) => {
1985
+ logs.forEach((log: any) => {
1986
+ callback(log.args as any);
1987
+ });
1988
+ },
1989
+ }) as () => void;
1990
+ },
1991
+ /**
1992
+ * Watch DNSRecordChanged events
1993
+ * @param callback Function to call when event is emitted
1994
+ * @param filter Optional filter for indexed parameters
1995
+ * @returns Unwatch function to stop listening
1996
+ */
1997
+ DNSRecordChanged: (callback: (event: { node: `0x${string}`; name: `0x${string}`; resource: bigint; record: `0x${string}` }) => void, filter?: { node: `0x${string}` }) => {
1998
+ return this.publicClient.watchContractEvent({
1999
+ address: this.contractAddress,
2000
+ abi: PublicResolver_jsonAbi,
2001
+ eventName: 'DNSRecordChanged',
2002
+ args: filter,
2003
+ onLogs: (logs: any[]) => {
2004
+ logs.forEach((log: any) => {
2005
+ callback(log.args as any);
2006
+ });
2007
+ },
2008
+ }) as () => void;
2009
+ },
2010
+ /**
2011
+ * Watch DNSRecordDeleted events
2012
+ * @param callback Function to call when event is emitted
2013
+ * @param filter Optional filter for indexed parameters
2014
+ * @returns Unwatch function to stop listening
2015
+ */
2016
+ DNSRecordDeleted: (callback: (event: { node: `0x${string}`; name: `0x${string}`; resource: bigint }) => void, filter?: { node: `0x${string}` }) => {
2017
+ return this.publicClient.watchContractEvent({
2018
+ address: this.contractAddress,
2019
+ abi: PublicResolver_jsonAbi,
2020
+ eventName: 'DNSRecordDeleted',
2021
+ args: filter,
2022
+ onLogs: (logs: any[]) => {
2023
+ logs.forEach((log: any) => {
2024
+ callback(log.args as any);
2025
+ });
2026
+ },
2027
+ }) as () => void;
2028
+ },
2029
+ /**
2030
+ * Watch DNSZonehashChanged events
2031
+ * @param callback Function to call when event is emitted
2032
+ * @param filter Optional filter for indexed parameters
2033
+ * @returns Unwatch function to stop listening
2034
+ */
2035
+ DNSZonehashChanged: (callback: (event: { node: `0x${string}`; lastzonehash: `0x${string}`; zonehash: `0x${string}` }) => void, filter?: { node: `0x${string}` }) => {
2036
+ return this.publicClient.watchContractEvent({
2037
+ address: this.contractAddress,
2038
+ abi: PublicResolver_jsonAbi,
2039
+ eventName: 'DNSZonehashChanged',
2040
+ args: filter,
2041
+ onLogs: (logs: any[]) => {
2042
+ logs.forEach((log: any) => {
2043
+ callback(log.args as any);
2044
+ });
2045
+ },
2046
+ }) as () => void;
2047
+ },
2048
+ /**
2049
+ * Watch InterfaceChanged events
2050
+ * @param callback Function to call when event is emitted
2051
+ * @param filter Optional filter for indexed parameters
2052
+ * @returns Unwatch function to stop listening
2053
+ */
2054
+ InterfaceChanged: (callback: (event: { node: `0x${string}`; interfaceID: `0x${string}`; implementer: `0x${string}` }) => void, filter?: { node: `0x${string}`; interfaceID: `0x${string}` }) => {
2055
+ return this.publicClient.watchContractEvent({
2056
+ address: this.contractAddress,
2057
+ abi: PublicResolver_jsonAbi,
2058
+ eventName: 'InterfaceChanged',
2059
+ args: filter,
2060
+ onLogs: (logs: any[]) => {
2061
+ logs.forEach((log: any) => {
2062
+ callback(log.args as any);
2063
+ });
2064
+ },
2065
+ }) as () => void;
2066
+ },
2067
+ /**
2068
+ * Watch NameChanged events
2069
+ * @param callback Function to call when event is emitted
2070
+ * @param filter Optional filter for indexed parameters
2071
+ * @returns Unwatch function to stop listening
2072
+ */
2073
+ NameChanged: (callback: (event: { node: `0x${string}`; name: string }) => void, filter?: { node: `0x${string}` }) => {
2074
+ return this.publicClient.watchContractEvent({
2075
+ address: this.contractAddress,
2076
+ abi: PublicResolver_jsonAbi,
2077
+ eventName: 'NameChanged',
2078
+ args: filter,
2079
+ onLogs: (logs: any[]) => {
2080
+ logs.forEach((log: any) => {
2081
+ callback(log.args as any);
2082
+ });
2083
+ },
2084
+ }) as () => void;
2085
+ },
2086
+ /**
2087
+ * Watch PubkeyChanged events
2088
+ * @param callback Function to call when event is emitted
2089
+ * @param filter Optional filter for indexed parameters
2090
+ * @returns Unwatch function to stop listening
2091
+ */
2092
+ PubkeyChanged: (callback: (event: { node: `0x${string}`; x: `0x${string}`; y: `0x${string}` }) => void, filter?: { node: `0x${string}` }) => {
2093
+ return this.publicClient.watchContractEvent({
2094
+ address: this.contractAddress,
2095
+ abi: PublicResolver_jsonAbi,
2096
+ eventName: 'PubkeyChanged',
2097
+ args: filter,
2098
+ onLogs: (logs: any[]) => {
2099
+ logs.forEach((log: any) => {
2100
+ callback(log.args as any);
2101
+ });
2102
+ },
2103
+ }) as () => void;
2104
+ },
2105
+ /**
2106
+ * Watch TextChanged events
2107
+ * @param callback Function to call when event is emitted
2108
+ * @param filter Optional filter for indexed parameters
2109
+ * @returns Unwatch function to stop listening
2110
+ */
2111
+ TextChanged: (callback: (event: { node: `0x${string}`; indexedKey: string; key: string; value: string }) => void, filter?: { node: `0x${string}`; indexedKey: string }) => {
2112
+ return this.publicClient.watchContractEvent({
2113
+ address: this.contractAddress,
2114
+ abi: PublicResolver_jsonAbi,
2115
+ eventName: 'TextChanged',
2116
+ args: filter,
2117
+ onLogs: (logs: any[]) => {
2118
+ logs.forEach((log: any) => {
2119
+ callback(log.args as any);
2120
+ });
2121
+ },
2122
+ }) as () => void;
2123
+ },
2124
+ /**
2125
+ * Watch VersionChanged events
2126
+ * @param callback Function to call when event is emitted
2127
+ * @param filter Optional filter for indexed parameters
2128
+ * @returns Unwatch function to stop listening
2129
+ */
2130
+ VersionChanged: (callback: (event: { node: `0x${string}`; newVersion: bigint }) => void, filter?: { node: `0x${string}` }) => {
2131
+ return this.publicClient.watchContractEvent({
2132
+ address: this.contractAddress,
2133
+ abi: PublicResolver_jsonAbi,
2134
+ eventName: 'VersionChanged',
2135
+ args: filter,
2136
+ onLogs: (logs: any[]) => {
2137
+ logs.forEach((log: any) => {
2138
+ callback(log.args as any);
2139
+ });
2140
+ },
2141
+ }) as () => void;
2142
+ }
2143
+ };
2144
+ }
2145
+ }