@gitmyabi/multisigwallet 1.0.1

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