@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,628 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * TokenDistributor_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const TokenDistributor_jsonAbi: readonly [{
8
+ readonly inputs: readonly [];
9
+ readonly stateMutability: "nonpayable";
10
+ readonly type: "constructor";
11
+ }, {
12
+ readonly inputs: readonly [{
13
+ readonly internalType: "address";
14
+ readonly name: "token";
15
+ readonly type: "address";
16
+ }];
17
+ readonly name: "SafeERC20FailedOperation";
18
+ readonly type: "error";
19
+ }, {
20
+ readonly anonymous: false;
21
+ readonly inputs: readonly [{
22
+ readonly indexed: true;
23
+ readonly internalType: "address";
24
+ readonly name: "sender";
25
+ readonly type: "address";
26
+ }, {
27
+ readonly indexed: false;
28
+ readonly internalType: "uint256";
29
+ readonly name: "value";
30
+ readonly type: "uint256";
31
+ }];
32
+ readonly name: "Received";
33
+ readonly type: "event";
34
+ }, {
35
+ readonly inputs: readonly [];
36
+ readonly name: "acceptOwnership";
37
+ readonly outputs: readonly [];
38
+ readonly stateMutability: "nonpayable";
39
+ readonly type: "function";
40
+ }, {
41
+ readonly inputs: readonly [{
42
+ readonly internalType: "bool";
43
+ readonly name: "_enableCoolDown";
44
+ readonly type: "bool";
45
+ }];
46
+ readonly name: "changeEnableCoolDown";
47
+ readonly outputs: readonly [];
48
+ readonly stateMutability: "nonpayable";
49
+ readonly type: "function";
50
+ }, {
51
+ readonly inputs: readonly [{
52
+ readonly internalType: "address";
53
+ readonly name: "_manager";
54
+ readonly type: "address";
55
+ }];
56
+ readonly name: "changeManager";
57
+ readonly outputs: readonly [];
58
+ readonly stateMutability: "nonpayable";
59
+ readonly type: "function";
60
+ }, {
61
+ readonly inputs: readonly [];
62
+ readonly name: "coolDown";
63
+ readonly outputs: readonly [{
64
+ readonly internalType: "uint256";
65
+ readonly name: "";
66
+ readonly type: "uint256";
67
+ }];
68
+ readonly stateMutability: "view";
69
+ readonly type: "function";
70
+ }, {
71
+ readonly inputs: readonly [{
72
+ readonly internalType: "uint256";
73
+ readonly name: "_coolDown";
74
+ readonly type: "uint256";
75
+ }];
76
+ readonly name: "defineCoolDown";
77
+ readonly outputs: readonly [];
78
+ readonly stateMutability: "nonpayable";
79
+ readonly type: "function";
80
+ }, {
81
+ readonly inputs: readonly [{
82
+ readonly internalType: "address";
83
+ readonly name: "_token";
84
+ readonly type: "address";
85
+ }];
86
+ readonly name: "defineToken";
87
+ readonly outputs: readonly [];
88
+ readonly stateMutability: "nonpayable";
89
+ readonly type: "function";
90
+ }, {
91
+ readonly inputs: readonly [{
92
+ readonly internalType: "address";
93
+ readonly name: "";
94
+ readonly type: "address";
95
+ }];
96
+ readonly name: "lastDistributed";
97
+ readonly outputs: readonly [{
98
+ readonly internalType: "uint256";
99
+ readonly name: "";
100
+ readonly type: "uint256";
101
+ }];
102
+ readonly stateMutability: "view";
103
+ readonly type: "function";
104
+ }, {
105
+ readonly inputs: readonly [];
106
+ readonly name: "manager";
107
+ readonly outputs: readonly [{
108
+ readonly internalType: "address";
109
+ readonly name: "";
110
+ readonly type: "address";
111
+ }];
112
+ readonly stateMutability: "view";
113
+ readonly type: "function";
114
+ }, {
115
+ readonly inputs: readonly [];
116
+ readonly name: "owner";
117
+ readonly outputs: readonly [{
118
+ readonly internalType: "address";
119
+ readonly name: "";
120
+ readonly type: "address";
121
+ }];
122
+ readonly stateMutability: "view";
123
+ readonly type: "function";
124
+ }, {
125
+ readonly inputs: readonly [{
126
+ readonly internalType: "address";
127
+ readonly name: "_owner";
128
+ readonly type: "address";
129
+ }];
130
+ readonly name: "proposeOwner";
131
+ readonly outputs: readonly [];
132
+ readonly stateMutability: "nonpayable";
133
+ readonly type: "function";
134
+ }, {
135
+ readonly inputs: readonly [];
136
+ readonly name: "proposedOwner";
137
+ readonly outputs: readonly [{
138
+ readonly internalType: "address";
139
+ readonly name: "";
140
+ readonly type: "address";
141
+ }];
142
+ readonly stateMutability: "view";
143
+ readonly type: "function";
144
+ }, {
145
+ readonly inputs: readonly [{
146
+ readonly internalType: "address[]";
147
+ readonly name: "_recipients";
148
+ readonly type: "address[]";
149
+ }, {
150
+ readonly internalType: "uint256[]";
151
+ readonly name: "_amounts";
152
+ readonly type: "uint256[]";
153
+ }];
154
+ readonly name: "sendNative";
155
+ readonly outputs: readonly [];
156
+ readonly stateMutability: "nonpayable";
157
+ readonly type: "function";
158
+ }, {
159
+ readonly inputs: readonly [{
160
+ readonly internalType: "address[]";
161
+ readonly name: "_recipients";
162
+ readonly type: "address[]";
163
+ }, {
164
+ readonly internalType: "uint256[]";
165
+ readonly name: "_amounts";
166
+ readonly type: "uint256[]";
167
+ }];
168
+ readonly name: "sendTokens";
169
+ readonly outputs: readonly [];
170
+ readonly stateMutability: "nonpayable";
171
+ readonly type: "function";
172
+ }, {
173
+ readonly inputs: readonly [{
174
+ readonly internalType: "address";
175
+ readonly name: "_recipient";
176
+ readonly type: "address";
177
+ }, {
178
+ readonly internalType: "uint256";
179
+ readonly name: "_time";
180
+ readonly type: "uint256";
181
+ }];
182
+ readonly name: "setLastDistributed";
183
+ readonly outputs: readonly [];
184
+ readonly stateMutability: "nonpayable";
185
+ readonly type: "function";
186
+ }, {
187
+ readonly inputs: readonly [];
188
+ readonly name: "token";
189
+ readonly outputs: readonly [{
190
+ readonly internalType: "address";
191
+ readonly name: "";
192
+ readonly type: "address";
193
+ }];
194
+ readonly stateMutability: "view";
195
+ readonly type: "function";
196
+ }, {
197
+ readonly stateMutability: "payable";
198
+ readonly type: "receive";
199
+ }];
200
+ /**
201
+ * Type-safe ABI for TokenDistributor_json
202
+ */
203
+ export type TokenDistributor_jsonAbi = typeof TokenDistributor_jsonAbi;
204
+ /**
205
+ * Contract instance type for TokenDistributor_json
206
+ */
207
+ export type TokenDistributor_jsonContract = any;
208
+ /**
209
+ * TokenDistributor_json Contract Class
210
+ *
211
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
212
+ *
213
+ * @example
214
+ * ```typescript
215
+ * import { createPublicClient, createWalletClient, http } from 'viem';
216
+ * import { mainnet } from 'viem/chains';
217
+ * import { TokenDistributor_json } from 'TokenDistributor_json';
218
+ *
219
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
220
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
221
+ *
222
+ * const contract = new TokenDistributor_json('0x...', { publicClient, walletClient });
223
+ *
224
+ * // Read functions
225
+ * const result = await contract.balanceOf('0x...');
226
+ *
227
+ * // Write functions
228
+ * const hash = await contract.transfer('0x...', 1000n);
229
+ *
230
+ * // Simulate transactions (dry-run)
231
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
232
+ * console.log('Gas estimate:', simulation.request.gas);
233
+ *
234
+ * // Watch events
235
+ * const unwatch = contract.watch.Transfer((event) => {
236
+ * console.log('Transfer event:', event);
237
+ * });
238
+ * ```
239
+ */
240
+ export declare class TokenDistributor_json {
241
+ private contract;
242
+ private contractAddress;
243
+ private publicClient;
244
+ constructor(address: Address, clients: {
245
+ publicClient: PublicClient;
246
+ walletClient?: WalletClient;
247
+ });
248
+ /**
249
+ * Get the contract address
250
+ */
251
+ get address(): Address;
252
+ /**
253
+ * Get the underlying viem contract instance
254
+ */
255
+ getContract(): TokenDistributor_jsonContract;
256
+ /**
257
+ * coolDown
258
+ * view
259
+ */
260
+ coolDown(): Promise<bigint>;
261
+ /**
262
+ * lastDistributed
263
+ * view
264
+ */
265
+ lastDistributed(arg0: `0x${string}`): Promise<bigint>;
266
+ /**
267
+ * manager
268
+ * view
269
+ */
270
+ manager(): Promise<`0x${string}`>;
271
+ /**
272
+ * owner
273
+ * view
274
+ */
275
+ owner(): Promise<`0x${string}`>;
276
+ /**
277
+ * proposedOwner
278
+ * view
279
+ */
280
+ proposedOwner(): Promise<`0x${string}`>;
281
+ /**
282
+ * token
283
+ * view
284
+ */
285
+ token(): Promise<`0x${string}`>;
286
+ /**
287
+ * acceptOwnership
288
+ * nonpayable
289
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
290
+ */
291
+ acceptOwnership(options?: {
292
+ accessList?: import('viem').AccessList;
293
+ authorizationList?: import('viem').AuthorizationList;
294
+ chain?: import('viem').Chain | null;
295
+ dataSuffix?: `0x${string}`;
296
+ gas?: bigint;
297
+ gasPrice?: bigint;
298
+ maxFeePerGas?: bigint;
299
+ maxPriorityFeePerGas?: bigint;
300
+ nonce?: number;
301
+ value?: bigint;
302
+ }): Promise<`0x${string}`>;
303
+ /**
304
+ * changeEnableCoolDown
305
+ * nonpayable
306
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
307
+ */
308
+ changeEnableCoolDown(_enableCoolDown: boolean, options?: {
309
+ accessList?: import('viem').AccessList;
310
+ authorizationList?: import('viem').AuthorizationList;
311
+ chain?: import('viem').Chain | null;
312
+ dataSuffix?: `0x${string}`;
313
+ gas?: bigint;
314
+ gasPrice?: bigint;
315
+ maxFeePerGas?: bigint;
316
+ maxPriorityFeePerGas?: bigint;
317
+ nonce?: number;
318
+ value?: bigint;
319
+ }): Promise<`0x${string}`>;
320
+ /**
321
+ * changeManager
322
+ * nonpayable
323
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
324
+ */
325
+ changeManager(_manager: `0x${string}`, options?: {
326
+ accessList?: import('viem').AccessList;
327
+ authorizationList?: import('viem').AuthorizationList;
328
+ chain?: import('viem').Chain | null;
329
+ dataSuffix?: `0x${string}`;
330
+ gas?: bigint;
331
+ gasPrice?: bigint;
332
+ maxFeePerGas?: bigint;
333
+ maxPriorityFeePerGas?: bigint;
334
+ nonce?: number;
335
+ value?: bigint;
336
+ }): Promise<`0x${string}`>;
337
+ /**
338
+ * defineCoolDown
339
+ * nonpayable
340
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
341
+ */
342
+ defineCoolDown(_coolDown: bigint, options?: {
343
+ accessList?: import('viem').AccessList;
344
+ authorizationList?: import('viem').AuthorizationList;
345
+ chain?: import('viem').Chain | null;
346
+ dataSuffix?: `0x${string}`;
347
+ gas?: bigint;
348
+ gasPrice?: bigint;
349
+ maxFeePerGas?: bigint;
350
+ maxPriorityFeePerGas?: bigint;
351
+ nonce?: number;
352
+ value?: bigint;
353
+ }): Promise<`0x${string}`>;
354
+ /**
355
+ * defineToken
356
+ * nonpayable
357
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
358
+ */
359
+ defineToken(_token: `0x${string}`, options?: {
360
+ accessList?: import('viem').AccessList;
361
+ authorizationList?: import('viem').AuthorizationList;
362
+ chain?: import('viem').Chain | null;
363
+ dataSuffix?: `0x${string}`;
364
+ gas?: bigint;
365
+ gasPrice?: bigint;
366
+ maxFeePerGas?: bigint;
367
+ maxPriorityFeePerGas?: bigint;
368
+ nonce?: number;
369
+ value?: bigint;
370
+ }): Promise<`0x${string}`>;
371
+ /**
372
+ * proposeOwner
373
+ * nonpayable
374
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
375
+ */
376
+ proposeOwner(_owner: `0x${string}`, options?: {
377
+ accessList?: import('viem').AccessList;
378
+ authorizationList?: import('viem').AuthorizationList;
379
+ chain?: import('viem').Chain | null;
380
+ dataSuffix?: `0x${string}`;
381
+ gas?: bigint;
382
+ gasPrice?: bigint;
383
+ maxFeePerGas?: bigint;
384
+ maxPriorityFeePerGas?: bigint;
385
+ nonce?: number;
386
+ value?: bigint;
387
+ }): Promise<`0x${string}`>;
388
+ /**
389
+ * sendNative
390
+ * nonpayable
391
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
392
+ */
393
+ sendNative(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
394
+ accessList?: import('viem').AccessList;
395
+ authorizationList?: import('viem').AuthorizationList;
396
+ chain?: import('viem').Chain | null;
397
+ dataSuffix?: `0x${string}`;
398
+ gas?: bigint;
399
+ gasPrice?: bigint;
400
+ maxFeePerGas?: bigint;
401
+ maxPriorityFeePerGas?: bigint;
402
+ nonce?: number;
403
+ value?: bigint;
404
+ }): Promise<`0x${string}`>;
405
+ /**
406
+ * sendTokens
407
+ * nonpayable
408
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
409
+ */
410
+ sendTokens(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
411
+ accessList?: import('viem').AccessList;
412
+ authorizationList?: import('viem').AuthorizationList;
413
+ chain?: import('viem').Chain | null;
414
+ dataSuffix?: `0x${string}`;
415
+ gas?: bigint;
416
+ gasPrice?: bigint;
417
+ maxFeePerGas?: bigint;
418
+ maxPriorityFeePerGas?: bigint;
419
+ nonce?: number;
420
+ value?: bigint;
421
+ }): Promise<`0x${string}`>;
422
+ /**
423
+ * setLastDistributed
424
+ * nonpayable
425
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
426
+ */
427
+ setLastDistributed(_recipient: `0x${string}`, _time: bigint, options?: {
428
+ accessList?: import('viem').AccessList;
429
+ authorizationList?: import('viem').AuthorizationList;
430
+ chain?: import('viem').Chain | null;
431
+ dataSuffix?: `0x${string}`;
432
+ gas?: bigint;
433
+ gasPrice?: bigint;
434
+ maxFeePerGas?: bigint;
435
+ maxPriorityFeePerGas?: bigint;
436
+ nonce?: number;
437
+ value?: bigint;
438
+ }): Promise<`0x${string}`>;
439
+ /**
440
+ * Simulate contract write operations (dry-run without sending transaction)
441
+ *
442
+ * @example
443
+ * const result = await contract.simulate.transfer('0x...', 1000n);
444
+ * console.log('Gas estimate:', result.request.gas);
445
+ * console.log('Would succeed:', result.result);
446
+ */
447
+ get simulate(): {
448
+ /**
449
+ * Simulate acceptOwnership
450
+ * Returns gas estimate and result without sending transaction
451
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
452
+ */
453
+ acceptOwnership(options?: {
454
+ accessList?: import("viem").AccessList;
455
+ authorizationList?: import("viem").AuthorizationList;
456
+ chain?: import("viem").Chain | null;
457
+ dataSuffix?: `0x${string}`;
458
+ gas?: bigint;
459
+ gasPrice?: bigint;
460
+ maxFeePerGas?: bigint;
461
+ maxPriorityFeePerGas?: bigint;
462
+ nonce?: number;
463
+ value?: bigint;
464
+ }): Promise<void>;
465
+ /**
466
+ * Simulate changeEnableCoolDown
467
+ * Returns gas estimate and result without sending transaction
468
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
469
+ */
470
+ changeEnableCoolDown(_enableCoolDown: boolean, options?: {
471
+ accessList?: import("viem").AccessList;
472
+ authorizationList?: import("viem").AuthorizationList;
473
+ chain?: import("viem").Chain | null;
474
+ dataSuffix?: `0x${string}`;
475
+ gas?: bigint;
476
+ gasPrice?: bigint;
477
+ maxFeePerGas?: bigint;
478
+ maxPriorityFeePerGas?: bigint;
479
+ nonce?: number;
480
+ value?: bigint;
481
+ }): Promise<void>;
482
+ /**
483
+ * Simulate changeManager
484
+ * Returns gas estimate and result without sending transaction
485
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
486
+ */
487
+ changeManager(_manager: `0x${string}`, options?: {
488
+ accessList?: import("viem").AccessList;
489
+ authorizationList?: import("viem").AuthorizationList;
490
+ chain?: import("viem").Chain | null;
491
+ dataSuffix?: `0x${string}`;
492
+ gas?: bigint;
493
+ gasPrice?: bigint;
494
+ maxFeePerGas?: bigint;
495
+ maxPriorityFeePerGas?: bigint;
496
+ nonce?: number;
497
+ value?: bigint;
498
+ }): Promise<void>;
499
+ /**
500
+ * Simulate defineCoolDown
501
+ * Returns gas estimate and result without sending transaction
502
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
503
+ */
504
+ defineCoolDown(_coolDown: bigint, options?: {
505
+ accessList?: import("viem").AccessList;
506
+ authorizationList?: import("viem").AuthorizationList;
507
+ chain?: import("viem").Chain | null;
508
+ dataSuffix?: `0x${string}`;
509
+ gas?: bigint;
510
+ gasPrice?: bigint;
511
+ maxFeePerGas?: bigint;
512
+ maxPriorityFeePerGas?: bigint;
513
+ nonce?: number;
514
+ value?: bigint;
515
+ }): Promise<void>;
516
+ /**
517
+ * Simulate defineToken
518
+ * Returns gas estimate and result without sending transaction
519
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
520
+ */
521
+ defineToken(_token: `0x${string}`, options?: {
522
+ accessList?: import("viem").AccessList;
523
+ authorizationList?: import("viem").AuthorizationList;
524
+ chain?: import("viem").Chain | null;
525
+ dataSuffix?: `0x${string}`;
526
+ gas?: bigint;
527
+ gasPrice?: bigint;
528
+ maxFeePerGas?: bigint;
529
+ maxPriorityFeePerGas?: bigint;
530
+ nonce?: number;
531
+ value?: bigint;
532
+ }): Promise<void>;
533
+ /**
534
+ * Simulate proposeOwner
535
+ * Returns gas estimate and result without sending transaction
536
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
537
+ */
538
+ proposeOwner(_owner: `0x${string}`, options?: {
539
+ accessList?: import("viem").AccessList;
540
+ authorizationList?: import("viem").AuthorizationList;
541
+ chain?: import("viem").Chain | null;
542
+ dataSuffix?: `0x${string}`;
543
+ gas?: bigint;
544
+ gasPrice?: bigint;
545
+ maxFeePerGas?: bigint;
546
+ maxPriorityFeePerGas?: bigint;
547
+ nonce?: number;
548
+ value?: bigint;
549
+ }): Promise<void>;
550
+ /**
551
+ * Simulate sendNative
552
+ * Returns gas estimate and result without sending transaction
553
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
554
+ */
555
+ sendNative(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
556
+ accessList?: import("viem").AccessList;
557
+ authorizationList?: import("viem").AuthorizationList;
558
+ chain?: import("viem").Chain | null;
559
+ dataSuffix?: `0x${string}`;
560
+ gas?: bigint;
561
+ gasPrice?: bigint;
562
+ maxFeePerGas?: bigint;
563
+ maxPriorityFeePerGas?: bigint;
564
+ nonce?: number;
565
+ value?: bigint;
566
+ }): Promise<void>;
567
+ /**
568
+ * Simulate sendTokens
569
+ * Returns gas estimate and result without sending transaction
570
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
571
+ */
572
+ sendTokens(_recipients: `0x${string}`[], _amounts: bigint[], options?: {
573
+ accessList?: import("viem").AccessList;
574
+ authorizationList?: import("viem").AuthorizationList;
575
+ chain?: import("viem").Chain | null;
576
+ dataSuffix?: `0x${string}`;
577
+ gas?: bigint;
578
+ gasPrice?: bigint;
579
+ maxFeePerGas?: bigint;
580
+ maxPriorityFeePerGas?: bigint;
581
+ nonce?: number;
582
+ value?: bigint;
583
+ }): Promise<void>;
584
+ /**
585
+ * Simulate setLastDistributed
586
+ * Returns gas estimate and result without sending transaction
587
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
588
+ */
589
+ setLastDistributed(_recipient: `0x${string}`, _time: bigint, options?: {
590
+ accessList?: import("viem").AccessList;
591
+ authorizationList?: import("viem").AuthorizationList;
592
+ chain?: import("viem").Chain | null;
593
+ dataSuffix?: `0x${string}`;
594
+ gas?: bigint;
595
+ gasPrice?: bigint;
596
+ maxFeePerGas?: bigint;
597
+ maxPriorityFeePerGas?: bigint;
598
+ nonce?: number;
599
+ value?: bigint;
600
+ }): Promise<void>;
601
+ };
602
+ /**
603
+ * Watch contract events
604
+ *
605
+ * @example
606
+ * // Watch all Transfer events
607
+ * const unwatch = contract.watch.Transfer((event) => {
608
+ * console.log('Transfer:', event);
609
+ * });
610
+ *
611
+ * // Stop watching
612
+ * unwatch();
613
+ */
614
+ get watch(): {
615
+ /**
616
+ * Watch Received events
617
+ * @param callback Function to call when event is emitted
618
+ * @param filter Optional filter for indexed parameters
619
+ * @returns Unwatch function to stop listening
620
+ */
621
+ Received: (callback: (event: {
622
+ sender: `0x${string}`;
623
+ value: bigint;
624
+ }) => void, filter?: {
625
+ sender: `0x${string}`;
626
+ }) => () => void;
627
+ };
628
+ }