@gitmyabi/nounsdaoexecutor 1.0.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,1478 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * NounsDAOExecutorV2_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const NounsDAOExecutorV2_jsonAbi = [
10
+ {
11
+ "inputs": [],
12
+ "stateMutability": "nonpayable",
13
+ "type": "constructor"
14
+ },
15
+ {
16
+ "anonymous": false,
17
+ "inputs": [
18
+ {
19
+ "indexed": false,
20
+ "internalType": "address",
21
+ "name": "previousAdmin",
22
+ "type": "address"
23
+ },
24
+ {
25
+ "indexed": false,
26
+ "internalType": "address",
27
+ "name": "newAdmin",
28
+ "type": "address"
29
+ }
30
+ ],
31
+ "name": "AdminChanged",
32
+ "type": "event"
33
+ },
34
+ {
35
+ "anonymous": false,
36
+ "inputs": [
37
+ {
38
+ "indexed": true,
39
+ "internalType": "address",
40
+ "name": "beacon",
41
+ "type": "address"
42
+ }
43
+ ],
44
+ "name": "BeaconUpgraded",
45
+ "type": "event"
46
+ },
47
+ {
48
+ "anonymous": false,
49
+ "inputs": [
50
+ {
51
+ "indexed": true,
52
+ "internalType": "bytes32",
53
+ "name": "txHash",
54
+ "type": "bytes32"
55
+ },
56
+ {
57
+ "indexed": true,
58
+ "internalType": "address",
59
+ "name": "target",
60
+ "type": "address"
61
+ },
62
+ {
63
+ "indexed": false,
64
+ "internalType": "uint256",
65
+ "name": "value",
66
+ "type": "uint256"
67
+ },
68
+ {
69
+ "indexed": false,
70
+ "internalType": "string",
71
+ "name": "signature",
72
+ "type": "string"
73
+ },
74
+ {
75
+ "indexed": false,
76
+ "internalType": "bytes",
77
+ "name": "data",
78
+ "type": "bytes"
79
+ },
80
+ {
81
+ "indexed": false,
82
+ "internalType": "uint256",
83
+ "name": "eta",
84
+ "type": "uint256"
85
+ }
86
+ ],
87
+ "name": "CancelTransaction",
88
+ "type": "event"
89
+ },
90
+ {
91
+ "anonymous": false,
92
+ "inputs": [
93
+ {
94
+ "indexed": true,
95
+ "internalType": "address",
96
+ "name": "to",
97
+ "type": "address"
98
+ },
99
+ {
100
+ "indexed": true,
101
+ "internalType": "address",
102
+ "name": "erc20Token",
103
+ "type": "address"
104
+ },
105
+ {
106
+ "indexed": false,
107
+ "internalType": "uint256",
108
+ "name": "amount",
109
+ "type": "uint256"
110
+ }
111
+ ],
112
+ "name": "ERC20Sent",
113
+ "type": "event"
114
+ },
115
+ {
116
+ "anonymous": false,
117
+ "inputs": [
118
+ {
119
+ "indexed": true,
120
+ "internalType": "address",
121
+ "name": "to",
122
+ "type": "address"
123
+ },
124
+ {
125
+ "indexed": false,
126
+ "internalType": "uint256",
127
+ "name": "amount",
128
+ "type": "uint256"
129
+ }
130
+ ],
131
+ "name": "ETHSent",
132
+ "type": "event"
133
+ },
134
+ {
135
+ "anonymous": false,
136
+ "inputs": [
137
+ {
138
+ "indexed": true,
139
+ "internalType": "bytes32",
140
+ "name": "txHash",
141
+ "type": "bytes32"
142
+ },
143
+ {
144
+ "indexed": true,
145
+ "internalType": "address",
146
+ "name": "target",
147
+ "type": "address"
148
+ },
149
+ {
150
+ "indexed": false,
151
+ "internalType": "uint256",
152
+ "name": "value",
153
+ "type": "uint256"
154
+ },
155
+ {
156
+ "indexed": false,
157
+ "internalType": "string",
158
+ "name": "signature",
159
+ "type": "string"
160
+ },
161
+ {
162
+ "indexed": false,
163
+ "internalType": "bytes",
164
+ "name": "data",
165
+ "type": "bytes"
166
+ },
167
+ {
168
+ "indexed": false,
169
+ "internalType": "uint256",
170
+ "name": "eta",
171
+ "type": "uint256"
172
+ }
173
+ ],
174
+ "name": "ExecuteTransaction",
175
+ "type": "event"
176
+ },
177
+ {
178
+ "anonymous": false,
179
+ "inputs": [
180
+ {
181
+ "indexed": true,
182
+ "internalType": "address",
183
+ "name": "newAdmin",
184
+ "type": "address"
185
+ }
186
+ ],
187
+ "name": "NewAdmin",
188
+ "type": "event"
189
+ },
190
+ {
191
+ "anonymous": false,
192
+ "inputs": [
193
+ {
194
+ "indexed": true,
195
+ "internalType": "uint256",
196
+ "name": "newDelay",
197
+ "type": "uint256"
198
+ }
199
+ ],
200
+ "name": "NewDelay",
201
+ "type": "event"
202
+ },
203
+ {
204
+ "anonymous": false,
205
+ "inputs": [
206
+ {
207
+ "indexed": true,
208
+ "internalType": "address",
209
+ "name": "newPendingAdmin",
210
+ "type": "address"
211
+ }
212
+ ],
213
+ "name": "NewPendingAdmin",
214
+ "type": "event"
215
+ },
216
+ {
217
+ "anonymous": false,
218
+ "inputs": [
219
+ {
220
+ "indexed": true,
221
+ "internalType": "bytes32",
222
+ "name": "txHash",
223
+ "type": "bytes32"
224
+ },
225
+ {
226
+ "indexed": true,
227
+ "internalType": "address",
228
+ "name": "target",
229
+ "type": "address"
230
+ },
231
+ {
232
+ "indexed": false,
233
+ "internalType": "uint256",
234
+ "name": "value",
235
+ "type": "uint256"
236
+ },
237
+ {
238
+ "indexed": false,
239
+ "internalType": "string",
240
+ "name": "signature",
241
+ "type": "string"
242
+ },
243
+ {
244
+ "indexed": false,
245
+ "internalType": "bytes",
246
+ "name": "data",
247
+ "type": "bytes"
248
+ },
249
+ {
250
+ "indexed": false,
251
+ "internalType": "uint256",
252
+ "name": "eta",
253
+ "type": "uint256"
254
+ }
255
+ ],
256
+ "name": "QueueTransaction",
257
+ "type": "event"
258
+ },
259
+ {
260
+ "anonymous": false,
261
+ "inputs": [
262
+ {
263
+ "indexed": true,
264
+ "internalType": "address",
265
+ "name": "implementation",
266
+ "type": "address"
267
+ }
268
+ ],
269
+ "name": "Upgraded",
270
+ "type": "event"
271
+ },
272
+ {
273
+ "stateMutability": "payable",
274
+ "type": "fallback"
275
+ },
276
+ {
277
+ "inputs": [],
278
+ "name": "GRACE_PERIOD",
279
+ "outputs": [
280
+ {
281
+ "internalType": "uint256",
282
+ "name": "",
283
+ "type": "uint256"
284
+ }
285
+ ],
286
+ "stateMutability": "view",
287
+ "type": "function"
288
+ },
289
+ {
290
+ "inputs": [],
291
+ "name": "MAXIMUM_DELAY",
292
+ "outputs": [
293
+ {
294
+ "internalType": "uint256",
295
+ "name": "",
296
+ "type": "uint256"
297
+ }
298
+ ],
299
+ "stateMutability": "view",
300
+ "type": "function"
301
+ },
302
+ {
303
+ "inputs": [],
304
+ "name": "MINIMUM_DELAY",
305
+ "outputs": [
306
+ {
307
+ "internalType": "uint256",
308
+ "name": "",
309
+ "type": "uint256"
310
+ }
311
+ ],
312
+ "stateMutability": "view",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "inputs": [],
317
+ "name": "NAME",
318
+ "outputs": [
319
+ {
320
+ "internalType": "string",
321
+ "name": "",
322
+ "type": "string"
323
+ }
324
+ ],
325
+ "stateMutability": "view",
326
+ "type": "function"
327
+ },
328
+ {
329
+ "inputs": [],
330
+ "name": "acceptAdmin",
331
+ "outputs": [],
332
+ "stateMutability": "nonpayable",
333
+ "type": "function"
334
+ },
335
+ {
336
+ "inputs": [],
337
+ "name": "admin",
338
+ "outputs": [
339
+ {
340
+ "internalType": "address",
341
+ "name": "",
342
+ "type": "address"
343
+ }
344
+ ],
345
+ "stateMutability": "view",
346
+ "type": "function"
347
+ },
348
+ {
349
+ "inputs": [
350
+ {
351
+ "internalType": "address",
352
+ "name": "target",
353
+ "type": "address"
354
+ },
355
+ {
356
+ "internalType": "uint256",
357
+ "name": "value",
358
+ "type": "uint256"
359
+ },
360
+ {
361
+ "internalType": "string",
362
+ "name": "signature",
363
+ "type": "string"
364
+ },
365
+ {
366
+ "internalType": "bytes",
367
+ "name": "data",
368
+ "type": "bytes"
369
+ },
370
+ {
371
+ "internalType": "uint256",
372
+ "name": "eta",
373
+ "type": "uint256"
374
+ }
375
+ ],
376
+ "name": "cancelTransaction",
377
+ "outputs": [],
378
+ "stateMutability": "nonpayable",
379
+ "type": "function"
380
+ },
381
+ {
382
+ "inputs": [],
383
+ "name": "delay",
384
+ "outputs": [
385
+ {
386
+ "internalType": "uint256",
387
+ "name": "",
388
+ "type": "uint256"
389
+ }
390
+ ],
391
+ "stateMutability": "view",
392
+ "type": "function"
393
+ },
394
+ {
395
+ "inputs": [
396
+ {
397
+ "internalType": "address",
398
+ "name": "target",
399
+ "type": "address"
400
+ },
401
+ {
402
+ "internalType": "uint256",
403
+ "name": "value",
404
+ "type": "uint256"
405
+ },
406
+ {
407
+ "internalType": "string",
408
+ "name": "signature",
409
+ "type": "string"
410
+ },
411
+ {
412
+ "internalType": "bytes",
413
+ "name": "data",
414
+ "type": "bytes"
415
+ },
416
+ {
417
+ "internalType": "uint256",
418
+ "name": "eta",
419
+ "type": "uint256"
420
+ }
421
+ ],
422
+ "name": "executeTransaction",
423
+ "outputs": [
424
+ {
425
+ "internalType": "bytes",
426
+ "name": "",
427
+ "type": "bytes"
428
+ }
429
+ ],
430
+ "stateMutability": "nonpayable",
431
+ "type": "function"
432
+ },
433
+ {
434
+ "inputs": [
435
+ {
436
+ "internalType": "address",
437
+ "name": "admin_",
438
+ "type": "address"
439
+ },
440
+ {
441
+ "internalType": "uint256",
442
+ "name": "delay_",
443
+ "type": "uint256"
444
+ }
445
+ ],
446
+ "name": "initialize",
447
+ "outputs": [],
448
+ "stateMutability": "nonpayable",
449
+ "type": "function"
450
+ },
451
+ {
452
+ "inputs": [],
453
+ "name": "pendingAdmin",
454
+ "outputs": [
455
+ {
456
+ "internalType": "address",
457
+ "name": "",
458
+ "type": "address"
459
+ }
460
+ ],
461
+ "stateMutability": "view",
462
+ "type": "function"
463
+ },
464
+ {
465
+ "inputs": [
466
+ {
467
+ "internalType": "address",
468
+ "name": "target",
469
+ "type": "address"
470
+ },
471
+ {
472
+ "internalType": "uint256",
473
+ "name": "value",
474
+ "type": "uint256"
475
+ },
476
+ {
477
+ "internalType": "string",
478
+ "name": "signature",
479
+ "type": "string"
480
+ },
481
+ {
482
+ "internalType": "bytes",
483
+ "name": "data",
484
+ "type": "bytes"
485
+ },
486
+ {
487
+ "internalType": "uint256",
488
+ "name": "eta",
489
+ "type": "uint256"
490
+ }
491
+ ],
492
+ "name": "queueTransaction",
493
+ "outputs": [
494
+ {
495
+ "internalType": "bytes32",
496
+ "name": "",
497
+ "type": "bytes32"
498
+ }
499
+ ],
500
+ "stateMutability": "nonpayable",
501
+ "type": "function"
502
+ },
503
+ {
504
+ "inputs": [
505
+ {
506
+ "internalType": "bytes32",
507
+ "name": "",
508
+ "type": "bytes32"
509
+ }
510
+ ],
511
+ "name": "queuedTransactions",
512
+ "outputs": [
513
+ {
514
+ "internalType": "bool",
515
+ "name": "",
516
+ "type": "bool"
517
+ }
518
+ ],
519
+ "stateMutability": "view",
520
+ "type": "function"
521
+ },
522
+ {
523
+ "inputs": [
524
+ {
525
+ "internalType": "address",
526
+ "name": "recipient",
527
+ "type": "address"
528
+ },
529
+ {
530
+ "internalType": "address",
531
+ "name": "erc20Token",
532
+ "type": "address"
533
+ },
534
+ {
535
+ "internalType": "uint256",
536
+ "name": "tokensToSend",
537
+ "type": "uint256"
538
+ }
539
+ ],
540
+ "name": "sendERC20",
541
+ "outputs": [],
542
+ "stateMutability": "nonpayable",
543
+ "type": "function"
544
+ },
545
+ {
546
+ "inputs": [
547
+ {
548
+ "internalType": "address payable",
549
+ "name": "recipient",
550
+ "type": "address"
551
+ },
552
+ {
553
+ "internalType": "uint256",
554
+ "name": "ethToSend",
555
+ "type": "uint256"
556
+ }
557
+ ],
558
+ "name": "sendETH",
559
+ "outputs": [],
560
+ "stateMutability": "nonpayable",
561
+ "type": "function"
562
+ },
563
+ {
564
+ "inputs": [
565
+ {
566
+ "internalType": "uint256",
567
+ "name": "delay_",
568
+ "type": "uint256"
569
+ }
570
+ ],
571
+ "name": "setDelay",
572
+ "outputs": [],
573
+ "stateMutability": "nonpayable",
574
+ "type": "function"
575
+ },
576
+ {
577
+ "inputs": [
578
+ {
579
+ "internalType": "address",
580
+ "name": "pendingAdmin_",
581
+ "type": "address"
582
+ }
583
+ ],
584
+ "name": "setPendingAdmin",
585
+ "outputs": [],
586
+ "stateMutability": "nonpayable",
587
+ "type": "function"
588
+ },
589
+ {
590
+ "inputs": [
591
+ {
592
+ "internalType": "address",
593
+ "name": "newImplementation",
594
+ "type": "address"
595
+ }
596
+ ],
597
+ "name": "upgradeTo",
598
+ "outputs": [],
599
+ "stateMutability": "nonpayable",
600
+ "type": "function"
601
+ },
602
+ {
603
+ "inputs": [
604
+ {
605
+ "internalType": "address",
606
+ "name": "newImplementation",
607
+ "type": "address"
608
+ },
609
+ {
610
+ "internalType": "bytes",
611
+ "name": "data",
612
+ "type": "bytes"
613
+ }
614
+ ],
615
+ "name": "upgradeToAndCall",
616
+ "outputs": [],
617
+ "stateMutability": "payable",
618
+ "type": "function"
619
+ },
620
+ {
621
+ "stateMutability": "payable",
622
+ "type": "receive"
623
+ }
624
+ ] as const satisfies Abi;
625
+
626
+ /**
627
+ * Type-safe ABI for NounsDAOExecutorV2_json
628
+ */
629
+ export type NounsDAOExecutorV2_jsonAbi = typeof NounsDAOExecutorV2_jsonAbi;
630
+
631
+ /**
632
+ * Contract instance type for NounsDAOExecutorV2_json
633
+ */
634
+ // Use any for contract type to avoid complex viem type issues
635
+ // The runtime behavior is type-safe through viem's ABI typing
636
+ export type NounsDAOExecutorV2_jsonContract = any;
637
+
638
+ /**
639
+ * NounsDAOExecutorV2_json Contract Class
640
+ *
641
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
642
+ *
643
+ * @example
644
+ * ```typescript
645
+ * import { createPublicClient, createWalletClient, http } from 'viem';
646
+ * import { mainnet } from 'viem/chains';
647
+ * import { NounsDAOExecutorV2_json } from 'NounsDAOExecutorV2_json';
648
+ *
649
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
650
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
651
+ *
652
+ * const contract = new NounsDAOExecutorV2_json('0x...', { publicClient, walletClient });
653
+ *
654
+ * // Read functions
655
+ * const result = await contract.balanceOf('0x...');
656
+ *
657
+ * // Write functions
658
+ * const hash = await contract.transfer('0x...', 1000n);
659
+ *
660
+ * // Simulate transactions (dry-run)
661
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
662
+ * console.log('Gas estimate:', simulation.request.gas);
663
+ *
664
+ * // Watch events
665
+ * const unwatch = contract.watch.Transfer((event) => {
666
+ * console.log('Transfer event:', event);
667
+ * });
668
+ * ```
669
+ */
670
+ export class NounsDAOExecutorV2_json {
671
+ private contract: NounsDAOExecutorV2_jsonContract;
672
+ private contractAddress: Address;
673
+ private publicClient: PublicClient;
674
+
675
+ constructor(
676
+ address: Address,
677
+ clients: {
678
+ publicClient: PublicClient;
679
+ walletClient?: WalletClient;
680
+ }
681
+ ) {
682
+ this.contractAddress = address;
683
+ this.publicClient = clients.publicClient;
684
+ this.contract = getContract({
685
+ address,
686
+ abi: NounsDAOExecutorV2_jsonAbi,
687
+ client: {
688
+ public: clients.publicClient,
689
+ wallet: clients.walletClient,
690
+ },
691
+ });
692
+ }
693
+
694
+ /**
695
+ * Get the contract address
696
+ */
697
+ get address(): Address {
698
+ return this.contractAddress;
699
+ }
700
+
701
+ /**
702
+ * Get the underlying viem contract instance
703
+ */
704
+ getContract(): NounsDAOExecutorV2_jsonContract {
705
+ return this.contract;
706
+ }
707
+
708
+ /**
709
+ * GRACE_PERIOD
710
+ * view
711
+ */
712
+ async GRACE_PERIOD(): Promise<bigint> {
713
+ return this.contract.read.GRACE_PERIOD() as Promise<bigint>;
714
+ }
715
+
716
+ /**
717
+ * MAXIMUM_DELAY
718
+ * view
719
+ */
720
+ async MAXIMUM_DELAY(): Promise<bigint> {
721
+ return this.contract.read.MAXIMUM_DELAY() as Promise<bigint>;
722
+ }
723
+
724
+ /**
725
+ * MINIMUM_DELAY
726
+ * view
727
+ */
728
+ async MINIMUM_DELAY(): Promise<bigint> {
729
+ return this.contract.read.MINIMUM_DELAY() as Promise<bigint>;
730
+ }
731
+
732
+ /**
733
+ * NAME
734
+ * view
735
+ */
736
+ async NAME(): Promise<string> {
737
+ return this.contract.read.NAME() as Promise<string>;
738
+ }
739
+
740
+ /**
741
+ * admin
742
+ * view
743
+ */
744
+ async admin(): Promise<`0x${string}`> {
745
+ return this.contract.read.admin() as Promise<`0x${string}`>;
746
+ }
747
+
748
+ /**
749
+ * delay
750
+ * view
751
+ */
752
+ async delay(): Promise<bigint> {
753
+ return this.contract.read.delay() as Promise<bigint>;
754
+ }
755
+
756
+ /**
757
+ * pendingAdmin
758
+ * view
759
+ */
760
+ async pendingAdmin(): Promise<`0x${string}`> {
761
+ return this.contract.read.pendingAdmin() as Promise<`0x${string}`>;
762
+ }
763
+
764
+ /**
765
+ * queuedTransactions
766
+ * view
767
+ */
768
+ async queuedTransactions(arg0: `0x${string}`): Promise<boolean> {
769
+ return this.contract.read.queuedTransactions([arg0] as const) as Promise<boolean>;
770
+ }
771
+
772
+ /**
773
+ * acceptAdmin
774
+ * nonpayable
775
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
776
+ */
777
+ async acceptAdmin(options?: {
778
+ accessList?: import('viem').AccessList;
779
+ authorizationList?: import('viem').AuthorizationList;
780
+ chain?: import('viem').Chain | null;
781
+ dataSuffix?: `0x${string}`;
782
+ gas?: bigint;
783
+ gasPrice?: bigint;
784
+ maxFeePerGas?: bigint;
785
+ maxPriorityFeePerGas?: bigint;
786
+ nonce?: number;
787
+ value?: bigint;
788
+ }): Promise<`0x${string}`> {
789
+ if (!this.contract.write) {
790
+ throw new Error('Wallet client is required for write operations');
791
+ }
792
+ return this.contract.write.acceptAdmin(options) as Promise<`0x${string}`>;
793
+ }
794
+
795
+ /**
796
+ * cancelTransaction
797
+ * nonpayable
798
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
799
+ */
800
+ async cancelTransaction(target: `0x${string}`, value: bigint, signature: string, data: `0x${string}`, eta: bigint, options?: {
801
+ accessList?: import('viem').AccessList;
802
+ authorizationList?: import('viem').AuthorizationList;
803
+ chain?: import('viem').Chain | null;
804
+ dataSuffix?: `0x${string}`;
805
+ gas?: bigint;
806
+ gasPrice?: bigint;
807
+ maxFeePerGas?: bigint;
808
+ maxPriorityFeePerGas?: bigint;
809
+ nonce?: number;
810
+ value?: bigint;
811
+ }): Promise<`0x${string}`> {
812
+ if (!this.contract.write) {
813
+ throw new Error('Wallet client is required for write operations');
814
+ }
815
+ return this.contract.write.cancelTransaction([target, value, signature, data, eta] as const, options) as Promise<`0x${string}`>;
816
+ }
817
+
818
+ /**
819
+ * executeTransaction
820
+ * nonpayable
821
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
822
+ */
823
+ async executeTransaction(target: `0x${string}`, value: bigint, signature: string, data: `0x${string}`, eta: bigint, options?: {
824
+ accessList?: import('viem').AccessList;
825
+ authorizationList?: import('viem').AuthorizationList;
826
+ chain?: import('viem').Chain | null;
827
+ dataSuffix?: `0x${string}`;
828
+ gas?: bigint;
829
+ gasPrice?: bigint;
830
+ maxFeePerGas?: bigint;
831
+ maxPriorityFeePerGas?: bigint;
832
+ nonce?: number;
833
+ value?: bigint;
834
+ }): Promise<`0x${string}`> {
835
+ if (!this.contract.write) {
836
+ throw new Error('Wallet client is required for write operations');
837
+ }
838
+ return this.contract.write.executeTransaction([target, value, signature, data, eta] as const, options) as Promise<`0x${string}`>;
839
+ }
840
+
841
+ /**
842
+ * initialize
843
+ * nonpayable
844
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
845
+ */
846
+ async initialize(admin_: `0x${string}`, delay_: bigint, options?: {
847
+ accessList?: import('viem').AccessList;
848
+ authorizationList?: import('viem').AuthorizationList;
849
+ chain?: import('viem').Chain | null;
850
+ dataSuffix?: `0x${string}`;
851
+ gas?: bigint;
852
+ gasPrice?: bigint;
853
+ maxFeePerGas?: bigint;
854
+ maxPriorityFeePerGas?: bigint;
855
+ nonce?: number;
856
+ value?: bigint;
857
+ }): Promise<`0x${string}`> {
858
+ if (!this.contract.write) {
859
+ throw new Error('Wallet client is required for write operations');
860
+ }
861
+ return this.contract.write.initialize([admin_, delay_] as const, options) as Promise<`0x${string}`>;
862
+ }
863
+
864
+ /**
865
+ * queueTransaction
866
+ * nonpayable
867
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
868
+ */
869
+ async queueTransaction(target: `0x${string}`, value: bigint, signature: string, data: `0x${string}`, eta: bigint, options?: {
870
+ accessList?: import('viem').AccessList;
871
+ authorizationList?: import('viem').AuthorizationList;
872
+ chain?: import('viem').Chain | null;
873
+ dataSuffix?: `0x${string}`;
874
+ gas?: bigint;
875
+ gasPrice?: bigint;
876
+ maxFeePerGas?: bigint;
877
+ maxPriorityFeePerGas?: bigint;
878
+ nonce?: number;
879
+ value?: bigint;
880
+ }): Promise<`0x${string}`> {
881
+ if (!this.contract.write) {
882
+ throw new Error('Wallet client is required for write operations');
883
+ }
884
+ return this.contract.write.queueTransaction([target, value, signature, data, eta] as const, options) as Promise<`0x${string}`>;
885
+ }
886
+
887
+ /**
888
+ * sendERC20
889
+ * nonpayable
890
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
891
+ */
892
+ async sendERC20(recipient: `0x${string}`, erc20Token: `0x${string}`, tokensToSend: bigint, options?: {
893
+ accessList?: import('viem').AccessList;
894
+ authorizationList?: import('viem').AuthorizationList;
895
+ chain?: import('viem').Chain | null;
896
+ dataSuffix?: `0x${string}`;
897
+ gas?: bigint;
898
+ gasPrice?: bigint;
899
+ maxFeePerGas?: bigint;
900
+ maxPriorityFeePerGas?: bigint;
901
+ nonce?: number;
902
+ value?: bigint;
903
+ }): Promise<`0x${string}`> {
904
+ if (!this.contract.write) {
905
+ throw new Error('Wallet client is required for write operations');
906
+ }
907
+ return this.contract.write.sendERC20([recipient, erc20Token, tokensToSend] as const, options) as Promise<`0x${string}`>;
908
+ }
909
+
910
+ /**
911
+ * sendETH
912
+ * nonpayable
913
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
914
+ */
915
+ async sendETH(recipient: `0x${string}`, ethToSend: bigint, options?: {
916
+ accessList?: import('viem').AccessList;
917
+ authorizationList?: import('viem').AuthorizationList;
918
+ chain?: import('viem').Chain | null;
919
+ dataSuffix?: `0x${string}`;
920
+ gas?: bigint;
921
+ gasPrice?: bigint;
922
+ maxFeePerGas?: bigint;
923
+ maxPriorityFeePerGas?: bigint;
924
+ nonce?: number;
925
+ value?: bigint;
926
+ }): Promise<`0x${string}`> {
927
+ if (!this.contract.write) {
928
+ throw new Error('Wallet client is required for write operations');
929
+ }
930
+ return this.contract.write.sendETH([recipient, ethToSend] as const, options) as Promise<`0x${string}`>;
931
+ }
932
+
933
+ /**
934
+ * setDelay
935
+ * nonpayable
936
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
937
+ */
938
+ async setDelay(delay_: bigint, options?: {
939
+ accessList?: import('viem').AccessList;
940
+ authorizationList?: import('viem').AuthorizationList;
941
+ chain?: import('viem').Chain | null;
942
+ dataSuffix?: `0x${string}`;
943
+ gas?: bigint;
944
+ gasPrice?: bigint;
945
+ maxFeePerGas?: bigint;
946
+ maxPriorityFeePerGas?: bigint;
947
+ nonce?: number;
948
+ value?: bigint;
949
+ }): Promise<`0x${string}`> {
950
+ if (!this.contract.write) {
951
+ throw new Error('Wallet client is required for write operations');
952
+ }
953
+ return this.contract.write.setDelay([delay_] as const, options) as Promise<`0x${string}`>;
954
+ }
955
+
956
+ /**
957
+ * setPendingAdmin
958
+ * nonpayable
959
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
960
+ */
961
+ async setPendingAdmin(pendingAdmin_: `0x${string}`, options?: {
962
+ accessList?: import('viem').AccessList;
963
+ authorizationList?: import('viem').AuthorizationList;
964
+ chain?: import('viem').Chain | null;
965
+ dataSuffix?: `0x${string}`;
966
+ gas?: bigint;
967
+ gasPrice?: bigint;
968
+ maxFeePerGas?: bigint;
969
+ maxPriorityFeePerGas?: bigint;
970
+ nonce?: number;
971
+ value?: bigint;
972
+ }): Promise<`0x${string}`> {
973
+ if (!this.contract.write) {
974
+ throw new Error('Wallet client is required for write operations');
975
+ }
976
+ return this.contract.write.setPendingAdmin([pendingAdmin_] as const, options) as Promise<`0x${string}`>;
977
+ }
978
+
979
+ /**
980
+ * upgradeTo
981
+ * nonpayable
982
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
983
+ */
984
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
985
+ accessList?: import('viem').AccessList;
986
+ authorizationList?: import('viem').AuthorizationList;
987
+ chain?: import('viem').Chain | null;
988
+ dataSuffix?: `0x${string}`;
989
+ gas?: bigint;
990
+ gasPrice?: bigint;
991
+ maxFeePerGas?: bigint;
992
+ maxPriorityFeePerGas?: bigint;
993
+ nonce?: number;
994
+ value?: bigint;
995
+ }): Promise<`0x${string}`> {
996
+ if (!this.contract.write) {
997
+ throw new Error('Wallet client is required for write operations');
998
+ }
999
+ return this.contract.write.upgradeTo([newImplementation] as const, options) as Promise<`0x${string}`>;
1000
+ }
1001
+
1002
+ /**
1003
+ * upgradeToAndCall
1004
+ * payable
1005
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1006
+ */
1007
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1008
+ accessList?: import('viem').AccessList;
1009
+ authorizationList?: import('viem').AuthorizationList;
1010
+ chain?: import('viem').Chain | null;
1011
+ dataSuffix?: `0x${string}`;
1012
+ gas?: bigint;
1013
+ gasPrice?: bigint;
1014
+ maxFeePerGas?: bigint;
1015
+ maxPriorityFeePerGas?: bigint;
1016
+ nonce?: number;
1017
+ value?: bigint;
1018
+ }): Promise<`0x${string}`> {
1019
+ if (!this.contract.write) {
1020
+ throw new Error('Wallet client is required for write operations');
1021
+ }
1022
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
1023
+ }
1024
+
1025
+
1026
+
1027
+ /**
1028
+ * Simulate contract write operations (dry-run without sending transaction)
1029
+ *
1030
+ * @example
1031
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1032
+ * console.log('Gas estimate:', result.request.gas);
1033
+ * console.log('Would succeed:', result.result);
1034
+ */
1035
+ get simulate() {
1036
+ const contract = this.contract;
1037
+ if (!contract.simulate) {
1038
+ throw new Error('Public client is required for simulation');
1039
+ }
1040
+ return {
1041
+ /**
1042
+ * Simulate acceptAdmin
1043
+ * Returns gas estimate and result without sending transaction
1044
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1045
+ */
1046
+ async acceptAdmin(options?: {
1047
+ accessList?: import('viem').AccessList;
1048
+ authorizationList?: import('viem').AuthorizationList;
1049
+ chain?: import('viem').Chain | null;
1050
+ dataSuffix?: `0x${string}`;
1051
+ gas?: bigint;
1052
+ gasPrice?: bigint;
1053
+ maxFeePerGas?: bigint;
1054
+ maxPriorityFeePerGas?: bigint;
1055
+ nonce?: number;
1056
+ value?: bigint;
1057
+ }): Promise<void> {
1058
+ return contract.simulate.acceptAdmin(options) as Promise<void>;
1059
+ },
1060
+ /**
1061
+ * Simulate cancelTransaction
1062
+ * Returns gas estimate and result without sending transaction
1063
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1064
+ */
1065
+ async cancelTransaction(target: `0x${string}`, value: bigint, signature: string, data: `0x${string}`, eta: bigint, options?: {
1066
+ accessList?: import('viem').AccessList;
1067
+ authorizationList?: import('viem').AuthorizationList;
1068
+ chain?: import('viem').Chain | null;
1069
+ dataSuffix?: `0x${string}`;
1070
+ gas?: bigint;
1071
+ gasPrice?: bigint;
1072
+ maxFeePerGas?: bigint;
1073
+ maxPriorityFeePerGas?: bigint;
1074
+ nonce?: number;
1075
+ value?: bigint;
1076
+ }): Promise<void> {
1077
+ return contract.simulate.cancelTransaction([target, value, signature, data, eta] as const, options) as Promise<void>;
1078
+ },
1079
+ /**
1080
+ * Simulate executeTransaction
1081
+ * Returns gas estimate and result without sending transaction
1082
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1083
+ */
1084
+ async executeTransaction(target: `0x${string}`, value: bigint, signature: string, data: `0x${string}`, eta: bigint, options?: {
1085
+ accessList?: import('viem').AccessList;
1086
+ authorizationList?: import('viem').AuthorizationList;
1087
+ chain?: import('viem').Chain | null;
1088
+ dataSuffix?: `0x${string}`;
1089
+ gas?: bigint;
1090
+ gasPrice?: bigint;
1091
+ maxFeePerGas?: bigint;
1092
+ maxPriorityFeePerGas?: bigint;
1093
+ nonce?: number;
1094
+ value?: bigint;
1095
+ }): Promise<`0x${string}`> {
1096
+ return contract.simulate.executeTransaction([target, value, signature, data, eta] as const, options) as Promise<`0x${string}`>;
1097
+ },
1098
+ /**
1099
+ * Simulate initialize
1100
+ * Returns gas estimate and result without sending transaction
1101
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1102
+ */
1103
+ async initialize(admin_: `0x${string}`, delay_: bigint, options?: {
1104
+ accessList?: import('viem').AccessList;
1105
+ authorizationList?: import('viem').AuthorizationList;
1106
+ chain?: import('viem').Chain | null;
1107
+ dataSuffix?: `0x${string}`;
1108
+ gas?: bigint;
1109
+ gasPrice?: bigint;
1110
+ maxFeePerGas?: bigint;
1111
+ maxPriorityFeePerGas?: bigint;
1112
+ nonce?: number;
1113
+ value?: bigint;
1114
+ }): Promise<void> {
1115
+ return contract.simulate.initialize([admin_, delay_] as const, options) as Promise<void>;
1116
+ },
1117
+ /**
1118
+ * Simulate queueTransaction
1119
+ * Returns gas estimate and result without sending transaction
1120
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1121
+ */
1122
+ async queueTransaction(target: `0x${string}`, value: bigint, signature: string, data: `0x${string}`, eta: bigint, options?: {
1123
+ accessList?: import('viem').AccessList;
1124
+ authorizationList?: import('viem').AuthorizationList;
1125
+ chain?: import('viem').Chain | null;
1126
+ dataSuffix?: `0x${string}`;
1127
+ gas?: bigint;
1128
+ gasPrice?: bigint;
1129
+ maxFeePerGas?: bigint;
1130
+ maxPriorityFeePerGas?: bigint;
1131
+ nonce?: number;
1132
+ value?: bigint;
1133
+ }): Promise<`0x${string}`> {
1134
+ return contract.simulate.queueTransaction([target, value, signature, data, eta] as const, options) as Promise<`0x${string}`>;
1135
+ },
1136
+ /**
1137
+ * Simulate sendERC20
1138
+ * Returns gas estimate and result without sending transaction
1139
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1140
+ */
1141
+ async sendERC20(recipient: `0x${string}`, erc20Token: `0x${string}`, tokensToSend: bigint, options?: {
1142
+ accessList?: import('viem').AccessList;
1143
+ authorizationList?: import('viem').AuthorizationList;
1144
+ chain?: import('viem').Chain | null;
1145
+ dataSuffix?: `0x${string}`;
1146
+ gas?: bigint;
1147
+ gasPrice?: bigint;
1148
+ maxFeePerGas?: bigint;
1149
+ maxPriorityFeePerGas?: bigint;
1150
+ nonce?: number;
1151
+ value?: bigint;
1152
+ }): Promise<void> {
1153
+ return contract.simulate.sendERC20([recipient, erc20Token, tokensToSend] as const, options) as Promise<void>;
1154
+ },
1155
+ /**
1156
+ * Simulate sendETH
1157
+ * Returns gas estimate and result without sending transaction
1158
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1159
+ */
1160
+ async sendETH(recipient: `0x${string}`, ethToSend: bigint, options?: {
1161
+ accessList?: import('viem').AccessList;
1162
+ authorizationList?: import('viem').AuthorizationList;
1163
+ chain?: import('viem').Chain | null;
1164
+ dataSuffix?: `0x${string}`;
1165
+ gas?: bigint;
1166
+ gasPrice?: bigint;
1167
+ maxFeePerGas?: bigint;
1168
+ maxPriorityFeePerGas?: bigint;
1169
+ nonce?: number;
1170
+ value?: bigint;
1171
+ }): Promise<void> {
1172
+ return contract.simulate.sendETH([recipient, ethToSend] as const, options) as Promise<void>;
1173
+ },
1174
+ /**
1175
+ * Simulate setDelay
1176
+ * Returns gas estimate and result without sending transaction
1177
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1178
+ */
1179
+ async setDelay(delay_: bigint, options?: {
1180
+ accessList?: import('viem').AccessList;
1181
+ authorizationList?: import('viem').AuthorizationList;
1182
+ chain?: import('viem').Chain | null;
1183
+ dataSuffix?: `0x${string}`;
1184
+ gas?: bigint;
1185
+ gasPrice?: bigint;
1186
+ maxFeePerGas?: bigint;
1187
+ maxPriorityFeePerGas?: bigint;
1188
+ nonce?: number;
1189
+ value?: bigint;
1190
+ }): Promise<void> {
1191
+ return contract.simulate.setDelay([delay_] as const, options) as Promise<void>;
1192
+ },
1193
+ /**
1194
+ * Simulate setPendingAdmin
1195
+ * Returns gas estimate and result without sending transaction
1196
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1197
+ */
1198
+ async setPendingAdmin(pendingAdmin_: `0x${string}`, options?: {
1199
+ accessList?: import('viem').AccessList;
1200
+ authorizationList?: import('viem').AuthorizationList;
1201
+ chain?: import('viem').Chain | null;
1202
+ dataSuffix?: `0x${string}`;
1203
+ gas?: bigint;
1204
+ gasPrice?: bigint;
1205
+ maxFeePerGas?: bigint;
1206
+ maxPriorityFeePerGas?: bigint;
1207
+ nonce?: number;
1208
+ value?: bigint;
1209
+ }): Promise<void> {
1210
+ return contract.simulate.setPendingAdmin([pendingAdmin_] as const, options) as Promise<void>;
1211
+ },
1212
+ /**
1213
+ * Simulate upgradeTo
1214
+ * Returns gas estimate and result without sending transaction
1215
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1216
+ */
1217
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
1218
+ accessList?: import('viem').AccessList;
1219
+ authorizationList?: import('viem').AuthorizationList;
1220
+ chain?: import('viem').Chain | null;
1221
+ dataSuffix?: `0x${string}`;
1222
+ gas?: bigint;
1223
+ gasPrice?: bigint;
1224
+ maxFeePerGas?: bigint;
1225
+ maxPriorityFeePerGas?: bigint;
1226
+ nonce?: number;
1227
+ value?: bigint;
1228
+ }): Promise<void> {
1229
+ return contract.simulate.upgradeTo([newImplementation] as const, options) as Promise<void>;
1230
+ },
1231
+ /**
1232
+ * Simulate upgradeToAndCall
1233
+ * Returns gas estimate and result without sending transaction
1234
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1235
+ */
1236
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1237
+ accessList?: import('viem').AccessList;
1238
+ authorizationList?: import('viem').AuthorizationList;
1239
+ chain?: import('viem').Chain | null;
1240
+ dataSuffix?: `0x${string}`;
1241
+ gas?: bigint;
1242
+ gasPrice?: bigint;
1243
+ maxFeePerGas?: bigint;
1244
+ maxPriorityFeePerGas?: bigint;
1245
+ nonce?: number;
1246
+ value?: bigint;
1247
+ }): Promise<void> {
1248
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
1249
+ }
1250
+ };
1251
+ }
1252
+
1253
+ /**
1254
+ * Watch contract events
1255
+ *
1256
+ * @example
1257
+ * // Watch all Transfer events
1258
+ * const unwatch = contract.watch.Transfer((event) => {
1259
+ * console.log('Transfer:', event);
1260
+ * });
1261
+ *
1262
+ * // Stop watching
1263
+ * unwatch();
1264
+ */
1265
+ get watch() {
1266
+ return {
1267
+ /**
1268
+ * Watch AdminChanged events
1269
+ * @param callback Function to call when event is emitted
1270
+ * @param filter Optional filter for indexed parameters
1271
+ * @returns Unwatch function to stop listening
1272
+ */
1273
+ AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
1274
+ return this.publicClient.watchContractEvent({
1275
+ address: this.contractAddress,
1276
+ abi: NounsDAOExecutorV2_jsonAbi,
1277
+ eventName: 'AdminChanged',
1278
+
1279
+ onLogs: (logs: any[]) => {
1280
+ logs.forEach((log: any) => {
1281
+ callback(log.args as any);
1282
+ });
1283
+ },
1284
+ }) as () => void;
1285
+ },
1286
+ /**
1287
+ * Watch BeaconUpgraded events
1288
+ * @param callback Function to call when event is emitted
1289
+ * @param filter Optional filter for indexed parameters
1290
+ * @returns Unwatch function to stop listening
1291
+ */
1292
+ BeaconUpgraded: (callback: (event: { beacon: `0x${string}` }) => void, filter?: { beacon: `0x${string}` }) => {
1293
+ return this.publicClient.watchContractEvent({
1294
+ address: this.contractAddress,
1295
+ abi: NounsDAOExecutorV2_jsonAbi,
1296
+ eventName: 'BeaconUpgraded',
1297
+ args: filter,
1298
+ onLogs: (logs: any[]) => {
1299
+ logs.forEach((log: any) => {
1300
+ callback(log.args as any);
1301
+ });
1302
+ },
1303
+ }) as () => void;
1304
+ },
1305
+ /**
1306
+ * Watch CancelTransaction events
1307
+ * @param callback Function to call when event is emitted
1308
+ * @param filter Optional filter for indexed parameters
1309
+ * @returns Unwatch function to stop listening
1310
+ */
1311
+ CancelTransaction: (callback: (event: { txHash: `0x${string}`; target: `0x${string}`; value: bigint; signature: string; data: `0x${string}`; eta: bigint }) => void, filter?: { txHash: `0x${string}`; target: `0x${string}` }) => {
1312
+ return this.publicClient.watchContractEvent({
1313
+ address: this.contractAddress,
1314
+ abi: NounsDAOExecutorV2_jsonAbi,
1315
+ eventName: 'CancelTransaction',
1316
+ args: filter,
1317
+ onLogs: (logs: any[]) => {
1318
+ logs.forEach((log: any) => {
1319
+ callback(log.args as any);
1320
+ });
1321
+ },
1322
+ }) as () => void;
1323
+ },
1324
+ /**
1325
+ * Watch ERC20Sent events
1326
+ * @param callback Function to call when event is emitted
1327
+ * @param filter Optional filter for indexed parameters
1328
+ * @returns Unwatch function to stop listening
1329
+ */
1330
+ ERC20Sent: (callback: (event: { to: `0x${string}`; erc20Token: `0x${string}`; amount: bigint }) => void, filter?: { to: `0x${string}`; erc20Token: `0x${string}` }) => {
1331
+ return this.publicClient.watchContractEvent({
1332
+ address: this.contractAddress,
1333
+ abi: NounsDAOExecutorV2_jsonAbi,
1334
+ eventName: 'ERC20Sent',
1335
+ args: filter,
1336
+ onLogs: (logs: any[]) => {
1337
+ logs.forEach((log: any) => {
1338
+ callback(log.args as any);
1339
+ });
1340
+ },
1341
+ }) as () => void;
1342
+ },
1343
+ /**
1344
+ * Watch ETHSent events
1345
+ * @param callback Function to call when event is emitted
1346
+ * @param filter Optional filter for indexed parameters
1347
+ * @returns Unwatch function to stop listening
1348
+ */
1349
+ ETHSent: (callback: (event: { to: `0x${string}`; amount: bigint }) => void, filter?: { to: `0x${string}` }) => {
1350
+ return this.publicClient.watchContractEvent({
1351
+ address: this.contractAddress,
1352
+ abi: NounsDAOExecutorV2_jsonAbi,
1353
+ eventName: 'ETHSent',
1354
+ args: filter,
1355
+ onLogs: (logs: any[]) => {
1356
+ logs.forEach((log: any) => {
1357
+ callback(log.args as any);
1358
+ });
1359
+ },
1360
+ }) as () => void;
1361
+ },
1362
+ /**
1363
+ * Watch ExecuteTransaction events
1364
+ * @param callback Function to call when event is emitted
1365
+ * @param filter Optional filter for indexed parameters
1366
+ * @returns Unwatch function to stop listening
1367
+ */
1368
+ ExecuteTransaction: (callback: (event: { txHash: `0x${string}`; target: `0x${string}`; value: bigint; signature: string; data: `0x${string}`; eta: bigint }) => void, filter?: { txHash: `0x${string}`; target: `0x${string}` }) => {
1369
+ return this.publicClient.watchContractEvent({
1370
+ address: this.contractAddress,
1371
+ abi: NounsDAOExecutorV2_jsonAbi,
1372
+ eventName: 'ExecuteTransaction',
1373
+ args: filter,
1374
+ onLogs: (logs: any[]) => {
1375
+ logs.forEach((log: any) => {
1376
+ callback(log.args as any);
1377
+ });
1378
+ },
1379
+ }) as () => void;
1380
+ },
1381
+ /**
1382
+ * Watch NewAdmin events
1383
+ * @param callback Function to call when event is emitted
1384
+ * @param filter Optional filter for indexed parameters
1385
+ * @returns Unwatch function to stop listening
1386
+ */
1387
+ NewAdmin: (callback: (event: { newAdmin: `0x${string}` }) => void, filter?: { newAdmin: `0x${string}` }) => {
1388
+ return this.publicClient.watchContractEvent({
1389
+ address: this.contractAddress,
1390
+ abi: NounsDAOExecutorV2_jsonAbi,
1391
+ eventName: 'NewAdmin',
1392
+ args: filter,
1393
+ onLogs: (logs: any[]) => {
1394
+ logs.forEach((log: any) => {
1395
+ callback(log.args as any);
1396
+ });
1397
+ },
1398
+ }) as () => void;
1399
+ },
1400
+ /**
1401
+ * Watch NewDelay events
1402
+ * @param callback Function to call when event is emitted
1403
+ * @param filter Optional filter for indexed parameters
1404
+ * @returns Unwatch function to stop listening
1405
+ */
1406
+ NewDelay: (callback: (event: { newDelay: bigint }) => void, filter?: { newDelay: bigint }) => {
1407
+ return this.publicClient.watchContractEvent({
1408
+ address: this.contractAddress,
1409
+ abi: NounsDAOExecutorV2_jsonAbi,
1410
+ eventName: 'NewDelay',
1411
+ args: filter,
1412
+ onLogs: (logs: any[]) => {
1413
+ logs.forEach((log: any) => {
1414
+ callback(log.args as any);
1415
+ });
1416
+ },
1417
+ }) as () => void;
1418
+ },
1419
+ /**
1420
+ * Watch NewPendingAdmin events
1421
+ * @param callback Function to call when event is emitted
1422
+ * @param filter Optional filter for indexed parameters
1423
+ * @returns Unwatch function to stop listening
1424
+ */
1425
+ NewPendingAdmin: (callback: (event: { newPendingAdmin: `0x${string}` }) => void, filter?: { newPendingAdmin: `0x${string}` }) => {
1426
+ return this.publicClient.watchContractEvent({
1427
+ address: this.contractAddress,
1428
+ abi: NounsDAOExecutorV2_jsonAbi,
1429
+ eventName: 'NewPendingAdmin',
1430
+ args: filter,
1431
+ onLogs: (logs: any[]) => {
1432
+ logs.forEach((log: any) => {
1433
+ callback(log.args as any);
1434
+ });
1435
+ },
1436
+ }) as () => void;
1437
+ },
1438
+ /**
1439
+ * Watch QueueTransaction events
1440
+ * @param callback Function to call when event is emitted
1441
+ * @param filter Optional filter for indexed parameters
1442
+ * @returns Unwatch function to stop listening
1443
+ */
1444
+ QueueTransaction: (callback: (event: { txHash: `0x${string}`; target: `0x${string}`; value: bigint; signature: string; data: `0x${string}`; eta: bigint }) => void, filter?: { txHash: `0x${string}`; target: `0x${string}` }) => {
1445
+ return this.publicClient.watchContractEvent({
1446
+ address: this.contractAddress,
1447
+ abi: NounsDAOExecutorV2_jsonAbi,
1448
+ eventName: 'QueueTransaction',
1449
+ args: filter,
1450
+ onLogs: (logs: any[]) => {
1451
+ logs.forEach((log: any) => {
1452
+ callback(log.args as any);
1453
+ });
1454
+ },
1455
+ }) as () => void;
1456
+ },
1457
+ /**
1458
+ * Watch Upgraded events
1459
+ * @param callback Function to call when event is emitted
1460
+ * @param filter Optional filter for indexed parameters
1461
+ * @returns Unwatch function to stop listening
1462
+ */
1463
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
1464
+ return this.publicClient.watchContractEvent({
1465
+ address: this.contractAddress,
1466
+ abi: NounsDAOExecutorV2_jsonAbi,
1467
+ eventName: 'Upgraded',
1468
+ args: filter,
1469
+ onLogs: (logs: any[]) => {
1470
+ logs.forEach((log: any) => {
1471
+ callback(log.args as any);
1472
+ });
1473
+ },
1474
+ }) as () => void;
1475
+ }
1476
+ };
1477
+ }
1478
+ }