@gitmyabi/elpeth 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,1131 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * TUPProxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const TUPProxy_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "_logic",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "admin_",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "internalType": "bytes",
24
+ "name": "_data",
25
+ "type": "bytes"
26
+ }
27
+ ],
28
+ "stateMutability": "payable",
29
+ "type": "constructor"
30
+ },
31
+ {
32
+ "inputs": [],
33
+ "name": "CallWhenPaused",
34
+ "type": "error"
35
+ },
36
+ {
37
+ "inputs": [
38
+ {
39
+ "internalType": "uint256",
40
+ "name": "providedValue",
41
+ "type": "uint256"
42
+ },
43
+ {
44
+ "internalType": "uint256",
45
+ "name": "minimumValue",
46
+ "type": "uint256"
47
+ }
48
+ ],
49
+ "name": "FreezeTimeoutTooLow",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "inputs": [],
54
+ "name": "Frozen",
55
+ "type": "error"
56
+ },
57
+ {
58
+ "inputs": [
59
+ {
60
+ "internalType": "address",
61
+ "name": "account",
62
+ "type": "address"
63
+ },
64
+ {
65
+ "internalType": "address",
66
+ "name": "expected",
67
+ "type": "address"
68
+ }
69
+ ],
70
+ "name": "Unauthorized",
71
+ "type": "error"
72
+ },
73
+ {
74
+ "anonymous": false,
75
+ "inputs": [
76
+ {
77
+ "indexed": false,
78
+ "internalType": "address",
79
+ "name": "previousAdmin",
80
+ "type": "address"
81
+ },
82
+ {
83
+ "indexed": false,
84
+ "internalType": "address",
85
+ "name": "newAdmin",
86
+ "type": "address"
87
+ }
88
+ ],
89
+ "name": "AdminChanged",
90
+ "type": "event"
91
+ },
92
+ {
93
+ "anonymous": false,
94
+ "inputs": [
95
+ {
96
+ "indexed": true,
97
+ "internalType": "address",
98
+ "name": "beacon",
99
+ "type": "address"
100
+ }
101
+ ],
102
+ "name": "BeaconUpgraded",
103
+ "type": "event"
104
+ },
105
+ {
106
+ "anonymous": false,
107
+ "inputs": [
108
+ {
109
+ "indexed": false,
110
+ "internalType": "address",
111
+ "name": "previousPauser",
112
+ "type": "address"
113
+ },
114
+ {
115
+ "indexed": false,
116
+ "internalType": "address",
117
+ "name": "newPauser",
118
+ "type": "address"
119
+ }
120
+ ],
121
+ "name": "PauserChanged",
122
+ "type": "event"
123
+ },
124
+ {
125
+ "anonymous": false,
126
+ "inputs": [
127
+ {
128
+ "indexed": false,
129
+ "internalType": "uint256",
130
+ "name": "freezeTime",
131
+ "type": "uint256"
132
+ }
133
+ ],
134
+ "name": "SetFreezeTime",
135
+ "type": "event"
136
+ },
137
+ {
138
+ "anonymous": false,
139
+ "inputs": [
140
+ {
141
+ "indexed": true,
142
+ "internalType": "address",
143
+ "name": "implementation",
144
+ "type": "address"
145
+ }
146
+ ],
147
+ "name": "Upgraded",
148
+ "type": "event"
149
+ },
150
+ {
151
+ "stateMutability": "payable",
152
+ "type": "fallback"
153
+ },
154
+ {
155
+ "inputs": [],
156
+ "name": "admin",
157
+ "outputs": [
158
+ {
159
+ "internalType": "address",
160
+ "name": "admin_",
161
+ "type": "address"
162
+ }
163
+ ],
164
+ "stateMutability": "nonpayable",
165
+ "type": "function"
166
+ },
167
+ {
168
+ "inputs": [],
169
+ "name": "cancelFreeze",
170
+ "outputs": [],
171
+ "stateMutability": "nonpayable",
172
+ "type": "function"
173
+ },
174
+ {
175
+ "inputs": [
176
+ {
177
+ "internalType": "address",
178
+ "name": "newAdmin",
179
+ "type": "address"
180
+ }
181
+ ],
182
+ "name": "changeAdmin",
183
+ "outputs": [],
184
+ "stateMutability": "nonpayable",
185
+ "type": "function"
186
+ },
187
+ {
188
+ "inputs": [
189
+ {
190
+ "internalType": "address",
191
+ "name": "newPauser",
192
+ "type": "address"
193
+ }
194
+ ],
195
+ "name": "changePauser",
196
+ "outputs": [],
197
+ "stateMutability": "nonpayable",
198
+ "type": "function"
199
+ },
200
+ {
201
+ "inputs": [
202
+ {
203
+ "internalType": "uint256",
204
+ "name": "freezeTimeout",
205
+ "type": "uint256"
206
+ }
207
+ ],
208
+ "name": "freeze",
209
+ "outputs": [],
210
+ "stateMutability": "nonpayable",
211
+ "type": "function"
212
+ },
213
+ {
214
+ "inputs": [],
215
+ "name": "freezeTime",
216
+ "outputs": [
217
+ {
218
+ "internalType": "uint256",
219
+ "name": "",
220
+ "type": "uint256"
221
+ }
222
+ ],
223
+ "stateMutability": "nonpayable",
224
+ "type": "function"
225
+ },
226
+ {
227
+ "inputs": [],
228
+ "name": "frozen",
229
+ "outputs": [
230
+ {
231
+ "internalType": "bool",
232
+ "name": "",
233
+ "type": "bool"
234
+ }
235
+ ],
236
+ "stateMutability": "nonpayable",
237
+ "type": "function"
238
+ },
239
+ {
240
+ "inputs": [],
241
+ "name": "implementation",
242
+ "outputs": [
243
+ {
244
+ "internalType": "address",
245
+ "name": "implementation_",
246
+ "type": "address"
247
+ }
248
+ ],
249
+ "stateMutability": "nonpayable",
250
+ "type": "function"
251
+ },
252
+ {
253
+ "inputs": [],
254
+ "name": "pause",
255
+ "outputs": [],
256
+ "stateMutability": "nonpayable",
257
+ "type": "function"
258
+ },
259
+ {
260
+ "inputs": [],
261
+ "name": "paused",
262
+ "outputs": [
263
+ {
264
+ "internalType": "bool",
265
+ "name": "",
266
+ "type": "bool"
267
+ }
268
+ ],
269
+ "stateMutability": "nonpayable",
270
+ "type": "function"
271
+ },
272
+ {
273
+ "inputs": [],
274
+ "name": "pauser",
275
+ "outputs": [
276
+ {
277
+ "internalType": "address",
278
+ "name": "",
279
+ "type": "address"
280
+ }
281
+ ],
282
+ "stateMutability": "nonpayable",
283
+ "type": "function"
284
+ },
285
+ {
286
+ "inputs": [],
287
+ "name": "unpause",
288
+ "outputs": [],
289
+ "stateMutability": "nonpayable",
290
+ "type": "function"
291
+ },
292
+ {
293
+ "inputs": [
294
+ {
295
+ "internalType": "address",
296
+ "name": "newImplementation",
297
+ "type": "address"
298
+ }
299
+ ],
300
+ "name": "upgradeTo",
301
+ "outputs": [],
302
+ "stateMutability": "nonpayable",
303
+ "type": "function"
304
+ },
305
+ {
306
+ "inputs": [
307
+ {
308
+ "internalType": "address",
309
+ "name": "newImplementation",
310
+ "type": "address"
311
+ },
312
+ {
313
+ "internalType": "bytes",
314
+ "name": "data",
315
+ "type": "bytes"
316
+ }
317
+ ],
318
+ "name": "upgradeToAndCall",
319
+ "outputs": [],
320
+ "stateMutability": "payable",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "stateMutability": "payable",
325
+ "type": "receive"
326
+ }
327
+ ] as const satisfies Abi;
328
+
329
+ /**
330
+ * Type-safe ABI for TUPProxy_json
331
+ */
332
+ export type TUPProxy_jsonAbi = typeof TUPProxy_jsonAbi;
333
+
334
+ /**
335
+ * Contract instance type for TUPProxy_json
336
+ */
337
+ // Use any for contract type to avoid complex viem type issues
338
+ // The runtime behavior is type-safe through viem's ABI typing
339
+ export type TUPProxy_jsonContract = any;
340
+
341
+ /**
342
+ * TUPProxy_json Contract Class
343
+ *
344
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * import { createPublicClient, createWalletClient, http } from 'viem';
349
+ * import { mainnet } from 'viem/chains';
350
+ * import { TUPProxy_json } from 'TUPProxy_json';
351
+ *
352
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
353
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
354
+ *
355
+ * const contract = new TUPProxy_json('0x...', { publicClient, walletClient });
356
+ *
357
+ * // Read functions
358
+ * const result = await contract.balanceOf('0x...');
359
+ *
360
+ * // Write functions
361
+ * const hash = await contract.transfer('0x...', 1000n);
362
+ *
363
+ * // Simulate transactions (dry-run)
364
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
365
+ * console.log('Gas estimate:', simulation.request.gas);
366
+ *
367
+ * // Watch events
368
+ * const unwatch = contract.watch.Transfer((event) => {
369
+ * console.log('Transfer event:', event);
370
+ * });
371
+ * ```
372
+ */
373
+ export class TUPProxy_json {
374
+ private contract: TUPProxy_jsonContract;
375
+ private contractAddress: Address;
376
+ private publicClient: PublicClient;
377
+
378
+ constructor(
379
+ address: Address,
380
+ clients: {
381
+ publicClient: PublicClient;
382
+ walletClient?: WalletClient;
383
+ }
384
+ ) {
385
+ this.contractAddress = address;
386
+ this.publicClient = clients.publicClient;
387
+ this.contract = getContract({
388
+ address,
389
+ abi: TUPProxy_jsonAbi,
390
+ client: {
391
+ public: clients.publicClient,
392
+ wallet: clients.walletClient,
393
+ },
394
+ });
395
+ }
396
+
397
+ /**
398
+ * Get the contract address
399
+ */
400
+ get address(): Address {
401
+ return this.contractAddress;
402
+ }
403
+
404
+ /**
405
+ * Get the underlying viem contract instance
406
+ */
407
+ getContract(): TUPProxy_jsonContract {
408
+ return this.contract;
409
+ }
410
+
411
+ // No read functions
412
+
413
+ /**
414
+ * admin
415
+ * nonpayable
416
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
417
+ */
418
+ async admin(options?: {
419
+ accessList?: import('viem').AccessList;
420
+ authorizationList?: import('viem').AuthorizationList;
421
+ chain?: import('viem').Chain | null;
422
+ dataSuffix?: `0x${string}`;
423
+ gas?: bigint;
424
+ gasPrice?: bigint;
425
+ maxFeePerGas?: bigint;
426
+ maxPriorityFeePerGas?: bigint;
427
+ nonce?: number;
428
+ value?: bigint;
429
+ }): Promise<`0x${string}`> {
430
+ if (!this.contract.write) {
431
+ throw new Error('Wallet client is required for write operations');
432
+ }
433
+ return this.contract.write.admin(options) as Promise<`0x${string}`>;
434
+ }
435
+
436
+ /**
437
+ * cancelFreeze
438
+ * nonpayable
439
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
440
+ */
441
+ async cancelFreeze(options?: {
442
+ accessList?: import('viem').AccessList;
443
+ authorizationList?: import('viem').AuthorizationList;
444
+ chain?: import('viem').Chain | null;
445
+ dataSuffix?: `0x${string}`;
446
+ gas?: bigint;
447
+ gasPrice?: bigint;
448
+ maxFeePerGas?: bigint;
449
+ maxPriorityFeePerGas?: bigint;
450
+ nonce?: number;
451
+ value?: bigint;
452
+ }): Promise<`0x${string}`> {
453
+ if (!this.contract.write) {
454
+ throw new Error('Wallet client is required for write operations');
455
+ }
456
+ return this.contract.write.cancelFreeze(options) as Promise<`0x${string}`>;
457
+ }
458
+
459
+ /**
460
+ * changeAdmin
461
+ * nonpayable
462
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
463
+ */
464
+ async changeAdmin(newAdmin: `0x${string}`, options?: {
465
+ accessList?: import('viem').AccessList;
466
+ authorizationList?: import('viem').AuthorizationList;
467
+ chain?: import('viem').Chain | null;
468
+ dataSuffix?: `0x${string}`;
469
+ gas?: bigint;
470
+ gasPrice?: bigint;
471
+ maxFeePerGas?: bigint;
472
+ maxPriorityFeePerGas?: bigint;
473
+ nonce?: number;
474
+ value?: bigint;
475
+ }): Promise<`0x${string}`> {
476
+ if (!this.contract.write) {
477
+ throw new Error('Wallet client is required for write operations');
478
+ }
479
+ return this.contract.write.changeAdmin([newAdmin] as const, options) as Promise<`0x${string}`>;
480
+ }
481
+
482
+ /**
483
+ * changePauser
484
+ * nonpayable
485
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
486
+ */
487
+ async changePauser(newPauser: `0x${string}`, options?: {
488
+ accessList?: import('viem').AccessList;
489
+ authorizationList?: import('viem').AuthorizationList;
490
+ chain?: import('viem').Chain | null;
491
+ dataSuffix?: `0x${string}`;
492
+ gas?: bigint;
493
+ gasPrice?: bigint;
494
+ maxFeePerGas?: bigint;
495
+ maxPriorityFeePerGas?: bigint;
496
+ nonce?: number;
497
+ value?: bigint;
498
+ }): Promise<`0x${string}`> {
499
+ if (!this.contract.write) {
500
+ throw new Error('Wallet client is required for write operations');
501
+ }
502
+ return this.contract.write.changePauser([newPauser] as const, options) as Promise<`0x${string}`>;
503
+ }
504
+
505
+ /**
506
+ * freeze
507
+ * nonpayable
508
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
509
+ */
510
+ async freeze(freezeTimeout: bigint, options?: {
511
+ accessList?: import('viem').AccessList;
512
+ authorizationList?: import('viem').AuthorizationList;
513
+ chain?: import('viem').Chain | null;
514
+ dataSuffix?: `0x${string}`;
515
+ gas?: bigint;
516
+ gasPrice?: bigint;
517
+ maxFeePerGas?: bigint;
518
+ maxPriorityFeePerGas?: bigint;
519
+ nonce?: number;
520
+ value?: bigint;
521
+ }): Promise<`0x${string}`> {
522
+ if (!this.contract.write) {
523
+ throw new Error('Wallet client is required for write operations');
524
+ }
525
+ return this.contract.write.freeze([freezeTimeout] as const, options) as Promise<`0x${string}`>;
526
+ }
527
+
528
+ /**
529
+ * freezeTime
530
+ * nonpayable
531
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
532
+ */
533
+ async freezeTime(options?: {
534
+ accessList?: import('viem').AccessList;
535
+ authorizationList?: import('viem').AuthorizationList;
536
+ chain?: import('viem').Chain | null;
537
+ dataSuffix?: `0x${string}`;
538
+ gas?: bigint;
539
+ gasPrice?: bigint;
540
+ maxFeePerGas?: bigint;
541
+ maxPriorityFeePerGas?: bigint;
542
+ nonce?: number;
543
+ value?: bigint;
544
+ }): Promise<`0x${string}`> {
545
+ if (!this.contract.write) {
546
+ throw new Error('Wallet client is required for write operations');
547
+ }
548
+ return this.contract.write.freezeTime(options) as Promise<`0x${string}`>;
549
+ }
550
+
551
+ /**
552
+ * frozen
553
+ * nonpayable
554
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
555
+ */
556
+ async frozen(options?: {
557
+ accessList?: import('viem').AccessList;
558
+ authorizationList?: import('viem').AuthorizationList;
559
+ chain?: import('viem').Chain | null;
560
+ dataSuffix?: `0x${string}`;
561
+ gas?: bigint;
562
+ gasPrice?: bigint;
563
+ maxFeePerGas?: bigint;
564
+ maxPriorityFeePerGas?: bigint;
565
+ nonce?: number;
566
+ value?: bigint;
567
+ }): Promise<`0x${string}`> {
568
+ if (!this.contract.write) {
569
+ throw new Error('Wallet client is required for write operations');
570
+ }
571
+ return this.contract.write.frozen(options) as Promise<`0x${string}`>;
572
+ }
573
+
574
+ /**
575
+ * implementation
576
+ * nonpayable
577
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
578
+ */
579
+ async implementation(options?: {
580
+ accessList?: import('viem').AccessList;
581
+ authorizationList?: import('viem').AuthorizationList;
582
+ chain?: import('viem').Chain | null;
583
+ dataSuffix?: `0x${string}`;
584
+ gas?: bigint;
585
+ gasPrice?: bigint;
586
+ maxFeePerGas?: bigint;
587
+ maxPriorityFeePerGas?: bigint;
588
+ nonce?: number;
589
+ value?: bigint;
590
+ }): Promise<`0x${string}`> {
591
+ if (!this.contract.write) {
592
+ throw new Error('Wallet client is required for write operations');
593
+ }
594
+ return this.contract.write.implementation(options) as Promise<`0x${string}`>;
595
+ }
596
+
597
+ /**
598
+ * pause
599
+ * nonpayable
600
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
601
+ */
602
+ async pause(options?: {
603
+ accessList?: import('viem').AccessList;
604
+ authorizationList?: import('viem').AuthorizationList;
605
+ chain?: import('viem').Chain | null;
606
+ dataSuffix?: `0x${string}`;
607
+ gas?: bigint;
608
+ gasPrice?: bigint;
609
+ maxFeePerGas?: bigint;
610
+ maxPriorityFeePerGas?: bigint;
611
+ nonce?: number;
612
+ value?: bigint;
613
+ }): Promise<`0x${string}`> {
614
+ if (!this.contract.write) {
615
+ throw new Error('Wallet client is required for write operations');
616
+ }
617
+ return this.contract.write.pause(options) as Promise<`0x${string}`>;
618
+ }
619
+
620
+ /**
621
+ * paused
622
+ * nonpayable
623
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
624
+ */
625
+ async paused(options?: {
626
+ accessList?: import('viem').AccessList;
627
+ authorizationList?: import('viem').AuthorizationList;
628
+ chain?: import('viem').Chain | null;
629
+ dataSuffix?: `0x${string}`;
630
+ gas?: bigint;
631
+ gasPrice?: bigint;
632
+ maxFeePerGas?: bigint;
633
+ maxPriorityFeePerGas?: bigint;
634
+ nonce?: number;
635
+ value?: bigint;
636
+ }): Promise<`0x${string}`> {
637
+ if (!this.contract.write) {
638
+ throw new Error('Wallet client is required for write operations');
639
+ }
640
+ return this.contract.write.paused(options) as Promise<`0x${string}`>;
641
+ }
642
+
643
+ /**
644
+ * pauser
645
+ * nonpayable
646
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
647
+ */
648
+ async pauser(options?: {
649
+ accessList?: import('viem').AccessList;
650
+ authorizationList?: import('viem').AuthorizationList;
651
+ chain?: import('viem').Chain | null;
652
+ dataSuffix?: `0x${string}`;
653
+ gas?: bigint;
654
+ gasPrice?: bigint;
655
+ maxFeePerGas?: bigint;
656
+ maxPriorityFeePerGas?: bigint;
657
+ nonce?: number;
658
+ value?: bigint;
659
+ }): Promise<`0x${string}`> {
660
+ if (!this.contract.write) {
661
+ throw new Error('Wallet client is required for write operations');
662
+ }
663
+ return this.contract.write.pauser(options) as Promise<`0x${string}`>;
664
+ }
665
+
666
+ /**
667
+ * unpause
668
+ * nonpayable
669
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
670
+ */
671
+ async unpause(options?: {
672
+ accessList?: import('viem').AccessList;
673
+ authorizationList?: import('viem').AuthorizationList;
674
+ chain?: import('viem').Chain | null;
675
+ dataSuffix?: `0x${string}`;
676
+ gas?: bigint;
677
+ gasPrice?: bigint;
678
+ maxFeePerGas?: bigint;
679
+ maxPriorityFeePerGas?: bigint;
680
+ nonce?: number;
681
+ value?: bigint;
682
+ }): Promise<`0x${string}`> {
683
+ if (!this.contract.write) {
684
+ throw new Error('Wallet client is required for write operations');
685
+ }
686
+ return this.contract.write.unpause(options) as Promise<`0x${string}`>;
687
+ }
688
+
689
+ /**
690
+ * upgradeTo
691
+ * nonpayable
692
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
693
+ */
694
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
695
+ accessList?: import('viem').AccessList;
696
+ authorizationList?: import('viem').AuthorizationList;
697
+ chain?: import('viem').Chain | null;
698
+ dataSuffix?: `0x${string}`;
699
+ gas?: bigint;
700
+ gasPrice?: bigint;
701
+ maxFeePerGas?: bigint;
702
+ maxPriorityFeePerGas?: bigint;
703
+ nonce?: number;
704
+ value?: bigint;
705
+ }): Promise<`0x${string}`> {
706
+ if (!this.contract.write) {
707
+ throw new Error('Wallet client is required for write operations');
708
+ }
709
+ return this.contract.write.upgradeTo([newImplementation] as const, options) as Promise<`0x${string}`>;
710
+ }
711
+
712
+ /**
713
+ * upgradeToAndCall
714
+ * payable
715
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
716
+ */
717
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
718
+ accessList?: import('viem').AccessList;
719
+ authorizationList?: import('viem').AuthorizationList;
720
+ chain?: import('viem').Chain | null;
721
+ dataSuffix?: `0x${string}`;
722
+ gas?: bigint;
723
+ gasPrice?: bigint;
724
+ maxFeePerGas?: bigint;
725
+ maxPriorityFeePerGas?: bigint;
726
+ nonce?: number;
727
+ value?: bigint;
728
+ }): Promise<`0x${string}`> {
729
+ if (!this.contract.write) {
730
+ throw new Error('Wallet client is required for write operations');
731
+ }
732
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
733
+ }
734
+
735
+
736
+
737
+ /**
738
+ * Simulate contract write operations (dry-run without sending transaction)
739
+ *
740
+ * @example
741
+ * const result = await contract.simulate.transfer('0x...', 1000n);
742
+ * console.log('Gas estimate:', result.request.gas);
743
+ * console.log('Would succeed:', result.result);
744
+ */
745
+ get simulate() {
746
+ const contract = this.contract;
747
+ if (!contract.simulate) {
748
+ throw new Error('Public client is required for simulation');
749
+ }
750
+ return {
751
+ /**
752
+ * Simulate admin
753
+ * Returns gas estimate and result without sending transaction
754
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
755
+ */
756
+ async admin(options?: {
757
+ accessList?: import('viem').AccessList;
758
+ authorizationList?: import('viem').AuthorizationList;
759
+ chain?: import('viem').Chain | null;
760
+ dataSuffix?: `0x${string}`;
761
+ gas?: bigint;
762
+ gasPrice?: bigint;
763
+ maxFeePerGas?: bigint;
764
+ maxPriorityFeePerGas?: bigint;
765
+ nonce?: number;
766
+ value?: bigint;
767
+ }): Promise<`0x${string}`> {
768
+ return contract.simulate.admin(options) as Promise<`0x${string}`>;
769
+ },
770
+ /**
771
+ * Simulate cancelFreeze
772
+ * Returns gas estimate and result without sending transaction
773
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
774
+ */
775
+ async cancelFreeze(options?: {
776
+ accessList?: import('viem').AccessList;
777
+ authorizationList?: import('viem').AuthorizationList;
778
+ chain?: import('viem').Chain | null;
779
+ dataSuffix?: `0x${string}`;
780
+ gas?: bigint;
781
+ gasPrice?: bigint;
782
+ maxFeePerGas?: bigint;
783
+ maxPriorityFeePerGas?: bigint;
784
+ nonce?: number;
785
+ value?: bigint;
786
+ }): Promise<void> {
787
+ return contract.simulate.cancelFreeze(options) as Promise<void>;
788
+ },
789
+ /**
790
+ * Simulate changeAdmin
791
+ * Returns gas estimate and result without sending transaction
792
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
793
+ */
794
+ async changeAdmin(newAdmin: `0x${string}`, options?: {
795
+ accessList?: import('viem').AccessList;
796
+ authorizationList?: import('viem').AuthorizationList;
797
+ chain?: import('viem').Chain | null;
798
+ dataSuffix?: `0x${string}`;
799
+ gas?: bigint;
800
+ gasPrice?: bigint;
801
+ maxFeePerGas?: bigint;
802
+ maxPriorityFeePerGas?: bigint;
803
+ nonce?: number;
804
+ value?: bigint;
805
+ }): Promise<void> {
806
+ return contract.simulate.changeAdmin([newAdmin] as const, options) as Promise<void>;
807
+ },
808
+ /**
809
+ * Simulate changePauser
810
+ * Returns gas estimate and result without sending transaction
811
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
812
+ */
813
+ async changePauser(newPauser: `0x${string}`, options?: {
814
+ accessList?: import('viem').AccessList;
815
+ authorizationList?: import('viem').AuthorizationList;
816
+ chain?: import('viem').Chain | null;
817
+ dataSuffix?: `0x${string}`;
818
+ gas?: bigint;
819
+ gasPrice?: bigint;
820
+ maxFeePerGas?: bigint;
821
+ maxPriorityFeePerGas?: bigint;
822
+ nonce?: number;
823
+ value?: bigint;
824
+ }): Promise<void> {
825
+ return contract.simulate.changePauser([newPauser] as const, options) as Promise<void>;
826
+ },
827
+ /**
828
+ * Simulate freeze
829
+ * Returns gas estimate and result without sending transaction
830
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
831
+ */
832
+ async freeze(freezeTimeout: bigint, options?: {
833
+ accessList?: import('viem').AccessList;
834
+ authorizationList?: import('viem').AuthorizationList;
835
+ chain?: import('viem').Chain | null;
836
+ dataSuffix?: `0x${string}`;
837
+ gas?: bigint;
838
+ gasPrice?: bigint;
839
+ maxFeePerGas?: bigint;
840
+ maxPriorityFeePerGas?: bigint;
841
+ nonce?: number;
842
+ value?: bigint;
843
+ }): Promise<void> {
844
+ return contract.simulate.freeze([freezeTimeout] as const, options) as Promise<void>;
845
+ },
846
+ /**
847
+ * Simulate freezeTime
848
+ * Returns gas estimate and result without sending transaction
849
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
850
+ */
851
+ async freezeTime(options?: {
852
+ accessList?: import('viem').AccessList;
853
+ authorizationList?: import('viem').AuthorizationList;
854
+ chain?: import('viem').Chain | null;
855
+ dataSuffix?: `0x${string}`;
856
+ gas?: bigint;
857
+ gasPrice?: bigint;
858
+ maxFeePerGas?: bigint;
859
+ maxPriorityFeePerGas?: bigint;
860
+ nonce?: number;
861
+ value?: bigint;
862
+ }): Promise<bigint> {
863
+ return contract.simulate.freezeTime(options) as Promise<bigint>;
864
+ },
865
+ /**
866
+ * Simulate frozen
867
+ * Returns gas estimate and result without sending transaction
868
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
869
+ */
870
+ async frozen(options?: {
871
+ accessList?: import('viem').AccessList;
872
+ authorizationList?: import('viem').AuthorizationList;
873
+ chain?: import('viem').Chain | null;
874
+ dataSuffix?: `0x${string}`;
875
+ gas?: bigint;
876
+ gasPrice?: bigint;
877
+ maxFeePerGas?: bigint;
878
+ maxPriorityFeePerGas?: bigint;
879
+ nonce?: number;
880
+ value?: bigint;
881
+ }): Promise<boolean> {
882
+ return contract.simulate.frozen(options) as Promise<boolean>;
883
+ },
884
+ /**
885
+ * Simulate implementation
886
+ * Returns gas estimate and result without sending transaction
887
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
888
+ */
889
+ async implementation(options?: {
890
+ accessList?: import('viem').AccessList;
891
+ authorizationList?: import('viem').AuthorizationList;
892
+ chain?: import('viem').Chain | null;
893
+ dataSuffix?: `0x${string}`;
894
+ gas?: bigint;
895
+ gasPrice?: bigint;
896
+ maxFeePerGas?: bigint;
897
+ maxPriorityFeePerGas?: bigint;
898
+ nonce?: number;
899
+ value?: bigint;
900
+ }): Promise<`0x${string}`> {
901
+ return contract.simulate.implementation(options) as Promise<`0x${string}`>;
902
+ },
903
+ /**
904
+ * Simulate pause
905
+ * Returns gas estimate and result without sending transaction
906
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
907
+ */
908
+ async pause(options?: {
909
+ accessList?: import('viem').AccessList;
910
+ authorizationList?: import('viem').AuthorizationList;
911
+ chain?: import('viem').Chain | null;
912
+ dataSuffix?: `0x${string}`;
913
+ gas?: bigint;
914
+ gasPrice?: bigint;
915
+ maxFeePerGas?: bigint;
916
+ maxPriorityFeePerGas?: bigint;
917
+ nonce?: number;
918
+ value?: bigint;
919
+ }): Promise<void> {
920
+ return contract.simulate.pause(options) as Promise<void>;
921
+ },
922
+ /**
923
+ * Simulate paused
924
+ * Returns gas estimate and result without sending transaction
925
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
926
+ */
927
+ async paused(options?: {
928
+ accessList?: import('viem').AccessList;
929
+ authorizationList?: import('viem').AuthorizationList;
930
+ chain?: import('viem').Chain | null;
931
+ dataSuffix?: `0x${string}`;
932
+ gas?: bigint;
933
+ gasPrice?: bigint;
934
+ maxFeePerGas?: bigint;
935
+ maxPriorityFeePerGas?: bigint;
936
+ nonce?: number;
937
+ value?: bigint;
938
+ }): Promise<boolean> {
939
+ return contract.simulate.paused(options) as Promise<boolean>;
940
+ },
941
+ /**
942
+ * Simulate pauser
943
+ * Returns gas estimate and result without sending transaction
944
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
945
+ */
946
+ async pauser(options?: {
947
+ accessList?: import('viem').AccessList;
948
+ authorizationList?: import('viem').AuthorizationList;
949
+ chain?: import('viem').Chain | null;
950
+ dataSuffix?: `0x${string}`;
951
+ gas?: bigint;
952
+ gasPrice?: bigint;
953
+ maxFeePerGas?: bigint;
954
+ maxPriorityFeePerGas?: bigint;
955
+ nonce?: number;
956
+ value?: bigint;
957
+ }): Promise<`0x${string}`> {
958
+ return contract.simulate.pauser(options) as Promise<`0x${string}`>;
959
+ },
960
+ /**
961
+ * Simulate unpause
962
+ * Returns gas estimate and result without sending transaction
963
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
964
+ */
965
+ async unpause(options?: {
966
+ accessList?: import('viem').AccessList;
967
+ authorizationList?: import('viem').AuthorizationList;
968
+ chain?: import('viem').Chain | null;
969
+ dataSuffix?: `0x${string}`;
970
+ gas?: bigint;
971
+ gasPrice?: bigint;
972
+ maxFeePerGas?: bigint;
973
+ maxPriorityFeePerGas?: bigint;
974
+ nonce?: number;
975
+ value?: bigint;
976
+ }): Promise<void> {
977
+ return contract.simulate.unpause(options) as Promise<void>;
978
+ },
979
+ /**
980
+ * Simulate upgradeTo
981
+ * Returns gas estimate and result without sending transaction
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<void> {
996
+ return contract.simulate.upgradeTo([newImplementation] as const, options) as Promise<void>;
997
+ },
998
+ /**
999
+ * Simulate upgradeToAndCall
1000
+ * Returns gas estimate and result without sending transaction
1001
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1002
+ */
1003
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1004
+ accessList?: import('viem').AccessList;
1005
+ authorizationList?: import('viem').AuthorizationList;
1006
+ chain?: import('viem').Chain | null;
1007
+ dataSuffix?: `0x${string}`;
1008
+ gas?: bigint;
1009
+ gasPrice?: bigint;
1010
+ maxFeePerGas?: bigint;
1011
+ maxPriorityFeePerGas?: bigint;
1012
+ nonce?: number;
1013
+ value?: bigint;
1014
+ }): Promise<void> {
1015
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
1016
+ }
1017
+ };
1018
+ }
1019
+
1020
+ /**
1021
+ * Watch contract events
1022
+ *
1023
+ * @example
1024
+ * // Watch all Transfer events
1025
+ * const unwatch = contract.watch.Transfer((event) => {
1026
+ * console.log('Transfer:', event);
1027
+ * });
1028
+ *
1029
+ * // Stop watching
1030
+ * unwatch();
1031
+ */
1032
+ get watch() {
1033
+ return {
1034
+ /**
1035
+ * Watch AdminChanged events
1036
+ * @param callback Function to call when event is emitted
1037
+ * @param filter Optional filter for indexed parameters
1038
+ * @returns Unwatch function to stop listening
1039
+ */
1040
+ AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
1041
+ return this.publicClient.watchContractEvent({
1042
+ address: this.contractAddress,
1043
+ abi: TUPProxy_jsonAbi,
1044
+ eventName: 'AdminChanged',
1045
+
1046
+ onLogs: (logs: any[]) => {
1047
+ logs.forEach((log: any) => {
1048
+ callback(log.args as any);
1049
+ });
1050
+ },
1051
+ }) as () => void;
1052
+ },
1053
+ /**
1054
+ * Watch BeaconUpgraded events
1055
+ * @param callback Function to call when event is emitted
1056
+ * @param filter Optional filter for indexed parameters
1057
+ * @returns Unwatch function to stop listening
1058
+ */
1059
+ BeaconUpgraded: (callback: (event: { beacon: `0x${string}` }) => void, filter?: { beacon: `0x${string}` }) => {
1060
+ return this.publicClient.watchContractEvent({
1061
+ address: this.contractAddress,
1062
+ abi: TUPProxy_jsonAbi,
1063
+ eventName: 'BeaconUpgraded',
1064
+ args: filter,
1065
+ onLogs: (logs: any[]) => {
1066
+ logs.forEach((log: any) => {
1067
+ callback(log.args as any);
1068
+ });
1069
+ },
1070
+ }) as () => void;
1071
+ },
1072
+ /**
1073
+ * Watch PauserChanged events
1074
+ * @param callback Function to call when event is emitted
1075
+ * @param filter Optional filter for indexed parameters
1076
+ * @returns Unwatch function to stop listening
1077
+ */
1078
+ PauserChanged: (callback: (event: { previousPauser: `0x${string}`; newPauser: `0x${string}` }) => void) => {
1079
+ return this.publicClient.watchContractEvent({
1080
+ address: this.contractAddress,
1081
+ abi: TUPProxy_jsonAbi,
1082
+ eventName: 'PauserChanged',
1083
+
1084
+ onLogs: (logs: any[]) => {
1085
+ logs.forEach((log: any) => {
1086
+ callback(log.args as any);
1087
+ });
1088
+ },
1089
+ }) as () => void;
1090
+ },
1091
+ /**
1092
+ * Watch SetFreezeTime events
1093
+ * @param callback Function to call when event is emitted
1094
+ * @param filter Optional filter for indexed parameters
1095
+ * @returns Unwatch function to stop listening
1096
+ */
1097
+ SetFreezeTime: (callback: (event: { freezeTime: bigint }) => void) => {
1098
+ return this.publicClient.watchContractEvent({
1099
+ address: this.contractAddress,
1100
+ abi: TUPProxy_jsonAbi,
1101
+ eventName: 'SetFreezeTime',
1102
+
1103
+ onLogs: (logs: any[]) => {
1104
+ logs.forEach((log: any) => {
1105
+ callback(log.args as any);
1106
+ });
1107
+ },
1108
+ }) as () => void;
1109
+ },
1110
+ /**
1111
+ * Watch Upgraded events
1112
+ * @param callback Function to call when event is emitted
1113
+ * @param filter Optional filter for indexed parameters
1114
+ * @returns Unwatch function to stop listening
1115
+ */
1116
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
1117
+ return this.publicClient.watchContractEvent({
1118
+ address: this.contractAddress,
1119
+ abi: TUPProxy_jsonAbi,
1120
+ eventName: 'Upgraded',
1121
+ args: filter,
1122
+ onLogs: (logs: any[]) => {
1123
+ logs.forEach((log: any) => {
1124
+ callback(log.args as any);
1125
+ });
1126
+ },
1127
+ }) as () => void;
1128
+ }
1129
+ };
1130
+ }
1131
+ }