@gitmyabi/tokendistributor 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,823 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * TokenDistributor_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const TokenDistributor_jsonAbi = [
10
+ {
11
+ "inputs": [],
12
+ "stateMutability": "nonpayable",
13
+ "type": "constructor"
14
+ },
15
+ {
16
+ "inputs": [
17
+ {
18
+ "internalType": "address",
19
+ "name": "token",
20
+ "type": "address"
21
+ }
22
+ ],
23
+ "name": "SafeERC20FailedOperation",
24
+ "type": "error"
25
+ },
26
+ {
27
+ "anonymous": false,
28
+ "inputs": [
29
+ {
30
+ "indexed": true,
31
+ "internalType": "address",
32
+ "name": "sender",
33
+ "type": "address"
34
+ },
35
+ {
36
+ "indexed": false,
37
+ "internalType": "uint256",
38
+ "name": "value",
39
+ "type": "uint256"
40
+ }
41
+ ],
42
+ "name": "Received",
43
+ "type": "event"
44
+ },
45
+ {
46
+ "inputs": [],
47
+ "name": "acceptOwnership",
48
+ "outputs": [],
49
+ "stateMutability": "nonpayable",
50
+ "type": "function"
51
+ },
52
+ {
53
+ "inputs": [
54
+ {
55
+ "internalType": "bool",
56
+ "name": "_enableCoolDown",
57
+ "type": "bool"
58
+ }
59
+ ],
60
+ "name": "changeEnableCoolDown",
61
+ "outputs": [],
62
+ "stateMutability": "nonpayable",
63
+ "type": "function"
64
+ },
65
+ {
66
+ "inputs": [
67
+ {
68
+ "internalType": "address",
69
+ "name": "_manager",
70
+ "type": "address"
71
+ }
72
+ ],
73
+ "name": "changeManager",
74
+ "outputs": [],
75
+ "stateMutability": "nonpayable",
76
+ "type": "function"
77
+ },
78
+ {
79
+ "inputs": [],
80
+ "name": "coolDown",
81
+ "outputs": [
82
+ {
83
+ "internalType": "uint256",
84
+ "name": "",
85
+ "type": "uint256"
86
+ }
87
+ ],
88
+ "stateMutability": "view",
89
+ "type": "function"
90
+ },
91
+ {
92
+ "inputs": [
93
+ {
94
+ "internalType": "uint256",
95
+ "name": "_coolDown",
96
+ "type": "uint256"
97
+ }
98
+ ],
99
+ "name": "defineCoolDown",
100
+ "outputs": [],
101
+ "stateMutability": "nonpayable",
102
+ "type": "function"
103
+ },
104
+ {
105
+ "inputs": [
106
+ {
107
+ "internalType": "address",
108
+ "name": "_token",
109
+ "type": "address"
110
+ }
111
+ ],
112
+ "name": "defineToken",
113
+ "outputs": [],
114
+ "stateMutability": "nonpayable",
115
+ "type": "function"
116
+ },
117
+ {
118
+ "inputs": [
119
+ {
120
+ "internalType": "address",
121
+ "name": "",
122
+ "type": "address"
123
+ }
124
+ ],
125
+ "name": "lastDistributed",
126
+ "outputs": [
127
+ {
128
+ "internalType": "uint256",
129
+ "name": "",
130
+ "type": "uint256"
131
+ }
132
+ ],
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ },
136
+ {
137
+ "inputs": [],
138
+ "name": "manager",
139
+ "outputs": [
140
+ {
141
+ "internalType": "address",
142
+ "name": "",
143
+ "type": "address"
144
+ }
145
+ ],
146
+ "stateMutability": "view",
147
+ "type": "function"
148
+ },
149
+ {
150
+ "inputs": [],
151
+ "name": "owner",
152
+ "outputs": [
153
+ {
154
+ "internalType": "address",
155
+ "name": "",
156
+ "type": "address"
157
+ }
158
+ ],
159
+ "stateMutability": "view",
160
+ "type": "function"
161
+ },
162
+ {
163
+ "inputs": [
164
+ {
165
+ "internalType": "address",
166
+ "name": "_owner",
167
+ "type": "address"
168
+ }
169
+ ],
170
+ "name": "proposeOwner",
171
+ "outputs": [],
172
+ "stateMutability": "nonpayable",
173
+ "type": "function"
174
+ },
175
+ {
176
+ "inputs": [],
177
+ "name": "proposedOwner",
178
+ "outputs": [
179
+ {
180
+ "internalType": "address",
181
+ "name": "",
182
+ "type": "address"
183
+ }
184
+ ],
185
+ "stateMutability": "view",
186
+ "type": "function"
187
+ },
188
+ {
189
+ "inputs": [
190
+ {
191
+ "internalType": "address[]",
192
+ "name": "_recipients",
193
+ "type": "address[]"
194
+ },
195
+ {
196
+ "internalType": "uint256[]",
197
+ "name": "_amounts",
198
+ "type": "uint256[]"
199
+ }
200
+ ],
201
+ "name": "sendNative",
202
+ "outputs": [],
203
+ "stateMutability": "nonpayable",
204
+ "type": "function"
205
+ },
206
+ {
207
+ "inputs": [
208
+ {
209
+ "internalType": "address[]",
210
+ "name": "_recipients",
211
+ "type": "address[]"
212
+ },
213
+ {
214
+ "internalType": "uint256[]",
215
+ "name": "_amounts",
216
+ "type": "uint256[]"
217
+ }
218
+ ],
219
+ "name": "sendTokens",
220
+ "outputs": [],
221
+ "stateMutability": "nonpayable",
222
+ "type": "function"
223
+ },
224
+ {
225
+ "inputs": [
226
+ {
227
+ "internalType": "address",
228
+ "name": "_recipient",
229
+ "type": "address"
230
+ },
231
+ {
232
+ "internalType": "uint256",
233
+ "name": "_time",
234
+ "type": "uint256"
235
+ }
236
+ ],
237
+ "name": "setLastDistributed",
238
+ "outputs": [],
239
+ "stateMutability": "nonpayable",
240
+ "type": "function"
241
+ },
242
+ {
243
+ "inputs": [],
244
+ "name": "token",
245
+ "outputs": [
246
+ {
247
+ "internalType": "address",
248
+ "name": "",
249
+ "type": "address"
250
+ }
251
+ ],
252
+ "stateMutability": "view",
253
+ "type": "function"
254
+ },
255
+ {
256
+ "stateMutability": "payable",
257
+ "type": "receive"
258
+ }
259
+ ] as const satisfies Abi;
260
+
261
+ /**
262
+ * Type-safe ABI for TokenDistributor_json
263
+ */
264
+ export type TokenDistributor_jsonAbi = typeof TokenDistributor_jsonAbi;
265
+
266
+ /**
267
+ * Contract instance type for TokenDistributor_json
268
+ */
269
+ // Use any for contract type to avoid complex viem type issues
270
+ // The runtime behavior is type-safe through viem's ABI typing
271
+ export type TokenDistributor_jsonContract = any;
272
+
273
+ /**
274
+ * TokenDistributor_json Contract Class
275
+ *
276
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
277
+ *
278
+ * @example
279
+ * ```typescript
280
+ * import { createPublicClient, createWalletClient, http } from 'viem';
281
+ * import { mainnet } from 'viem/chains';
282
+ * import { TokenDistributor_json } from 'TokenDistributor_json';
283
+ *
284
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
285
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
286
+ *
287
+ * const contract = new TokenDistributor_json('0x...', { publicClient, walletClient });
288
+ *
289
+ * // Read functions
290
+ * const result = await contract.balanceOf('0x...');
291
+ *
292
+ * // Write functions
293
+ * const hash = await contract.transfer('0x...', 1000n);
294
+ *
295
+ * // Simulate transactions (dry-run)
296
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
297
+ * console.log('Gas estimate:', simulation.request.gas);
298
+ *
299
+ * // Watch events
300
+ * const unwatch = contract.watch.Transfer((event) => {
301
+ * console.log('Transfer event:', event);
302
+ * });
303
+ * ```
304
+ */
305
+ export class TokenDistributor_json {
306
+ private contract: TokenDistributor_jsonContract;
307
+ private contractAddress: Address;
308
+ private publicClient: PublicClient;
309
+
310
+ constructor(
311
+ address: Address,
312
+ clients: {
313
+ publicClient: PublicClient;
314
+ walletClient?: WalletClient;
315
+ }
316
+ ) {
317
+ this.contractAddress = address;
318
+ this.publicClient = clients.publicClient;
319
+ this.contract = getContract({
320
+ address,
321
+ abi: TokenDistributor_jsonAbi,
322
+ client: {
323
+ public: clients.publicClient,
324
+ wallet: clients.walletClient,
325
+ },
326
+ });
327
+ }
328
+
329
+ /**
330
+ * Get the contract address
331
+ */
332
+ get address(): Address {
333
+ return this.contractAddress;
334
+ }
335
+
336
+ /**
337
+ * Get the underlying viem contract instance
338
+ */
339
+ getContract(): TokenDistributor_jsonContract {
340
+ return this.contract;
341
+ }
342
+
343
+ /**
344
+ * coolDown
345
+ * view
346
+ */
347
+ async coolDown(): Promise<bigint> {
348
+ return this.contract.read.coolDown() as Promise<bigint>;
349
+ }
350
+
351
+ /**
352
+ * lastDistributed
353
+ * view
354
+ */
355
+ async lastDistributed(arg0: `0x${string}`): Promise<bigint> {
356
+ return this.contract.read.lastDistributed([arg0] as const) as Promise<bigint>;
357
+ }
358
+
359
+ /**
360
+ * manager
361
+ * view
362
+ */
363
+ async manager(): Promise<`0x${string}`> {
364
+ return this.contract.read.manager() as Promise<`0x${string}`>;
365
+ }
366
+
367
+ /**
368
+ * owner
369
+ * view
370
+ */
371
+ async owner(): Promise<`0x${string}`> {
372
+ return this.contract.read.owner() as Promise<`0x${string}`>;
373
+ }
374
+
375
+ /**
376
+ * proposedOwner
377
+ * view
378
+ */
379
+ async proposedOwner(): Promise<`0x${string}`> {
380
+ return this.contract.read.proposedOwner() as Promise<`0x${string}`>;
381
+ }
382
+
383
+ /**
384
+ * token
385
+ * view
386
+ */
387
+ async token(): Promise<`0x${string}`> {
388
+ return this.contract.read.token() as Promise<`0x${string}`>;
389
+ }
390
+
391
+ /**
392
+ * acceptOwnership
393
+ * nonpayable
394
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
395
+ */
396
+ async acceptOwnership(options?: {
397
+ accessList?: import('viem').AccessList;
398
+ authorizationList?: import('viem').AuthorizationList;
399
+ chain?: import('viem').Chain | null;
400
+ dataSuffix?: `0x${string}`;
401
+ gas?: bigint;
402
+ gasPrice?: bigint;
403
+ maxFeePerGas?: bigint;
404
+ maxPriorityFeePerGas?: bigint;
405
+ nonce?: number;
406
+ value?: bigint;
407
+ }): Promise<`0x${string}`> {
408
+ if (!this.contract.write) {
409
+ throw new Error('Wallet client is required for write operations');
410
+ }
411
+ return this.contract.write.acceptOwnership(options) as Promise<`0x${string}`>;
412
+ }
413
+
414
+ /**
415
+ * changeEnableCoolDown
416
+ * nonpayable
417
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
418
+ */
419
+ async changeEnableCoolDown(_enableCoolDown: boolean, options?: {
420
+ accessList?: import('viem').AccessList;
421
+ authorizationList?: import('viem').AuthorizationList;
422
+ chain?: import('viem').Chain | null;
423
+ dataSuffix?: `0x${string}`;
424
+ gas?: bigint;
425
+ gasPrice?: bigint;
426
+ maxFeePerGas?: bigint;
427
+ maxPriorityFeePerGas?: bigint;
428
+ nonce?: number;
429
+ value?: bigint;
430
+ }): Promise<`0x${string}`> {
431
+ if (!this.contract.write) {
432
+ throw new Error('Wallet client is required for write operations');
433
+ }
434
+ return this.contract.write.changeEnableCoolDown([_enableCoolDown] as const, options) as Promise<`0x${string}`>;
435
+ }
436
+
437
+ /**
438
+ * changeManager
439
+ * nonpayable
440
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
441
+ */
442
+ async changeManager(_manager: `0x${string}`, options?: {
443
+ accessList?: import('viem').AccessList;
444
+ authorizationList?: import('viem').AuthorizationList;
445
+ chain?: import('viem').Chain | null;
446
+ dataSuffix?: `0x${string}`;
447
+ gas?: bigint;
448
+ gasPrice?: bigint;
449
+ maxFeePerGas?: bigint;
450
+ maxPriorityFeePerGas?: bigint;
451
+ nonce?: number;
452
+ value?: bigint;
453
+ }): Promise<`0x${string}`> {
454
+ if (!this.contract.write) {
455
+ throw new Error('Wallet client is required for write operations');
456
+ }
457
+ return this.contract.write.changeManager([_manager] as const, options) as Promise<`0x${string}`>;
458
+ }
459
+
460
+ /**
461
+ * defineCoolDown
462
+ * nonpayable
463
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
464
+ */
465
+ async defineCoolDown(_coolDown: bigint, options?: {
466
+ accessList?: import('viem').AccessList;
467
+ authorizationList?: import('viem').AuthorizationList;
468
+ chain?: import('viem').Chain | null;
469
+ dataSuffix?: `0x${string}`;
470
+ gas?: bigint;
471
+ gasPrice?: bigint;
472
+ maxFeePerGas?: bigint;
473
+ maxPriorityFeePerGas?: bigint;
474
+ nonce?: number;
475
+ value?: bigint;
476
+ }): Promise<`0x${string}`> {
477
+ if (!this.contract.write) {
478
+ throw new Error('Wallet client is required for write operations');
479
+ }
480
+ return this.contract.write.defineCoolDown([_coolDown] as const, options) as Promise<`0x${string}`>;
481
+ }
482
+
483
+ /**
484
+ * defineToken
485
+ * nonpayable
486
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
487
+ */
488
+ async defineToken(_token: `0x${string}`, options?: {
489
+ accessList?: import('viem').AccessList;
490
+ authorizationList?: import('viem').AuthorizationList;
491
+ chain?: import('viem').Chain | null;
492
+ dataSuffix?: `0x${string}`;
493
+ gas?: bigint;
494
+ gasPrice?: bigint;
495
+ maxFeePerGas?: bigint;
496
+ maxPriorityFeePerGas?: bigint;
497
+ nonce?: number;
498
+ value?: bigint;
499
+ }): Promise<`0x${string}`> {
500
+ if (!this.contract.write) {
501
+ throw new Error('Wallet client is required for write operations');
502
+ }
503
+ return this.contract.write.defineToken([_token] as const, options) as Promise<`0x${string}`>;
504
+ }
505
+
506
+ /**
507
+ * proposeOwner
508
+ * nonpayable
509
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
510
+ */
511
+ async proposeOwner(_owner: `0x${string}`, options?: {
512
+ accessList?: import('viem').AccessList;
513
+ authorizationList?: import('viem').AuthorizationList;
514
+ chain?: import('viem').Chain | null;
515
+ dataSuffix?: `0x${string}`;
516
+ gas?: bigint;
517
+ gasPrice?: bigint;
518
+ maxFeePerGas?: bigint;
519
+ maxPriorityFeePerGas?: bigint;
520
+ nonce?: number;
521
+ value?: bigint;
522
+ }): Promise<`0x${string}`> {
523
+ if (!this.contract.write) {
524
+ throw new Error('Wallet client is required for write operations');
525
+ }
526
+ return this.contract.write.proposeOwner([_owner] as const, options) as Promise<`0x${string}`>;
527
+ }
528
+
529
+ /**
530
+ * sendNative
531
+ * nonpayable
532
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
533
+ */
534
+ async sendNative(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
535
+ accessList?: import('viem').AccessList;
536
+ authorizationList?: import('viem').AuthorizationList;
537
+ chain?: import('viem').Chain | null;
538
+ dataSuffix?: `0x${string}`;
539
+ gas?: bigint;
540
+ gasPrice?: bigint;
541
+ maxFeePerGas?: bigint;
542
+ maxPriorityFeePerGas?: bigint;
543
+ nonce?: number;
544
+ value?: bigint;
545
+ }): Promise<`0x${string}`> {
546
+ if (!this.contract.write) {
547
+ throw new Error('Wallet client is required for write operations');
548
+ }
549
+ return this.contract.write.sendNative([_recipients, _amounts] as const, options) as Promise<`0x${string}`>;
550
+ }
551
+
552
+ /**
553
+ * sendTokens
554
+ * nonpayable
555
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
556
+ */
557
+ async sendTokens(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
558
+ accessList?: import('viem').AccessList;
559
+ authorizationList?: import('viem').AuthorizationList;
560
+ chain?: import('viem').Chain | null;
561
+ dataSuffix?: `0x${string}`;
562
+ gas?: bigint;
563
+ gasPrice?: bigint;
564
+ maxFeePerGas?: bigint;
565
+ maxPriorityFeePerGas?: bigint;
566
+ nonce?: number;
567
+ value?: bigint;
568
+ }): Promise<`0x${string}`> {
569
+ if (!this.contract.write) {
570
+ throw new Error('Wallet client is required for write operations');
571
+ }
572
+ return this.contract.write.sendTokens([_recipients, _amounts] as const, options) as Promise<`0x${string}`>;
573
+ }
574
+
575
+ /**
576
+ * setLastDistributed
577
+ * nonpayable
578
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
579
+ */
580
+ async setLastDistributed(_recipient: `0x${string}`, _time: bigint, options?: {
581
+ accessList?: import('viem').AccessList;
582
+ authorizationList?: import('viem').AuthorizationList;
583
+ chain?: import('viem').Chain | null;
584
+ dataSuffix?: `0x${string}`;
585
+ gas?: bigint;
586
+ gasPrice?: bigint;
587
+ maxFeePerGas?: bigint;
588
+ maxPriorityFeePerGas?: bigint;
589
+ nonce?: number;
590
+ value?: bigint;
591
+ }): Promise<`0x${string}`> {
592
+ if (!this.contract.write) {
593
+ throw new Error('Wallet client is required for write operations');
594
+ }
595
+ return this.contract.write.setLastDistributed([_recipient, _time] as const, options) as Promise<`0x${string}`>;
596
+ }
597
+
598
+
599
+
600
+ /**
601
+ * Simulate contract write operations (dry-run without sending transaction)
602
+ *
603
+ * @example
604
+ * const result = await contract.simulate.transfer('0x...', 1000n);
605
+ * console.log('Gas estimate:', result.request.gas);
606
+ * console.log('Would succeed:', result.result);
607
+ */
608
+ get simulate() {
609
+ const contract = this.contract;
610
+ if (!contract.simulate) {
611
+ throw new Error('Public client is required for simulation');
612
+ }
613
+ return {
614
+ /**
615
+ * Simulate acceptOwnership
616
+ * Returns gas estimate and result without sending transaction
617
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
618
+ */
619
+ async acceptOwnership(options?: {
620
+ accessList?: import('viem').AccessList;
621
+ authorizationList?: import('viem').AuthorizationList;
622
+ chain?: import('viem').Chain | null;
623
+ dataSuffix?: `0x${string}`;
624
+ gas?: bigint;
625
+ gasPrice?: bigint;
626
+ maxFeePerGas?: bigint;
627
+ maxPriorityFeePerGas?: bigint;
628
+ nonce?: number;
629
+ value?: bigint;
630
+ }): Promise<void> {
631
+ return contract.simulate.acceptOwnership(options) as Promise<void>;
632
+ },
633
+ /**
634
+ * Simulate changeEnableCoolDown
635
+ * Returns gas estimate and result without sending transaction
636
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
637
+ */
638
+ async changeEnableCoolDown(_enableCoolDown: boolean, options?: {
639
+ accessList?: import('viem').AccessList;
640
+ authorizationList?: import('viem').AuthorizationList;
641
+ chain?: import('viem').Chain | null;
642
+ dataSuffix?: `0x${string}`;
643
+ gas?: bigint;
644
+ gasPrice?: bigint;
645
+ maxFeePerGas?: bigint;
646
+ maxPriorityFeePerGas?: bigint;
647
+ nonce?: number;
648
+ value?: bigint;
649
+ }): Promise<void> {
650
+ return contract.simulate.changeEnableCoolDown([_enableCoolDown] as const, options) as Promise<void>;
651
+ },
652
+ /**
653
+ * Simulate changeManager
654
+ * Returns gas estimate and result without sending transaction
655
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
656
+ */
657
+ async changeManager(_manager: `0x${string}`, options?: {
658
+ accessList?: import('viem').AccessList;
659
+ authorizationList?: import('viem').AuthorizationList;
660
+ chain?: import('viem').Chain | null;
661
+ dataSuffix?: `0x${string}`;
662
+ gas?: bigint;
663
+ gasPrice?: bigint;
664
+ maxFeePerGas?: bigint;
665
+ maxPriorityFeePerGas?: bigint;
666
+ nonce?: number;
667
+ value?: bigint;
668
+ }): Promise<void> {
669
+ return contract.simulate.changeManager([_manager] as const, options) as Promise<void>;
670
+ },
671
+ /**
672
+ * Simulate defineCoolDown
673
+ * Returns gas estimate and result without sending transaction
674
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
675
+ */
676
+ async defineCoolDown(_coolDown: bigint, options?: {
677
+ accessList?: import('viem').AccessList;
678
+ authorizationList?: import('viem').AuthorizationList;
679
+ chain?: import('viem').Chain | null;
680
+ dataSuffix?: `0x${string}`;
681
+ gas?: bigint;
682
+ gasPrice?: bigint;
683
+ maxFeePerGas?: bigint;
684
+ maxPriorityFeePerGas?: bigint;
685
+ nonce?: number;
686
+ value?: bigint;
687
+ }): Promise<void> {
688
+ return contract.simulate.defineCoolDown([_coolDown] as const, options) as Promise<void>;
689
+ },
690
+ /**
691
+ * Simulate defineToken
692
+ * Returns gas estimate and result without sending transaction
693
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
694
+ */
695
+ async defineToken(_token: `0x${string}`, options?: {
696
+ accessList?: import('viem').AccessList;
697
+ authorizationList?: import('viem').AuthorizationList;
698
+ chain?: import('viem').Chain | null;
699
+ dataSuffix?: `0x${string}`;
700
+ gas?: bigint;
701
+ gasPrice?: bigint;
702
+ maxFeePerGas?: bigint;
703
+ maxPriorityFeePerGas?: bigint;
704
+ nonce?: number;
705
+ value?: bigint;
706
+ }): Promise<void> {
707
+ return contract.simulate.defineToken([_token] as const, options) as Promise<void>;
708
+ },
709
+ /**
710
+ * Simulate proposeOwner
711
+ * Returns gas estimate and result without sending transaction
712
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
713
+ */
714
+ async proposeOwner(_owner: `0x${string}`, options?: {
715
+ accessList?: import('viem').AccessList;
716
+ authorizationList?: import('viem').AuthorizationList;
717
+ chain?: import('viem').Chain | null;
718
+ dataSuffix?: `0x${string}`;
719
+ gas?: bigint;
720
+ gasPrice?: bigint;
721
+ maxFeePerGas?: bigint;
722
+ maxPriorityFeePerGas?: bigint;
723
+ nonce?: number;
724
+ value?: bigint;
725
+ }): Promise<void> {
726
+ return contract.simulate.proposeOwner([_owner] as const, options) as Promise<void>;
727
+ },
728
+ /**
729
+ * Simulate sendNative
730
+ * Returns gas estimate and result without sending transaction
731
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
732
+ */
733
+ async sendNative(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
734
+ accessList?: import('viem').AccessList;
735
+ authorizationList?: import('viem').AuthorizationList;
736
+ chain?: import('viem').Chain | null;
737
+ dataSuffix?: `0x${string}`;
738
+ gas?: bigint;
739
+ gasPrice?: bigint;
740
+ maxFeePerGas?: bigint;
741
+ maxPriorityFeePerGas?: bigint;
742
+ nonce?: number;
743
+ value?: bigint;
744
+ }): Promise<void> {
745
+ return contract.simulate.sendNative([_recipients, _amounts] as const, options) as Promise<void>;
746
+ },
747
+ /**
748
+ * Simulate sendTokens
749
+ * Returns gas estimate and result without sending transaction
750
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
751
+ */
752
+ async sendTokens(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
753
+ accessList?: import('viem').AccessList;
754
+ authorizationList?: import('viem').AuthorizationList;
755
+ chain?: import('viem').Chain | null;
756
+ dataSuffix?: `0x${string}`;
757
+ gas?: bigint;
758
+ gasPrice?: bigint;
759
+ maxFeePerGas?: bigint;
760
+ maxPriorityFeePerGas?: bigint;
761
+ nonce?: number;
762
+ value?: bigint;
763
+ }): Promise<void> {
764
+ return contract.simulate.sendTokens([_recipients, _amounts] as const, options) as Promise<void>;
765
+ },
766
+ /**
767
+ * Simulate setLastDistributed
768
+ * Returns gas estimate and result without sending transaction
769
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
770
+ */
771
+ async setLastDistributed(_recipient: `0x${string}`, _time: bigint, options?: {
772
+ accessList?: import('viem').AccessList;
773
+ authorizationList?: import('viem').AuthorizationList;
774
+ chain?: import('viem').Chain | null;
775
+ dataSuffix?: `0x${string}`;
776
+ gas?: bigint;
777
+ gasPrice?: bigint;
778
+ maxFeePerGas?: bigint;
779
+ maxPriorityFeePerGas?: bigint;
780
+ nonce?: number;
781
+ value?: bigint;
782
+ }): Promise<void> {
783
+ return contract.simulate.setLastDistributed([_recipient, _time] as const, options) as Promise<void>;
784
+ }
785
+ };
786
+ }
787
+
788
+ /**
789
+ * Watch contract events
790
+ *
791
+ * @example
792
+ * // Watch all Transfer events
793
+ * const unwatch = contract.watch.Transfer((event) => {
794
+ * console.log('Transfer:', event);
795
+ * });
796
+ *
797
+ * // Stop watching
798
+ * unwatch();
799
+ */
800
+ get watch() {
801
+ return {
802
+ /**
803
+ * Watch Received events
804
+ * @param callback Function to call when event is emitted
805
+ * @param filter Optional filter for indexed parameters
806
+ * @returns Unwatch function to stop listening
807
+ */
808
+ Received: (callback: (event: { sender: `0x${string}`; value: bigint }) => void, filter?: { sender: `0x${string}` }) => {
809
+ return this.publicClient.watchContractEvent({
810
+ address: this.contractAddress,
811
+ abi: TokenDistributor_jsonAbi,
812
+ eventName: 'Received',
813
+ args: filter,
814
+ onLogs: (logs: any[]) => {
815
+ logs.forEach((log: any) => {
816
+ callback(log.args as any);
817
+ });
818
+ },
819
+ }) as () => void;
820
+ }
821
+ };
822
+ }
823
+ }