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