@gitmyabi/doge20 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,1002 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * Token_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const Token_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": "from",
89
+ "type": "address"
90
+ },
91
+ {
92
+ "internalType": "address",
93
+ "name": "to",
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": "to",
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
+ "name": "decimals",
167
+ "outputs": [
168
+ {
169
+ "internalType": "uint8",
170
+ "name": "",
171
+ "type": "uint8"
172
+ }
173
+ ],
174
+ "stateMutability": "view",
175
+ "type": "function"
176
+ },
177
+ {
178
+ "inputs": [
179
+ {
180
+ "internalType": "address",
181
+ "name": "to",
182
+ "type": "address"
183
+ },
184
+ {
185
+ "internalType": "uint256",
186
+ "name": "subtractedValue",
187
+ "type": "uint256"
188
+ }
189
+ ],
190
+ "name": "decreaseAllowance",
191
+ "outputs": [
192
+ {
193
+ "internalType": "bool",
194
+ "name": "",
195
+ "type": "bool"
196
+ }
197
+ ],
198
+ "stateMutability": "nonpayable",
199
+ "type": "function"
200
+ },
201
+ {
202
+ "inputs": [
203
+ {
204
+ "internalType": "address",
205
+ "name": "to",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "internalType": "uint256",
210
+ "name": "addedValue",
211
+ "type": "uint256"
212
+ }
213
+ ],
214
+ "name": "increaseAllowance",
215
+ "outputs": [
216
+ {
217
+ "internalType": "bool",
218
+ "name": "",
219
+ "type": "bool"
220
+ }
221
+ ],
222
+ "stateMutability": "nonpayable",
223
+ "type": "function"
224
+ },
225
+ {
226
+ "inputs": [],
227
+ "name": "liquidityReserve",
228
+ "outputs": [
229
+ {
230
+ "internalType": "uint256",
231
+ "name": "",
232
+ "type": "uint256"
233
+ }
234
+ ],
235
+ "stateMutability": "view",
236
+ "type": "function"
237
+ },
238
+ {
239
+ "inputs": [],
240
+ "name": "name",
241
+ "outputs": [
242
+ {
243
+ "internalType": "string",
244
+ "name": "",
245
+ "type": "string"
246
+ }
247
+ ],
248
+ "stateMutability": "view",
249
+ "type": "function"
250
+ },
251
+ {
252
+ "inputs": [],
253
+ "name": "owner",
254
+ "outputs": [
255
+ {
256
+ "internalType": "address",
257
+ "name": "",
258
+ "type": "address"
259
+ }
260
+ ],
261
+ "stateMutability": "view",
262
+ "type": "function"
263
+ },
264
+ {
265
+ "inputs": [],
266
+ "name": "presaleReserve",
267
+ "outputs": [
268
+ {
269
+ "internalType": "uint256",
270
+ "name": "",
271
+ "type": "uint256"
272
+ }
273
+ ],
274
+ "stateMutability": "view",
275
+ "type": "function"
276
+ },
277
+ {
278
+ "inputs": [],
279
+ "name": "projectFundReserve",
280
+ "outputs": [
281
+ {
282
+ "internalType": "uint256",
283
+ "name": "",
284
+ "type": "uint256"
285
+ }
286
+ ],
287
+ "stateMutability": "view",
288
+ "type": "function"
289
+ },
290
+ {
291
+ "inputs": [],
292
+ "name": "renounceOwnership",
293
+ "outputs": [],
294
+ "stateMutability": "nonpayable",
295
+ "type": "function"
296
+ },
297
+ {
298
+ "inputs": [],
299
+ "name": "stakingReserve",
300
+ "outputs": [
301
+ {
302
+ "internalType": "uint256",
303
+ "name": "",
304
+ "type": "uint256"
305
+ }
306
+ ],
307
+ "stateMutability": "view",
308
+ "type": "function"
309
+ },
310
+ {
311
+ "inputs": [],
312
+ "name": "symbol",
313
+ "outputs": [
314
+ {
315
+ "internalType": "string",
316
+ "name": "",
317
+ "type": "string"
318
+ }
319
+ ],
320
+ "stateMutability": "view",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "inputs": [],
325
+ "name": "totalSupply",
326
+ "outputs": [
327
+ {
328
+ "internalType": "uint256",
329
+ "name": "",
330
+ "type": "uint256"
331
+ }
332
+ ],
333
+ "stateMutability": "view",
334
+ "type": "function"
335
+ },
336
+ {
337
+ "inputs": [
338
+ {
339
+ "internalType": "address",
340
+ "name": "recipient",
341
+ "type": "address"
342
+ },
343
+ {
344
+ "internalType": "uint256",
345
+ "name": "amount",
346
+ "type": "uint256"
347
+ }
348
+ ],
349
+ "name": "transfer",
350
+ "outputs": [
351
+ {
352
+ "internalType": "bool",
353
+ "name": "",
354
+ "type": "bool"
355
+ }
356
+ ],
357
+ "stateMutability": "nonpayable",
358
+ "type": "function"
359
+ },
360
+ {
361
+ "inputs": [
362
+ {
363
+ "internalType": "address",
364
+ "name": "sender",
365
+ "type": "address"
366
+ },
367
+ {
368
+ "internalType": "address",
369
+ "name": "recipient",
370
+ "type": "address"
371
+ },
372
+ {
373
+ "internalType": "uint256",
374
+ "name": "amount",
375
+ "type": "uint256"
376
+ }
377
+ ],
378
+ "name": "transferFrom",
379
+ "outputs": [
380
+ {
381
+ "internalType": "bool",
382
+ "name": "",
383
+ "type": "bool"
384
+ }
385
+ ],
386
+ "stateMutability": "nonpayable",
387
+ "type": "function"
388
+ },
389
+ {
390
+ "inputs": [
391
+ {
392
+ "internalType": "address",
393
+ "name": "newOwner",
394
+ "type": "address"
395
+ }
396
+ ],
397
+ "name": "transferOwnership",
398
+ "outputs": [],
399
+ "stateMutability": "nonpayable",
400
+ "type": "function"
401
+ }
402
+ ] as const satisfies Abi;
403
+
404
+ /**
405
+ * Type-safe ABI for Token_json
406
+ */
407
+ export type Token_jsonAbi = typeof Token_jsonAbi;
408
+
409
+ /**
410
+ * Contract instance type for Token_json
411
+ */
412
+ // Use any for contract type to avoid complex viem type issues
413
+ // The runtime behavior is type-safe through viem's ABI typing
414
+ export type Token_jsonContract = any;
415
+
416
+ /**
417
+ * Token_json Contract Class
418
+ *
419
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
420
+ *
421
+ * @example
422
+ * ```typescript
423
+ * import { createPublicClient, createWalletClient, http } from 'viem';
424
+ * import { mainnet } from 'viem/chains';
425
+ * import { Token_json } from 'Token_json';
426
+ *
427
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
428
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
429
+ *
430
+ * const contract = new Token_json('0x...', { publicClient, walletClient });
431
+ *
432
+ * // Read functions
433
+ * const result = await contract.balanceOf('0x...');
434
+ *
435
+ * // Write functions
436
+ * const hash = await contract.transfer('0x...', 1000n);
437
+ *
438
+ * // Simulate transactions (dry-run)
439
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
440
+ * console.log('Gas estimate:', simulation.request.gas);
441
+ *
442
+ * // Watch events
443
+ * const unwatch = contract.watch.Transfer((event) => {
444
+ * console.log('Transfer event:', event);
445
+ * });
446
+ * ```
447
+ */
448
+ export class Token_json {
449
+ private contract: Token_jsonContract;
450
+ private contractAddress: Address;
451
+ private publicClient: PublicClient;
452
+
453
+ constructor(
454
+ address: Address,
455
+ clients: {
456
+ publicClient: PublicClient;
457
+ walletClient?: WalletClient;
458
+ }
459
+ ) {
460
+ this.contractAddress = address;
461
+ this.publicClient = clients.publicClient;
462
+ this.contract = getContract({
463
+ address,
464
+ abi: Token_jsonAbi,
465
+ client: {
466
+ public: clients.publicClient,
467
+ wallet: clients.walletClient,
468
+ },
469
+ });
470
+ }
471
+
472
+ /**
473
+ * Get the contract address
474
+ */
475
+ get address(): Address {
476
+ return this.contractAddress;
477
+ }
478
+
479
+ /**
480
+ * Get the underlying viem contract instance
481
+ */
482
+ getContract(): Token_jsonContract {
483
+ return this.contract;
484
+ }
485
+
486
+ /**
487
+ * allowance
488
+ * view
489
+ */
490
+ async allowance(from: `0x${string}`, to: `0x${string}`): Promise<bigint> {
491
+ return this.contract.read.allowance([from, to] as const) as Promise<bigint>;
492
+ }
493
+
494
+ /**
495
+ * balanceOf
496
+ * view
497
+ */
498
+ async balanceOf(account: `0x${string}`): Promise<bigint> {
499
+ return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
500
+ }
501
+
502
+ /**
503
+ * decimals
504
+ * view
505
+ */
506
+ async decimals(): Promise<bigint> {
507
+ return this.contract.read.decimals() as Promise<bigint>;
508
+ }
509
+
510
+ /**
511
+ * liquidityReserve
512
+ * view
513
+ */
514
+ async liquidityReserve(): Promise<bigint> {
515
+ return this.contract.read.liquidityReserve() as Promise<bigint>;
516
+ }
517
+
518
+ /**
519
+ * name
520
+ * view
521
+ */
522
+ async name(): Promise<string> {
523
+ return this.contract.read.name() as Promise<string>;
524
+ }
525
+
526
+ /**
527
+ * owner
528
+ * view
529
+ */
530
+ async owner(): Promise<`0x${string}`> {
531
+ return this.contract.read.owner() as Promise<`0x${string}`>;
532
+ }
533
+
534
+ /**
535
+ * presaleReserve
536
+ * view
537
+ */
538
+ async presaleReserve(): Promise<bigint> {
539
+ return this.contract.read.presaleReserve() as Promise<bigint>;
540
+ }
541
+
542
+ /**
543
+ * projectFundReserve
544
+ * view
545
+ */
546
+ async projectFundReserve(): Promise<bigint> {
547
+ return this.contract.read.projectFundReserve() as Promise<bigint>;
548
+ }
549
+
550
+ /**
551
+ * stakingReserve
552
+ * view
553
+ */
554
+ async stakingReserve(): Promise<bigint> {
555
+ return this.contract.read.stakingReserve() as Promise<bigint>;
556
+ }
557
+
558
+ /**
559
+ * symbol
560
+ * view
561
+ */
562
+ async symbol(): Promise<string> {
563
+ return this.contract.read.symbol() as Promise<string>;
564
+ }
565
+
566
+ /**
567
+ * totalSupply
568
+ * view
569
+ */
570
+ async totalSupply(): Promise<bigint> {
571
+ return this.contract.read.totalSupply() as Promise<bigint>;
572
+ }
573
+
574
+ /**
575
+ * approve
576
+ * nonpayable
577
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
578
+ */
579
+ async approve(to: `0x${string}`, amount: bigint, options?: {
580
+ accessList?: import('viem').AccessList;
581
+ authorizationList?: import('viem').AuthorizationList;
582
+ chain?: import('viem').Chain | null;
583
+ dataSuffix?: `0x${string}`;
584
+ gas?: bigint;
585
+ gasPrice?: bigint;
586
+ maxFeePerGas?: bigint;
587
+ maxPriorityFeePerGas?: bigint;
588
+ nonce?: number;
589
+ value?: bigint;
590
+ }): Promise<`0x${string}`> {
591
+ if (!this.contract.write) {
592
+ throw new Error('Wallet client is required for write operations');
593
+ }
594
+ return this.contract.write.approve([to, amount] as const, options) as Promise<`0x${string}`>;
595
+ }
596
+
597
+ /**
598
+ * burn
599
+ * nonpayable
600
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
601
+ */
602
+ async burn(amount: bigint, options?: {
603
+ accessList?: import('viem').AccessList;
604
+ authorizationList?: import('viem').AuthorizationList;
605
+ chain?: import('viem').Chain | null;
606
+ dataSuffix?: `0x${string}`;
607
+ gas?: bigint;
608
+ gasPrice?: bigint;
609
+ maxFeePerGas?: bigint;
610
+ maxPriorityFeePerGas?: bigint;
611
+ nonce?: number;
612
+ value?: bigint;
613
+ }): Promise<`0x${string}`> {
614
+ if (!this.contract.write) {
615
+ throw new Error('Wallet client is required for write operations');
616
+ }
617
+ return this.contract.write.burn([amount] as const, options) as Promise<`0x${string}`>;
618
+ }
619
+
620
+ /**
621
+ * decreaseAllowance
622
+ * nonpayable
623
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
624
+ */
625
+ async decreaseAllowance(to: `0x${string}`, subtractedValue: bigint, options?: {
626
+ accessList?: import('viem').AccessList;
627
+ authorizationList?: import('viem').AuthorizationList;
628
+ chain?: import('viem').Chain | null;
629
+ dataSuffix?: `0x${string}`;
630
+ gas?: bigint;
631
+ gasPrice?: bigint;
632
+ maxFeePerGas?: bigint;
633
+ maxPriorityFeePerGas?: bigint;
634
+ nonce?: number;
635
+ value?: bigint;
636
+ }): Promise<`0x${string}`> {
637
+ if (!this.contract.write) {
638
+ throw new Error('Wallet client is required for write operations');
639
+ }
640
+ return this.contract.write.decreaseAllowance([to, subtractedValue] as const, options) as Promise<`0x${string}`>;
641
+ }
642
+
643
+ /**
644
+ * increaseAllowance
645
+ * nonpayable
646
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
647
+ */
648
+ async increaseAllowance(to: `0x${string}`, addedValue: bigint, options?: {
649
+ accessList?: import('viem').AccessList;
650
+ authorizationList?: import('viem').AuthorizationList;
651
+ chain?: import('viem').Chain | null;
652
+ dataSuffix?: `0x${string}`;
653
+ gas?: bigint;
654
+ gasPrice?: bigint;
655
+ maxFeePerGas?: bigint;
656
+ maxPriorityFeePerGas?: bigint;
657
+ nonce?: number;
658
+ value?: bigint;
659
+ }): Promise<`0x${string}`> {
660
+ if (!this.contract.write) {
661
+ throw new Error('Wallet client is required for write operations');
662
+ }
663
+ return this.contract.write.increaseAllowance([to, addedValue] as const, options) as Promise<`0x${string}`>;
664
+ }
665
+
666
+ /**
667
+ * renounceOwnership
668
+ * nonpayable
669
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
670
+ */
671
+ async renounceOwnership(options?: {
672
+ accessList?: import('viem').AccessList;
673
+ authorizationList?: import('viem').AuthorizationList;
674
+ chain?: import('viem').Chain | null;
675
+ dataSuffix?: `0x${string}`;
676
+ gas?: bigint;
677
+ gasPrice?: bigint;
678
+ maxFeePerGas?: bigint;
679
+ maxPriorityFeePerGas?: bigint;
680
+ nonce?: number;
681
+ value?: bigint;
682
+ }): Promise<`0x${string}`> {
683
+ if (!this.contract.write) {
684
+ throw new Error('Wallet client is required for write operations');
685
+ }
686
+ return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
687
+ }
688
+
689
+ /**
690
+ * transfer
691
+ * nonpayable
692
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
693
+ */
694
+ async transfer(recipient: `0x${string}`, amount: bigint, options?: {
695
+ accessList?: import('viem').AccessList;
696
+ authorizationList?: import('viem').AuthorizationList;
697
+ chain?: import('viem').Chain | null;
698
+ dataSuffix?: `0x${string}`;
699
+ gas?: bigint;
700
+ gasPrice?: bigint;
701
+ maxFeePerGas?: bigint;
702
+ maxPriorityFeePerGas?: bigint;
703
+ nonce?: number;
704
+ value?: bigint;
705
+ }): Promise<`0x${string}`> {
706
+ if (!this.contract.write) {
707
+ throw new Error('Wallet client is required for write operations');
708
+ }
709
+ return this.contract.write.transfer([recipient, amount] as const, options) as Promise<`0x${string}`>;
710
+ }
711
+
712
+ /**
713
+ * transferFrom
714
+ * nonpayable
715
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
716
+ */
717
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
718
+ accessList?: import('viem').AccessList;
719
+ authorizationList?: import('viem').AuthorizationList;
720
+ chain?: import('viem').Chain | null;
721
+ dataSuffix?: `0x${string}`;
722
+ gas?: bigint;
723
+ gasPrice?: bigint;
724
+ maxFeePerGas?: bigint;
725
+ maxPriorityFeePerGas?: bigint;
726
+ nonce?: number;
727
+ value?: bigint;
728
+ }): Promise<`0x${string}`> {
729
+ if (!this.contract.write) {
730
+ throw new Error('Wallet client is required for write operations');
731
+ }
732
+ return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
733
+ }
734
+
735
+ /**
736
+ * transferOwnership
737
+ * nonpayable
738
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
739
+ */
740
+ async transferOwnership(newOwner: `0x${string}`, options?: {
741
+ accessList?: import('viem').AccessList;
742
+ authorizationList?: import('viem').AuthorizationList;
743
+ chain?: import('viem').Chain | null;
744
+ dataSuffix?: `0x${string}`;
745
+ gas?: bigint;
746
+ gasPrice?: bigint;
747
+ maxFeePerGas?: bigint;
748
+ maxPriorityFeePerGas?: bigint;
749
+ nonce?: number;
750
+ value?: bigint;
751
+ }): Promise<`0x${string}`> {
752
+ if (!this.contract.write) {
753
+ throw new Error('Wallet client is required for write operations');
754
+ }
755
+ return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
756
+ }
757
+
758
+
759
+
760
+ /**
761
+ * Simulate contract write operations (dry-run without sending transaction)
762
+ *
763
+ * @example
764
+ * const result = await contract.simulate.transfer('0x...', 1000n);
765
+ * console.log('Gas estimate:', result.request.gas);
766
+ * console.log('Would succeed:', result.result);
767
+ */
768
+ get simulate() {
769
+ const contract = this.contract;
770
+ if (!contract.simulate) {
771
+ throw new Error('Public client is required for simulation');
772
+ }
773
+ return {
774
+ /**
775
+ * Simulate approve
776
+ * Returns gas estimate and result without sending transaction
777
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
778
+ */
779
+ async approve(to: `0x${string}`, amount: bigint, options?: {
780
+ accessList?: import('viem').AccessList;
781
+ authorizationList?: import('viem').AuthorizationList;
782
+ chain?: import('viem').Chain | null;
783
+ dataSuffix?: `0x${string}`;
784
+ gas?: bigint;
785
+ gasPrice?: bigint;
786
+ maxFeePerGas?: bigint;
787
+ maxPriorityFeePerGas?: bigint;
788
+ nonce?: number;
789
+ value?: bigint;
790
+ }): Promise<boolean> {
791
+ return contract.simulate.approve([to, amount] as const, options) as Promise<boolean>;
792
+ },
793
+ /**
794
+ * Simulate burn
795
+ * Returns gas estimate and result without sending transaction
796
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
797
+ */
798
+ async burn(amount: bigint, options?: {
799
+ accessList?: import('viem').AccessList;
800
+ authorizationList?: import('viem').AuthorizationList;
801
+ chain?: import('viem').Chain | null;
802
+ dataSuffix?: `0x${string}`;
803
+ gas?: bigint;
804
+ gasPrice?: bigint;
805
+ maxFeePerGas?: bigint;
806
+ maxPriorityFeePerGas?: bigint;
807
+ nonce?: number;
808
+ value?: bigint;
809
+ }): Promise<void> {
810
+ return contract.simulate.burn([amount] as const, options) as Promise<void>;
811
+ },
812
+ /**
813
+ * Simulate decreaseAllowance
814
+ * Returns gas estimate and result without sending transaction
815
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
816
+ */
817
+ async decreaseAllowance(to: `0x${string}`, subtractedValue: bigint, options?: {
818
+ accessList?: import('viem').AccessList;
819
+ authorizationList?: import('viem').AuthorizationList;
820
+ chain?: import('viem').Chain | null;
821
+ dataSuffix?: `0x${string}`;
822
+ gas?: bigint;
823
+ gasPrice?: bigint;
824
+ maxFeePerGas?: bigint;
825
+ maxPriorityFeePerGas?: bigint;
826
+ nonce?: number;
827
+ value?: bigint;
828
+ }): Promise<boolean> {
829
+ return contract.simulate.decreaseAllowance([to, subtractedValue] as const, options) as Promise<boolean>;
830
+ },
831
+ /**
832
+ * Simulate increaseAllowance
833
+ * Returns gas estimate and result without sending transaction
834
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
835
+ */
836
+ async increaseAllowance(to: `0x${string}`, addedValue: bigint, options?: {
837
+ accessList?: import('viem').AccessList;
838
+ authorizationList?: import('viem').AuthorizationList;
839
+ chain?: import('viem').Chain | null;
840
+ dataSuffix?: `0x${string}`;
841
+ gas?: bigint;
842
+ gasPrice?: bigint;
843
+ maxFeePerGas?: bigint;
844
+ maxPriorityFeePerGas?: bigint;
845
+ nonce?: number;
846
+ value?: bigint;
847
+ }): Promise<boolean> {
848
+ return contract.simulate.increaseAllowance([to, addedValue] as const, options) as Promise<boolean>;
849
+ },
850
+ /**
851
+ * Simulate renounceOwnership
852
+ * Returns gas estimate and result without sending transaction
853
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
854
+ */
855
+ async renounceOwnership(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.renounceOwnership(options) as Promise<void>;
868
+ },
869
+ /**
870
+ * Simulate transfer
871
+ * Returns gas estimate and result without sending transaction
872
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
873
+ */
874
+ async transfer(recipient: `0x${string}`, amount: bigint, 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<boolean> {
886
+ return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
887
+ },
888
+ /**
889
+ * Simulate transferFrom
890
+ * Returns gas estimate and result without sending transaction
891
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
892
+ */
893
+ async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, 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<boolean> {
905
+ return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
906
+ },
907
+ /**
908
+ * Simulate transferOwnership
909
+ * Returns gas estimate and result without sending transaction
910
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
911
+ */
912
+ async transferOwnership(newOwner: `0x${string}`, 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.transferOwnership([newOwner] as const, options) as Promise<void>;
925
+ }
926
+ };
927
+ }
928
+
929
+ /**
930
+ * Watch contract events
931
+ *
932
+ * @example
933
+ * // Watch all Transfer events
934
+ * const unwatch = contract.watch.Transfer((event) => {
935
+ * console.log('Transfer:', event);
936
+ * });
937
+ *
938
+ * // Stop watching
939
+ * unwatch();
940
+ */
941
+ get watch() {
942
+ return {
943
+ /**
944
+ * Watch Approval events
945
+ * @param callback Function to call when event is emitted
946
+ * @param filter Optional filter for indexed parameters
947
+ * @returns Unwatch function to stop listening
948
+ */
949
+ Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner: `0x${string}`; spender: `0x${string}` }) => {
950
+ return this.publicClient.watchContractEvent({
951
+ address: this.contractAddress,
952
+ abi: Token_jsonAbi,
953
+ eventName: 'Approval',
954
+ args: filter,
955
+ onLogs: (logs: any[]) => {
956
+ logs.forEach((log: any) => {
957
+ callback(log.args as any);
958
+ });
959
+ },
960
+ }) as () => void;
961
+ },
962
+ /**
963
+ * Watch OwnershipTransferred events
964
+ * @param callback Function to call when event is emitted
965
+ * @param filter Optional filter for indexed parameters
966
+ * @returns Unwatch function to stop listening
967
+ */
968
+ OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => {
969
+ return this.publicClient.watchContractEvent({
970
+ address: this.contractAddress,
971
+ abi: Token_jsonAbi,
972
+ eventName: 'OwnershipTransferred',
973
+ args: filter,
974
+ onLogs: (logs: any[]) => {
975
+ logs.forEach((log: any) => {
976
+ callback(log.args as any);
977
+ });
978
+ },
979
+ }) as () => void;
980
+ },
981
+ /**
982
+ * Watch Transfer events
983
+ * @param callback Function to call when event is emitted
984
+ * @param filter Optional filter for indexed parameters
985
+ * @returns Unwatch function to stop listening
986
+ */
987
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}` }) => {
988
+ return this.publicClient.watchContractEvent({
989
+ address: this.contractAddress,
990
+ abi: Token_jsonAbi,
991
+ eventName: 'Transfer',
992
+ args: filter,
993
+ onLogs: (logs: any[]) => {
994
+ logs.forEach((log: any) => {
995
+ callback(log.args as any);
996
+ });
997
+ },
998
+ }) as () => void;
999
+ }
1000
+ };
1001
+ }
1002
+ }