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