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