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