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