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