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