@gitmyabi/jm 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,2046 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+
5
+ /**
6
+ * MonegraphERC721.Attributes struct type
7
+ */
8
+ export type MonegraphERC721_Attributes = {
9
+ language: string;
10
+ artist: string;
11
+ year: string;
12
+ royalty: string;
13
+ title: string;
14
+ };
15
+ /**
16
+ * MonegraphERC721_json ABI
17
+ *
18
+ * This ABI is typed using viem's type system for full type safety.
19
+ */
20
+ export const MonegraphERC721_jsonAbi = [
21
+ {
22
+ "anonymous": false,
23
+ "inputs": [
24
+ {
25
+ "indexed": false,
26
+ "internalType": "address",
27
+ "name": "previousAdmin",
28
+ "type": "address"
29
+ },
30
+ {
31
+ "indexed": false,
32
+ "internalType": "address",
33
+ "name": "newAdmin",
34
+ "type": "address"
35
+ }
36
+ ],
37
+ "name": "AdminChanged",
38
+ "type": "event"
39
+ },
40
+ {
41
+ "anonymous": false,
42
+ "inputs": [
43
+ {
44
+ "indexed": true,
45
+ "internalType": "address",
46
+ "name": "owner",
47
+ "type": "address"
48
+ },
49
+ {
50
+ "indexed": true,
51
+ "internalType": "address",
52
+ "name": "approved",
53
+ "type": "address"
54
+ },
55
+ {
56
+ "indexed": true,
57
+ "internalType": "uint256",
58
+ "name": "tokenId",
59
+ "type": "uint256"
60
+ }
61
+ ],
62
+ "name": "Approval",
63
+ "type": "event"
64
+ },
65
+ {
66
+ "anonymous": false,
67
+ "inputs": [
68
+ {
69
+ "indexed": true,
70
+ "internalType": "address",
71
+ "name": "owner",
72
+ "type": "address"
73
+ },
74
+ {
75
+ "indexed": true,
76
+ "internalType": "address",
77
+ "name": "operator",
78
+ "type": "address"
79
+ },
80
+ {
81
+ "indexed": false,
82
+ "internalType": "bool",
83
+ "name": "approved",
84
+ "type": "bool"
85
+ }
86
+ ],
87
+ "name": "ApprovalForAll",
88
+ "type": "event"
89
+ },
90
+ {
91
+ "anonymous": false,
92
+ "inputs": [
93
+ {
94
+ "indexed": true,
95
+ "internalType": "address",
96
+ "name": "beacon",
97
+ "type": "address"
98
+ }
99
+ ],
100
+ "name": "BeaconUpgraded",
101
+ "type": "event"
102
+ },
103
+ {
104
+ "anonymous": false,
105
+ "inputs": [
106
+ {
107
+ "indexed": false,
108
+ "internalType": "uint256",
109
+ "name": "tokenId",
110
+ "type": "uint256"
111
+ },
112
+ {
113
+ "components": [
114
+ {
115
+ "internalType": "string",
116
+ "name": "language",
117
+ "type": "string"
118
+ },
119
+ {
120
+ "internalType": "string",
121
+ "name": "artist",
122
+ "type": "string"
123
+ },
124
+ {
125
+ "internalType": "string",
126
+ "name": "year",
127
+ "type": "string"
128
+ },
129
+ {
130
+ "internalType": "string",
131
+ "name": "royalty",
132
+ "type": "string"
133
+ },
134
+ {
135
+ "internalType": "string",
136
+ "name": "title",
137
+ "type": "string"
138
+ }
139
+ ],
140
+ "indexed": false,
141
+ "internalType": "struct MonegraphERC721.Attributes",
142
+ "name": "attributes",
143
+ "type": "tuple"
144
+ },
145
+ {
146
+ "indexed": false,
147
+ "internalType": "string",
148
+ "name": "uri",
149
+ "type": "string"
150
+ }
151
+ ],
152
+ "name": "NFTAttributes",
153
+ "type": "event"
154
+ },
155
+ {
156
+ "anonymous": false,
157
+ "inputs": [
158
+ {
159
+ "indexed": false,
160
+ "internalType": "address",
161
+ "name": "account",
162
+ "type": "address"
163
+ }
164
+ ],
165
+ "name": "Paused",
166
+ "type": "event"
167
+ },
168
+ {
169
+ "anonymous": false,
170
+ "inputs": [
171
+ {
172
+ "indexed": true,
173
+ "internalType": "bytes32",
174
+ "name": "role",
175
+ "type": "bytes32"
176
+ },
177
+ {
178
+ "indexed": true,
179
+ "internalType": "bytes32",
180
+ "name": "previousAdminRole",
181
+ "type": "bytes32"
182
+ },
183
+ {
184
+ "indexed": true,
185
+ "internalType": "bytes32",
186
+ "name": "newAdminRole",
187
+ "type": "bytes32"
188
+ }
189
+ ],
190
+ "name": "RoleAdminChanged",
191
+ "type": "event"
192
+ },
193
+ {
194
+ "anonymous": false,
195
+ "inputs": [
196
+ {
197
+ "indexed": true,
198
+ "internalType": "bytes32",
199
+ "name": "role",
200
+ "type": "bytes32"
201
+ },
202
+ {
203
+ "indexed": true,
204
+ "internalType": "address",
205
+ "name": "account",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "indexed": true,
210
+ "internalType": "address",
211
+ "name": "sender",
212
+ "type": "address"
213
+ }
214
+ ],
215
+ "name": "RoleGranted",
216
+ "type": "event"
217
+ },
218
+ {
219
+ "anonymous": false,
220
+ "inputs": [
221
+ {
222
+ "indexed": true,
223
+ "internalType": "bytes32",
224
+ "name": "role",
225
+ "type": "bytes32"
226
+ },
227
+ {
228
+ "indexed": true,
229
+ "internalType": "address",
230
+ "name": "account",
231
+ "type": "address"
232
+ },
233
+ {
234
+ "indexed": true,
235
+ "internalType": "address",
236
+ "name": "sender",
237
+ "type": "address"
238
+ }
239
+ ],
240
+ "name": "RoleRevoked",
241
+ "type": "event"
242
+ },
243
+ {
244
+ "anonymous": false,
245
+ "inputs": [
246
+ {
247
+ "indexed": true,
248
+ "internalType": "address",
249
+ "name": "from",
250
+ "type": "address"
251
+ },
252
+ {
253
+ "indexed": true,
254
+ "internalType": "address",
255
+ "name": "to",
256
+ "type": "address"
257
+ },
258
+ {
259
+ "indexed": true,
260
+ "internalType": "uint256",
261
+ "name": "tokenId",
262
+ "type": "uint256"
263
+ }
264
+ ],
265
+ "name": "Transfer",
266
+ "type": "event"
267
+ },
268
+ {
269
+ "anonymous": false,
270
+ "inputs": [
271
+ {
272
+ "indexed": false,
273
+ "internalType": "address",
274
+ "name": "account",
275
+ "type": "address"
276
+ }
277
+ ],
278
+ "name": "Unpaused",
279
+ "type": "event"
280
+ },
281
+ {
282
+ "anonymous": false,
283
+ "inputs": [
284
+ {
285
+ "indexed": true,
286
+ "internalType": "address",
287
+ "name": "implementation",
288
+ "type": "address"
289
+ }
290
+ ],
291
+ "name": "Upgraded",
292
+ "type": "event"
293
+ },
294
+ {
295
+ "inputs": [],
296
+ "name": "DEFAULT_ADMIN_ROLE",
297
+ "outputs": [
298
+ {
299
+ "internalType": "bytes32",
300
+ "name": "",
301
+ "type": "bytes32"
302
+ }
303
+ ],
304
+ "stateMutability": "view",
305
+ "type": "function"
306
+ },
307
+ {
308
+ "inputs": [],
309
+ "name": "MINTER_ROLE",
310
+ "outputs": [
311
+ {
312
+ "internalType": "bytes32",
313
+ "name": "",
314
+ "type": "bytes32"
315
+ }
316
+ ],
317
+ "stateMutability": "view",
318
+ "type": "function"
319
+ },
320
+ {
321
+ "inputs": [],
322
+ "name": "PAUSER_ROLE",
323
+ "outputs": [
324
+ {
325
+ "internalType": "bytes32",
326
+ "name": "",
327
+ "type": "bytes32"
328
+ }
329
+ ],
330
+ "stateMutability": "view",
331
+ "type": "function"
332
+ },
333
+ {
334
+ "inputs": [
335
+ {
336
+ "internalType": "address",
337
+ "name": "to",
338
+ "type": "address"
339
+ },
340
+ {
341
+ "internalType": "uint256",
342
+ "name": "tokenId",
343
+ "type": "uint256"
344
+ }
345
+ ],
346
+ "name": "approve",
347
+ "outputs": [],
348
+ "stateMutability": "nonpayable",
349
+ "type": "function"
350
+ },
351
+ {
352
+ "inputs": [
353
+ {
354
+ "internalType": "address",
355
+ "name": "owner",
356
+ "type": "address"
357
+ }
358
+ ],
359
+ "name": "balanceOf",
360
+ "outputs": [
361
+ {
362
+ "internalType": "uint256",
363
+ "name": "",
364
+ "type": "uint256"
365
+ }
366
+ ],
367
+ "stateMutability": "view",
368
+ "type": "function"
369
+ },
370
+ {
371
+ "inputs": [
372
+ {
373
+ "internalType": "address[]",
374
+ "name": "addresses",
375
+ "type": "address[]"
376
+ }
377
+ ],
378
+ "name": "batchGrantMinters",
379
+ "outputs": [],
380
+ "stateMutability": "nonpayable",
381
+ "type": "function"
382
+ },
383
+ {
384
+ "inputs": [
385
+ {
386
+ "internalType": "uint256",
387
+ "name": "tokenId",
388
+ "type": "uint256"
389
+ }
390
+ ],
391
+ "name": "burn",
392
+ "outputs": [],
393
+ "stateMutability": "nonpayable",
394
+ "type": "function"
395
+ },
396
+ {
397
+ "inputs": [
398
+ {
399
+ "internalType": "uint256",
400
+ "name": "tokenId",
401
+ "type": "uint256"
402
+ }
403
+ ],
404
+ "name": "getApproved",
405
+ "outputs": [
406
+ {
407
+ "internalType": "address",
408
+ "name": "",
409
+ "type": "address"
410
+ }
411
+ ],
412
+ "stateMutability": "view",
413
+ "type": "function"
414
+ },
415
+ {
416
+ "inputs": [
417
+ {
418
+ "internalType": "bytes32",
419
+ "name": "role",
420
+ "type": "bytes32"
421
+ }
422
+ ],
423
+ "name": "getRoleAdmin",
424
+ "outputs": [
425
+ {
426
+ "internalType": "bytes32",
427
+ "name": "",
428
+ "type": "bytes32"
429
+ }
430
+ ],
431
+ "stateMutability": "view",
432
+ "type": "function"
433
+ },
434
+ {
435
+ "inputs": [
436
+ {
437
+ "internalType": "bytes32",
438
+ "name": "role",
439
+ "type": "bytes32"
440
+ },
441
+ {
442
+ "internalType": "address",
443
+ "name": "account",
444
+ "type": "address"
445
+ }
446
+ ],
447
+ "name": "grantRole",
448
+ "outputs": [],
449
+ "stateMutability": "nonpayable",
450
+ "type": "function"
451
+ },
452
+ {
453
+ "inputs": [
454
+ {
455
+ "internalType": "bytes32",
456
+ "name": "role",
457
+ "type": "bytes32"
458
+ },
459
+ {
460
+ "internalType": "address",
461
+ "name": "account",
462
+ "type": "address"
463
+ }
464
+ ],
465
+ "name": "hasRole",
466
+ "outputs": [
467
+ {
468
+ "internalType": "bool",
469
+ "name": "",
470
+ "type": "bool"
471
+ }
472
+ ],
473
+ "stateMutability": "view",
474
+ "type": "function"
475
+ },
476
+ {
477
+ "inputs": [
478
+ {
479
+ "internalType": "string",
480
+ "name": "name",
481
+ "type": "string"
482
+ },
483
+ {
484
+ "internalType": "string",
485
+ "name": "symbol",
486
+ "type": "string"
487
+ },
488
+ {
489
+ "internalType": "address",
490
+ "name": "admin",
491
+ "type": "address"
492
+ }
493
+ ],
494
+ "name": "initialize",
495
+ "outputs": [],
496
+ "stateMutability": "nonpayable",
497
+ "type": "function"
498
+ },
499
+ {
500
+ "inputs": [],
501
+ "name": "initializedBy",
502
+ "outputs": [
503
+ {
504
+ "internalType": "address",
505
+ "name": "",
506
+ "type": "address"
507
+ }
508
+ ],
509
+ "stateMutability": "view",
510
+ "type": "function"
511
+ },
512
+ {
513
+ "inputs": [
514
+ {
515
+ "internalType": "address",
516
+ "name": "owner",
517
+ "type": "address"
518
+ },
519
+ {
520
+ "internalType": "address",
521
+ "name": "operator",
522
+ "type": "address"
523
+ }
524
+ ],
525
+ "name": "isApprovedForAll",
526
+ "outputs": [
527
+ {
528
+ "internalType": "bool",
529
+ "name": "",
530
+ "type": "bool"
531
+ }
532
+ ],
533
+ "stateMutability": "view",
534
+ "type": "function"
535
+ },
536
+ {
537
+ "inputs": [
538
+ {
539
+ "internalType": "address",
540
+ "name": "to",
541
+ "type": "address"
542
+ },
543
+ {
544
+ "internalType": "string",
545
+ "name": "uri",
546
+ "type": "string"
547
+ }
548
+ ],
549
+ "name": "mint",
550
+ "outputs": [],
551
+ "stateMutability": "nonpayable",
552
+ "type": "function"
553
+ },
554
+ {
555
+ "inputs": [
556
+ {
557
+ "internalType": "address",
558
+ "name": "to",
559
+ "type": "address"
560
+ },
561
+ {
562
+ "internalType": "string",
563
+ "name": "uri",
564
+ "type": "string"
565
+ },
566
+ {
567
+ "components": [
568
+ {
569
+ "internalType": "string",
570
+ "name": "language",
571
+ "type": "string"
572
+ },
573
+ {
574
+ "internalType": "string",
575
+ "name": "artist",
576
+ "type": "string"
577
+ },
578
+ {
579
+ "internalType": "string",
580
+ "name": "year",
581
+ "type": "string"
582
+ },
583
+ {
584
+ "internalType": "string",
585
+ "name": "royalty",
586
+ "type": "string"
587
+ },
588
+ {
589
+ "internalType": "string",
590
+ "name": "title",
591
+ "type": "string"
592
+ }
593
+ ],
594
+ "internalType": "struct MonegraphERC721.Attributes",
595
+ "name": "attributes",
596
+ "type": "tuple"
597
+ }
598
+ ],
599
+ "name": "mint",
600
+ "outputs": [],
601
+ "stateMutability": "nonpayable",
602
+ "type": "function"
603
+ },
604
+ {
605
+ "inputs": [],
606
+ "name": "name",
607
+ "outputs": [
608
+ {
609
+ "internalType": "string",
610
+ "name": "",
611
+ "type": "string"
612
+ }
613
+ ],
614
+ "stateMutability": "view",
615
+ "type": "function"
616
+ },
617
+ {
618
+ "inputs": [
619
+ {
620
+ "internalType": "uint256",
621
+ "name": "tokenId",
622
+ "type": "uint256"
623
+ }
624
+ ],
625
+ "name": "ownerOf",
626
+ "outputs": [
627
+ {
628
+ "internalType": "address",
629
+ "name": "",
630
+ "type": "address"
631
+ }
632
+ ],
633
+ "stateMutability": "view",
634
+ "type": "function"
635
+ },
636
+ {
637
+ "inputs": [],
638
+ "name": "pause",
639
+ "outputs": [],
640
+ "stateMutability": "nonpayable",
641
+ "type": "function"
642
+ },
643
+ {
644
+ "inputs": [],
645
+ "name": "paused",
646
+ "outputs": [
647
+ {
648
+ "internalType": "bool",
649
+ "name": "",
650
+ "type": "bool"
651
+ }
652
+ ],
653
+ "stateMutability": "view",
654
+ "type": "function"
655
+ },
656
+ {
657
+ "inputs": [
658
+ {
659
+ "internalType": "bytes32",
660
+ "name": "role",
661
+ "type": "bytes32"
662
+ },
663
+ {
664
+ "internalType": "address",
665
+ "name": "account",
666
+ "type": "address"
667
+ }
668
+ ],
669
+ "name": "renounceRole",
670
+ "outputs": [],
671
+ "stateMutability": "nonpayable",
672
+ "type": "function"
673
+ },
674
+ {
675
+ "inputs": [
676
+ {
677
+ "internalType": "bytes32",
678
+ "name": "role",
679
+ "type": "bytes32"
680
+ },
681
+ {
682
+ "internalType": "address",
683
+ "name": "account",
684
+ "type": "address"
685
+ }
686
+ ],
687
+ "name": "revokeRole",
688
+ "outputs": [],
689
+ "stateMutability": "nonpayable",
690
+ "type": "function"
691
+ },
692
+ {
693
+ "inputs": [
694
+ {
695
+ "internalType": "address",
696
+ "name": "from",
697
+ "type": "address"
698
+ },
699
+ {
700
+ "internalType": "address",
701
+ "name": "to",
702
+ "type": "address"
703
+ },
704
+ {
705
+ "internalType": "uint256",
706
+ "name": "tokenId",
707
+ "type": "uint256"
708
+ }
709
+ ],
710
+ "name": "safeTransferFrom",
711
+ "outputs": [],
712
+ "stateMutability": "nonpayable",
713
+ "type": "function"
714
+ },
715
+ {
716
+ "inputs": [
717
+ {
718
+ "internalType": "address",
719
+ "name": "from",
720
+ "type": "address"
721
+ },
722
+ {
723
+ "internalType": "address",
724
+ "name": "to",
725
+ "type": "address"
726
+ },
727
+ {
728
+ "internalType": "uint256",
729
+ "name": "tokenId",
730
+ "type": "uint256"
731
+ },
732
+ {
733
+ "internalType": "bytes",
734
+ "name": "_data",
735
+ "type": "bytes"
736
+ }
737
+ ],
738
+ "name": "safeTransferFrom",
739
+ "outputs": [],
740
+ "stateMutability": "nonpayable",
741
+ "type": "function"
742
+ },
743
+ {
744
+ "inputs": [
745
+ {
746
+ "internalType": "address",
747
+ "name": "operator",
748
+ "type": "address"
749
+ },
750
+ {
751
+ "internalType": "bool",
752
+ "name": "approved",
753
+ "type": "bool"
754
+ }
755
+ ],
756
+ "name": "setApprovalForAll",
757
+ "outputs": [],
758
+ "stateMutability": "nonpayable",
759
+ "type": "function"
760
+ },
761
+ {
762
+ "inputs": [
763
+ {
764
+ "internalType": "bytes4",
765
+ "name": "interfaceId",
766
+ "type": "bytes4"
767
+ }
768
+ ],
769
+ "name": "supportsInterface",
770
+ "outputs": [
771
+ {
772
+ "internalType": "bool",
773
+ "name": "",
774
+ "type": "bool"
775
+ }
776
+ ],
777
+ "stateMutability": "view",
778
+ "type": "function"
779
+ },
780
+ {
781
+ "inputs": [],
782
+ "name": "symbol",
783
+ "outputs": [
784
+ {
785
+ "internalType": "string",
786
+ "name": "",
787
+ "type": "string"
788
+ }
789
+ ],
790
+ "stateMutability": "view",
791
+ "type": "function"
792
+ },
793
+ {
794
+ "inputs": [
795
+ {
796
+ "internalType": "uint256",
797
+ "name": "index",
798
+ "type": "uint256"
799
+ }
800
+ ],
801
+ "name": "tokenByIndex",
802
+ "outputs": [
803
+ {
804
+ "internalType": "uint256",
805
+ "name": "",
806
+ "type": "uint256"
807
+ }
808
+ ],
809
+ "stateMutability": "view",
810
+ "type": "function"
811
+ },
812
+ {
813
+ "inputs": [
814
+ {
815
+ "internalType": "address",
816
+ "name": "owner",
817
+ "type": "address"
818
+ },
819
+ {
820
+ "internalType": "uint256",
821
+ "name": "index",
822
+ "type": "uint256"
823
+ }
824
+ ],
825
+ "name": "tokenOfOwnerByIndex",
826
+ "outputs": [
827
+ {
828
+ "internalType": "uint256",
829
+ "name": "",
830
+ "type": "uint256"
831
+ }
832
+ ],
833
+ "stateMutability": "view",
834
+ "type": "function"
835
+ },
836
+ {
837
+ "inputs": [
838
+ {
839
+ "internalType": "uint256",
840
+ "name": "tokenId",
841
+ "type": "uint256"
842
+ }
843
+ ],
844
+ "name": "tokenURI",
845
+ "outputs": [
846
+ {
847
+ "internalType": "string",
848
+ "name": "",
849
+ "type": "string"
850
+ }
851
+ ],
852
+ "stateMutability": "view",
853
+ "type": "function"
854
+ },
855
+ {
856
+ "inputs": [],
857
+ "name": "totalSupply",
858
+ "outputs": [
859
+ {
860
+ "internalType": "uint256",
861
+ "name": "",
862
+ "type": "uint256"
863
+ }
864
+ ],
865
+ "stateMutability": "view",
866
+ "type": "function"
867
+ },
868
+ {
869
+ "inputs": [
870
+ {
871
+ "internalType": "address",
872
+ "name": "from",
873
+ "type": "address"
874
+ },
875
+ {
876
+ "internalType": "address",
877
+ "name": "to",
878
+ "type": "address"
879
+ },
880
+ {
881
+ "internalType": "uint256",
882
+ "name": "tokenId",
883
+ "type": "uint256"
884
+ }
885
+ ],
886
+ "name": "transferFrom",
887
+ "outputs": [],
888
+ "stateMutability": "nonpayable",
889
+ "type": "function"
890
+ },
891
+ {
892
+ "inputs": [],
893
+ "name": "unpause",
894
+ "outputs": [],
895
+ "stateMutability": "nonpayable",
896
+ "type": "function"
897
+ },
898
+ {
899
+ "inputs": [
900
+ {
901
+ "internalType": "address",
902
+ "name": "newImplementation",
903
+ "type": "address"
904
+ }
905
+ ],
906
+ "name": "upgradeTo",
907
+ "outputs": [],
908
+ "stateMutability": "nonpayable",
909
+ "type": "function"
910
+ },
911
+ {
912
+ "inputs": [
913
+ {
914
+ "internalType": "address",
915
+ "name": "newImplementation",
916
+ "type": "address"
917
+ },
918
+ {
919
+ "internalType": "bytes",
920
+ "name": "data",
921
+ "type": "bytes"
922
+ }
923
+ ],
924
+ "name": "upgradeToAndCall",
925
+ "outputs": [],
926
+ "stateMutability": "payable",
927
+ "type": "function"
928
+ }
929
+ ] as const satisfies Abi;
930
+
931
+ /**
932
+ * Type-safe ABI for MonegraphERC721_json
933
+ */
934
+ export type MonegraphERC721_jsonAbi = typeof MonegraphERC721_jsonAbi;
935
+
936
+ /**
937
+ * Contract instance type for MonegraphERC721_json
938
+ */
939
+ // Use any for contract type to avoid complex viem type issues
940
+ // The runtime behavior is type-safe through viem's ABI typing
941
+ export type MonegraphERC721_jsonContract = any;
942
+
943
+ /**
944
+ * MonegraphERC721_json Contract Class
945
+ *
946
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
947
+ *
948
+ * @example
949
+ * ```typescript
950
+ * import { createPublicClient, createWalletClient, http } from 'viem';
951
+ * import { mainnet } from 'viem/chains';
952
+ * import { MonegraphERC721_json } from 'MonegraphERC721_json';
953
+ *
954
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
955
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
956
+ *
957
+ * const contract = new MonegraphERC721_json('0x...', { publicClient, walletClient });
958
+ *
959
+ * // Read functions
960
+ * const result = await contract.balanceOf('0x...');
961
+ *
962
+ * // Write functions
963
+ * const hash = await contract.transfer('0x...', 1000n);
964
+ *
965
+ * // Simulate transactions (dry-run)
966
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
967
+ * console.log('Gas estimate:', simulation.request.gas);
968
+ *
969
+ * // Watch events
970
+ * const unwatch = contract.watch.Transfer((event) => {
971
+ * console.log('Transfer event:', event);
972
+ * });
973
+ * ```
974
+ */
975
+ export class MonegraphERC721_json {
976
+ private contract: MonegraphERC721_jsonContract;
977
+ private contractAddress: Address;
978
+ private publicClient: PublicClient;
979
+
980
+ constructor(
981
+ address: Address,
982
+ clients: {
983
+ publicClient: PublicClient;
984
+ walletClient?: WalletClient;
985
+ }
986
+ ) {
987
+ this.contractAddress = address;
988
+ this.publicClient = clients.publicClient;
989
+ this.contract = getContract({
990
+ address,
991
+ abi: MonegraphERC721_jsonAbi,
992
+ client: {
993
+ public: clients.publicClient,
994
+ wallet: clients.walletClient,
995
+ },
996
+ });
997
+ }
998
+
999
+ /**
1000
+ * Get the contract address
1001
+ */
1002
+ get address(): Address {
1003
+ return this.contractAddress;
1004
+ }
1005
+
1006
+ /**
1007
+ * Get the underlying viem contract instance
1008
+ */
1009
+ getContract(): MonegraphERC721_jsonContract {
1010
+ return this.contract;
1011
+ }
1012
+
1013
+ /**
1014
+ * DEFAULT_ADMIN_ROLE
1015
+ * view
1016
+ */
1017
+ async DEFAULT_ADMIN_ROLE(): Promise<`0x${string}`> {
1018
+ return this.contract.read.DEFAULT_ADMIN_ROLE() as Promise<`0x${string}`>;
1019
+ }
1020
+
1021
+ /**
1022
+ * MINTER_ROLE
1023
+ * view
1024
+ */
1025
+ async MINTER_ROLE(): Promise<`0x${string}`> {
1026
+ return this.contract.read.MINTER_ROLE() as Promise<`0x${string}`>;
1027
+ }
1028
+
1029
+ /**
1030
+ * PAUSER_ROLE
1031
+ * view
1032
+ */
1033
+ async PAUSER_ROLE(): Promise<`0x${string}`> {
1034
+ return this.contract.read.PAUSER_ROLE() as Promise<`0x${string}`>;
1035
+ }
1036
+
1037
+ /**
1038
+ * balanceOf
1039
+ * view
1040
+ */
1041
+ async balanceOf(owner: `0x${string}`): Promise<bigint> {
1042
+ return this.contract.read.balanceOf([owner] as const) as Promise<bigint>;
1043
+ }
1044
+
1045
+ /**
1046
+ * getApproved
1047
+ * view
1048
+ */
1049
+ async getApproved(tokenId: bigint): Promise<`0x${string}`> {
1050
+ return this.contract.read.getApproved([tokenId] as const) as Promise<`0x${string}`>;
1051
+ }
1052
+
1053
+ /**
1054
+ * getRoleAdmin
1055
+ * view
1056
+ */
1057
+ async getRoleAdmin(role: `0x${string}`): Promise<`0x${string}`> {
1058
+ return this.contract.read.getRoleAdmin([role] as const) as Promise<`0x${string}`>;
1059
+ }
1060
+
1061
+ /**
1062
+ * hasRole
1063
+ * view
1064
+ */
1065
+ async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
1066
+ return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
1067
+ }
1068
+
1069
+ /**
1070
+ * initializedBy
1071
+ * view
1072
+ */
1073
+ async initializedBy(): Promise<`0x${string}`> {
1074
+ return this.contract.read.initializedBy() as Promise<`0x${string}`>;
1075
+ }
1076
+
1077
+ /**
1078
+ * isApprovedForAll
1079
+ * view
1080
+ */
1081
+ async isApprovedForAll(owner: `0x${string}`, operator: `0x${string}`): Promise<boolean> {
1082
+ return this.contract.read.isApprovedForAll([owner, operator] as const) as Promise<boolean>;
1083
+ }
1084
+
1085
+ /**
1086
+ * name
1087
+ * view
1088
+ */
1089
+ async name(): Promise<string> {
1090
+ return this.contract.read.name() as Promise<string>;
1091
+ }
1092
+
1093
+ /**
1094
+ * ownerOf
1095
+ * view
1096
+ */
1097
+ async ownerOf(tokenId: bigint): Promise<`0x${string}`> {
1098
+ return this.contract.read.ownerOf([tokenId] as const) as Promise<`0x${string}`>;
1099
+ }
1100
+
1101
+ /**
1102
+ * paused
1103
+ * view
1104
+ */
1105
+ async paused(): Promise<boolean> {
1106
+ return this.contract.read.paused() as Promise<boolean>;
1107
+ }
1108
+
1109
+ /**
1110
+ * supportsInterface
1111
+ * view
1112
+ */
1113
+ async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
1114
+ return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
1115
+ }
1116
+
1117
+ /**
1118
+ * symbol
1119
+ * view
1120
+ */
1121
+ async symbol(): Promise<string> {
1122
+ return this.contract.read.symbol() as Promise<string>;
1123
+ }
1124
+
1125
+ /**
1126
+ * tokenByIndex
1127
+ * view
1128
+ */
1129
+ async tokenByIndex(index: bigint): Promise<bigint> {
1130
+ return this.contract.read.tokenByIndex([index] as const) as Promise<bigint>;
1131
+ }
1132
+
1133
+ /**
1134
+ * tokenOfOwnerByIndex
1135
+ * view
1136
+ */
1137
+ async tokenOfOwnerByIndex(owner: `0x${string}`, index: bigint): Promise<bigint> {
1138
+ return this.contract.read.tokenOfOwnerByIndex([owner, index] as const) as Promise<bigint>;
1139
+ }
1140
+
1141
+ /**
1142
+ * tokenURI
1143
+ * view
1144
+ */
1145
+ async tokenURI(tokenId: bigint): Promise<string> {
1146
+ return this.contract.read.tokenURI([tokenId] as const) as Promise<string>;
1147
+ }
1148
+
1149
+ /**
1150
+ * totalSupply
1151
+ * view
1152
+ */
1153
+ async totalSupply(): Promise<bigint> {
1154
+ return this.contract.read.totalSupply() as Promise<bigint>;
1155
+ }
1156
+
1157
+ /**
1158
+ * approve
1159
+ * nonpayable
1160
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1161
+ */
1162
+ async approve(to: `0x${string}`, tokenId: bigint, options?: {
1163
+ accessList?: import('viem').AccessList;
1164
+ authorizationList?: import('viem').AuthorizationList;
1165
+ chain?: import('viem').Chain | null;
1166
+ dataSuffix?: `0x${string}`;
1167
+ gas?: bigint;
1168
+ gasPrice?: bigint;
1169
+ maxFeePerGas?: bigint;
1170
+ maxPriorityFeePerGas?: bigint;
1171
+ nonce?: number;
1172
+ value?: bigint;
1173
+ }): Promise<`0x${string}`> {
1174
+ if (!this.contract.write) {
1175
+ throw new Error('Wallet client is required for write operations');
1176
+ }
1177
+ return this.contract.write.approve([to, tokenId] as const, options) as Promise<`0x${string}`>;
1178
+ }
1179
+
1180
+ /**
1181
+ * batchGrantMinters
1182
+ * nonpayable
1183
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1184
+ */
1185
+ async batchGrantMinters(addresses: `0x${string}`[], options?: {
1186
+ accessList?: import('viem').AccessList;
1187
+ authorizationList?: import('viem').AuthorizationList;
1188
+ chain?: import('viem').Chain | null;
1189
+ dataSuffix?: `0x${string}`;
1190
+ gas?: bigint;
1191
+ gasPrice?: bigint;
1192
+ maxFeePerGas?: bigint;
1193
+ maxPriorityFeePerGas?: bigint;
1194
+ nonce?: number;
1195
+ value?: bigint;
1196
+ }): Promise<`0x${string}`> {
1197
+ if (!this.contract.write) {
1198
+ throw new Error('Wallet client is required for write operations');
1199
+ }
1200
+ return this.contract.write.batchGrantMinters([addresses] as const, options) as Promise<`0x${string}`>;
1201
+ }
1202
+
1203
+ /**
1204
+ * burn
1205
+ * nonpayable
1206
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1207
+ */
1208
+ async burn(tokenId: bigint, options?: {
1209
+ accessList?: import('viem').AccessList;
1210
+ authorizationList?: import('viem').AuthorizationList;
1211
+ chain?: import('viem').Chain | null;
1212
+ dataSuffix?: `0x${string}`;
1213
+ gas?: bigint;
1214
+ gasPrice?: bigint;
1215
+ maxFeePerGas?: bigint;
1216
+ maxPriorityFeePerGas?: bigint;
1217
+ nonce?: number;
1218
+ value?: bigint;
1219
+ }): Promise<`0x${string}`> {
1220
+ if (!this.contract.write) {
1221
+ throw new Error('Wallet client is required for write operations');
1222
+ }
1223
+ return this.contract.write.burn([tokenId] as const, options) as Promise<`0x${string}`>;
1224
+ }
1225
+
1226
+ /**
1227
+ * grantRole
1228
+ * nonpayable
1229
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1230
+ */
1231
+ async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
1232
+ accessList?: import('viem').AccessList;
1233
+ authorizationList?: import('viem').AuthorizationList;
1234
+ chain?: import('viem').Chain | null;
1235
+ dataSuffix?: `0x${string}`;
1236
+ gas?: bigint;
1237
+ gasPrice?: bigint;
1238
+ maxFeePerGas?: bigint;
1239
+ maxPriorityFeePerGas?: bigint;
1240
+ nonce?: number;
1241
+ value?: bigint;
1242
+ }): Promise<`0x${string}`> {
1243
+ if (!this.contract.write) {
1244
+ throw new Error('Wallet client is required for write operations');
1245
+ }
1246
+ return this.contract.write.grantRole([role, account] as const, options) as Promise<`0x${string}`>;
1247
+ }
1248
+
1249
+ /**
1250
+ * initialize
1251
+ * nonpayable
1252
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1253
+ */
1254
+ async initialize(name: string, symbol: string, admin: `0x${string}`, options?: {
1255
+ accessList?: import('viem').AccessList;
1256
+ authorizationList?: import('viem').AuthorizationList;
1257
+ chain?: import('viem').Chain | null;
1258
+ dataSuffix?: `0x${string}`;
1259
+ gas?: bigint;
1260
+ gasPrice?: bigint;
1261
+ maxFeePerGas?: bigint;
1262
+ maxPriorityFeePerGas?: bigint;
1263
+ nonce?: number;
1264
+ value?: bigint;
1265
+ }): Promise<`0x${string}`> {
1266
+ if (!this.contract.write) {
1267
+ throw new Error('Wallet client is required for write operations');
1268
+ }
1269
+ return this.contract.write.initialize([name, symbol, admin] as const, options) as Promise<`0x${string}`>;
1270
+ }
1271
+
1272
+ async mint(to: `0x${string}`, uri: string, options?: {
1273
+ accessList?: import('viem').AccessList;
1274
+ authorizationList?: import('viem').AuthorizationList;
1275
+ chain?: import('viem').Chain | null;
1276
+ dataSuffix?: `0x${string}`;
1277
+ gas?: bigint;
1278
+ gasPrice?: bigint;
1279
+ maxFeePerGas?: bigint;
1280
+ maxPriorityFeePerGas?: bigint;
1281
+ nonce?: number;
1282
+ value?: bigint;
1283
+ }): Promise<`0x${string}`>;
1284
+ async mint(to: `0x${string}`, uri: string, attributes: MonegraphERC721_Attributes, options?: {
1285
+ accessList?: import('viem').AccessList;
1286
+ authorizationList?: import('viem').AuthorizationList;
1287
+ chain?: import('viem').Chain | null;
1288
+ dataSuffix?: `0x${string}`;
1289
+ gas?: bigint;
1290
+ gasPrice?: bigint;
1291
+ maxFeePerGas?: bigint;
1292
+ maxPriorityFeePerGas?: bigint;
1293
+ nonce?: number;
1294
+ value?: bigint;
1295
+ }): Promise<`0x${string}`>;
1296
+ async mint(...args: any[]): Promise<`0x${string}`> {
1297
+ if (!this.contract.write) {
1298
+ throw new Error('Wallet client is required for write operations');
1299
+ }
1300
+ return this.contract.write.mint(args as any) as Promise<`0x${string}`>;
1301
+ }
1302
+
1303
+ /**
1304
+ * pause
1305
+ * nonpayable
1306
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1307
+ */
1308
+ async pause(options?: {
1309
+ accessList?: import('viem').AccessList;
1310
+ authorizationList?: import('viem').AuthorizationList;
1311
+ chain?: import('viem').Chain | null;
1312
+ dataSuffix?: `0x${string}`;
1313
+ gas?: bigint;
1314
+ gasPrice?: bigint;
1315
+ maxFeePerGas?: bigint;
1316
+ maxPriorityFeePerGas?: bigint;
1317
+ nonce?: number;
1318
+ value?: bigint;
1319
+ }): Promise<`0x${string}`> {
1320
+ if (!this.contract.write) {
1321
+ throw new Error('Wallet client is required for write operations');
1322
+ }
1323
+ return this.contract.write.pause(options) as Promise<`0x${string}`>;
1324
+ }
1325
+
1326
+ /**
1327
+ * renounceRole
1328
+ * nonpayable
1329
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1330
+ */
1331
+ async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
1332
+ accessList?: import('viem').AccessList;
1333
+ authorizationList?: import('viem').AuthorizationList;
1334
+ chain?: import('viem').Chain | null;
1335
+ dataSuffix?: `0x${string}`;
1336
+ gas?: bigint;
1337
+ gasPrice?: bigint;
1338
+ maxFeePerGas?: bigint;
1339
+ maxPriorityFeePerGas?: bigint;
1340
+ nonce?: number;
1341
+ value?: bigint;
1342
+ }): Promise<`0x${string}`> {
1343
+ if (!this.contract.write) {
1344
+ throw new Error('Wallet client is required for write operations');
1345
+ }
1346
+ return this.contract.write.renounceRole([role, account] as const, options) as Promise<`0x${string}`>;
1347
+ }
1348
+
1349
+ /**
1350
+ * revokeRole
1351
+ * nonpayable
1352
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1353
+ */
1354
+ async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
1355
+ accessList?: import('viem').AccessList;
1356
+ authorizationList?: import('viem').AuthorizationList;
1357
+ chain?: import('viem').Chain | null;
1358
+ dataSuffix?: `0x${string}`;
1359
+ gas?: bigint;
1360
+ gasPrice?: bigint;
1361
+ maxFeePerGas?: bigint;
1362
+ maxPriorityFeePerGas?: bigint;
1363
+ nonce?: number;
1364
+ value?: bigint;
1365
+ }): Promise<`0x${string}`> {
1366
+ if (!this.contract.write) {
1367
+ throw new Error('Wallet client is required for write operations');
1368
+ }
1369
+ return this.contract.write.revokeRole([role, account] as const, options) as Promise<`0x${string}`>;
1370
+ }
1371
+
1372
+ async safeTransferFrom(from: `0x${string}`, to: `0x${string}`, tokenId: bigint, options?: {
1373
+ accessList?: import('viem').AccessList;
1374
+ authorizationList?: import('viem').AuthorizationList;
1375
+ chain?: import('viem').Chain | null;
1376
+ dataSuffix?: `0x${string}`;
1377
+ gas?: bigint;
1378
+ gasPrice?: bigint;
1379
+ maxFeePerGas?: bigint;
1380
+ maxPriorityFeePerGas?: bigint;
1381
+ nonce?: number;
1382
+ value?: bigint;
1383
+ }): Promise<`0x${string}`>;
1384
+ async safeTransferFrom(from: `0x${string}`, to: `0x${string}`, tokenId: bigint, _data: `0x${string}`, options?: {
1385
+ accessList?: import('viem').AccessList;
1386
+ authorizationList?: import('viem').AuthorizationList;
1387
+ chain?: import('viem').Chain | null;
1388
+ dataSuffix?: `0x${string}`;
1389
+ gas?: bigint;
1390
+ gasPrice?: bigint;
1391
+ maxFeePerGas?: bigint;
1392
+ maxPriorityFeePerGas?: bigint;
1393
+ nonce?: number;
1394
+ value?: bigint;
1395
+ }): Promise<`0x${string}`>;
1396
+ async safeTransferFrom(...args: any[]): Promise<`0x${string}`> {
1397
+ if (!this.contract.write) {
1398
+ throw new Error('Wallet client is required for write operations');
1399
+ }
1400
+ return this.contract.write.safeTransferFrom(args as any) as Promise<`0x${string}`>;
1401
+ }
1402
+
1403
+ /**
1404
+ * setApprovalForAll
1405
+ * nonpayable
1406
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1407
+ */
1408
+ async setApprovalForAll(operator: `0x${string}`, approved: boolean, options?: {
1409
+ accessList?: import('viem').AccessList;
1410
+ authorizationList?: import('viem').AuthorizationList;
1411
+ chain?: import('viem').Chain | null;
1412
+ dataSuffix?: `0x${string}`;
1413
+ gas?: bigint;
1414
+ gasPrice?: bigint;
1415
+ maxFeePerGas?: bigint;
1416
+ maxPriorityFeePerGas?: bigint;
1417
+ nonce?: number;
1418
+ value?: bigint;
1419
+ }): Promise<`0x${string}`> {
1420
+ if (!this.contract.write) {
1421
+ throw new Error('Wallet client is required for write operations');
1422
+ }
1423
+ return this.contract.write.setApprovalForAll([operator, approved] as const, options) as Promise<`0x${string}`>;
1424
+ }
1425
+
1426
+ /**
1427
+ * transferFrom
1428
+ * nonpayable
1429
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1430
+ */
1431
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, tokenId: bigint, options?: {
1432
+ accessList?: import('viem').AccessList;
1433
+ authorizationList?: import('viem').AuthorizationList;
1434
+ chain?: import('viem').Chain | null;
1435
+ dataSuffix?: `0x${string}`;
1436
+ gas?: bigint;
1437
+ gasPrice?: bigint;
1438
+ maxFeePerGas?: bigint;
1439
+ maxPriorityFeePerGas?: bigint;
1440
+ nonce?: number;
1441
+ value?: bigint;
1442
+ }): Promise<`0x${string}`> {
1443
+ if (!this.contract.write) {
1444
+ throw new Error('Wallet client is required for write operations');
1445
+ }
1446
+ return this.contract.write.transferFrom([from, to, tokenId] as const, options) as Promise<`0x${string}`>;
1447
+ }
1448
+
1449
+ /**
1450
+ * unpause
1451
+ * nonpayable
1452
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1453
+ */
1454
+ async unpause(options?: {
1455
+ accessList?: import('viem').AccessList;
1456
+ authorizationList?: import('viem').AuthorizationList;
1457
+ chain?: import('viem').Chain | null;
1458
+ dataSuffix?: `0x${string}`;
1459
+ gas?: bigint;
1460
+ gasPrice?: bigint;
1461
+ maxFeePerGas?: bigint;
1462
+ maxPriorityFeePerGas?: bigint;
1463
+ nonce?: number;
1464
+ value?: bigint;
1465
+ }): Promise<`0x${string}`> {
1466
+ if (!this.contract.write) {
1467
+ throw new Error('Wallet client is required for write operations');
1468
+ }
1469
+ return this.contract.write.unpause(options) as Promise<`0x${string}`>;
1470
+ }
1471
+
1472
+ /**
1473
+ * upgradeTo
1474
+ * nonpayable
1475
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1476
+ */
1477
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
1478
+ accessList?: import('viem').AccessList;
1479
+ authorizationList?: import('viem').AuthorizationList;
1480
+ chain?: import('viem').Chain | null;
1481
+ dataSuffix?: `0x${string}`;
1482
+ gas?: bigint;
1483
+ gasPrice?: bigint;
1484
+ maxFeePerGas?: bigint;
1485
+ maxPriorityFeePerGas?: bigint;
1486
+ nonce?: number;
1487
+ value?: bigint;
1488
+ }): Promise<`0x${string}`> {
1489
+ if (!this.contract.write) {
1490
+ throw new Error('Wallet client is required for write operations');
1491
+ }
1492
+ return this.contract.write.upgradeTo([newImplementation] as const, options) as Promise<`0x${string}`>;
1493
+ }
1494
+
1495
+ /**
1496
+ * upgradeToAndCall
1497
+ * payable
1498
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1499
+ */
1500
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1501
+ accessList?: import('viem').AccessList;
1502
+ authorizationList?: import('viem').AuthorizationList;
1503
+ chain?: import('viem').Chain | null;
1504
+ dataSuffix?: `0x${string}`;
1505
+ gas?: bigint;
1506
+ gasPrice?: bigint;
1507
+ maxFeePerGas?: bigint;
1508
+ maxPriorityFeePerGas?: bigint;
1509
+ nonce?: number;
1510
+ value?: bigint;
1511
+ }): Promise<`0x${string}`> {
1512
+ if (!this.contract.write) {
1513
+ throw new Error('Wallet client is required for write operations');
1514
+ }
1515
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
1516
+ }
1517
+
1518
+
1519
+
1520
+ /**
1521
+ * Simulate contract write operations (dry-run without sending transaction)
1522
+ *
1523
+ * @example
1524
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1525
+ * console.log('Gas estimate:', result.request.gas);
1526
+ * console.log('Would succeed:', result.result);
1527
+ */
1528
+ get simulate() {
1529
+ const contract = this.contract;
1530
+ if (!contract.simulate) {
1531
+ throw new Error('Public client is required for simulation');
1532
+ }
1533
+ return {
1534
+ /**
1535
+ * Simulate approve
1536
+ * Returns gas estimate and result without sending transaction
1537
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1538
+ */
1539
+ async approve(to: `0x${string}`, tokenId: bigint, options?: {
1540
+ accessList?: import('viem').AccessList;
1541
+ authorizationList?: import('viem').AuthorizationList;
1542
+ chain?: import('viem').Chain | null;
1543
+ dataSuffix?: `0x${string}`;
1544
+ gas?: bigint;
1545
+ gasPrice?: bigint;
1546
+ maxFeePerGas?: bigint;
1547
+ maxPriorityFeePerGas?: bigint;
1548
+ nonce?: number;
1549
+ value?: bigint;
1550
+ }): Promise<void> {
1551
+ return contract.simulate.approve([to, tokenId] as const, options) as Promise<void>;
1552
+ },
1553
+ /**
1554
+ * Simulate batchGrantMinters
1555
+ * Returns gas estimate and result without sending transaction
1556
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1557
+ */
1558
+ async batchGrantMinters(addresses: `0x${string}`[], options?: {
1559
+ accessList?: import('viem').AccessList;
1560
+ authorizationList?: import('viem').AuthorizationList;
1561
+ chain?: import('viem').Chain | null;
1562
+ dataSuffix?: `0x${string}`;
1563
+ gas?: bigint;
1564
+ gasPrice?: bigint;
1565
+ maxFeePerGas?: bigint;
1566
+ maxPriorityFeePerGas?: bigint;
1567
+ nonce?: number;
1568
+ value?: bigint;
1569
+ }): Promise<void> {
1570
+ return contract.simulate.batchGrantMinters([addresses] as const, options) as Promise<void>;
1571
+ },
1572
+ /**
1573
+ * Simulate burn
1574
+ * Returns gas estimate and result without sending transaction
1575
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1576
+ */
1577
+ async burn(tokenId: bigint, options?: {
1578
+ accessList?: import('viem').AccessList;
1579
+ authorizationList?: import('viem').AuthorizationList;
1580
+ chain?: import('viem').Chain | null;
1581
+ dataSuffix?: `0x${string}`;
1582
+ gas?: bigint;
1583
+ gasPrice?: bigint;
1584
+ maxFeePerGas?: bigint;
1585
+ maxPriorityFeePerGas?: bigint;
1586
+ nonce?: number;
1587
+ value?: bigint;
1588
+ }): Promise<void> {
1589
+ return contract.simulate.burn([tokenId] as const, options) as Promise<void>;
1590
+ },
1591
+ /**
1592
+ * Simulate grantRole
1593
+ * Returns gas estimate and result without sending transaction
1594
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1595
+ */
1596
+ async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
1597
+ accessList?: import('viem').AccessList;
1598
+ authorizationList?: import('viem').AuthorizationList;
1599
+ chain?: import('viem').Chain | null;
1600
+ dataSuffix?: `0x${string}`;
1601
+ gas?: bigint;
1602
+ gasPrice?: bigint;
1603
+ maxFeePerGas?: bigint;
1604
+ maxPriorityFeePerGas?: bigint;
1605
+ nonce?: number;
1606
+ value?: bigint;
1607
+ }): Promise<void> {
1608
+ return contract.simulate.grantRole([role, account] as const, options) as Promise<void>;
1609
+ },
1610
+ /**
1611
+ * Simulate initialize
1612
+ * Returns gas estimate and result without sending transaction
1613
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1614
+ */
1615
+ async initialize(name: string, symbol: string, admin: `0x${string}`, options?: {
1616
+ accessList?: import('viem').AccessList;
1617
+ authorizationList?: import('viem').AuthorizationList;
1618
+ chain?: import('viem').Chain | null;
1619
+ dataSuffix?: `0x${string}`;
1620
+ gas?: bigint;
1621
+ gasPrice?: bigint;
1622
+ maxFeePerGas?: bigint;
1623
+ maxPriorityFeePerGas?: bigint;
1624
+ nonce?: number;
1625
+ value?: bigint;
1626
+ }): Promise<void> {
1627
+ return contract.simulate.initialize([name, symbol, admin] as const, options) as Promise<void>;
1628
+ },
1629
+ /**
1630
+ * Simulate mint
1631
+ * Returns gas estimate and result without sending transaction
1632
+ * Supports multiple overloads: (address, string), (address, string, tuple)
1633
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1634
+ */
1635
+ async mint(...args: any[]): Promise<any> {
1636
+ return contract.simulate.mint(args as any) as Promise<any>;
1637
+ },
1638
+ /**
1639
+ * Simulate pause
1640
+ * Returns gas estimate and result without sending transaction
1641
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1642
+ */
1643
+ async pause(options?: {
1644
+ accessList?: import('viem').AccessList;
1645
+ authorizationList?: import('viem').AuthorizationList;
1646
+ chain?: import('viem').Chain | null;
1647
+ dataSuffix?: `0x${string}`;
1648
+ gas?: bigint;
1649
+ gasPrice?: bigint;
1650
+ maxFeePerGas?: bigint;
1651
+ maxPriorityFeePerGas?: bigint;
1652
+ nonce?: number;
1653
+ value?: bigint;
1654
+ }): Promise<void> {
1655
+ return contract.simulate.pause(options) as Promise<void>;
1656
+ },
1657
+ /**
1658
+ * Simulate renounceRole
1659
+ * Returns gas estimate and result without sending transaction
1660
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1661
+ */
1662
+ async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
1663
+ accessList?: import('viem').AccessList;
1664
+ authorizationList?: import('viem').AuthorizationList;
1665
+ chain?: import('viem').Chain | null;
1666
+ dataSuffix?: `0x${string}`;
1667
+ gas?: bigint;
1668
+ gasPrice?: bigint;
1669
+ maxFeePerGas?: bigint;
1670
+ maxPriorityFeePerGas?: bigint;
1671
+ nonce?: number;
1672
+ value?: bigint;
1673
+ }): Promise<void> {
1674
+ return contract.simulate.renounceRole([role, account] as const, options) as Promise<void>;
1675
+ },
1676
+ /**
1677
+ * Simulate revokeRole
1678
+ * Returns gas estimate and result without sending transaction
1679
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1680
+ */
1681
+ async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
1682
+ accessList?: import('viem').AccessList;
1683
+ authorizationList?: import('viem').AuthorizationList;
1684
+ chain?: import('viem').Chain | null;
1685
+ dataSuffix?: `0x${string}`;
1686
+ gas?: bigint;
1687
+ gasPrice?: bigint;
1688
+ maxFeePerGas?: bigint;
1689
+ maxPriorityFeePerGas?: bigint;
1690
+ nonce?: number;
1691
+ value?: bigint;
1692
+ }): Promise<void> {
1693
+ return contract.simulate.revokeRole([role, account] as const, options) as Promise<void>;
1694
+ },
1695
+ /**
1696
+ * Simulate safeTransferFrom
1697
+ * Returns gas estimate and result without sending transaction
1698
+ * Supports multiple overloads: (address, address, uint256), (address, address, uint256, bytes)
1699
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1700
+ */
1701
+ async safeTransferFrom(...args: any[]): Promise<any> {
1702
+ return contract.simulate.safeTransferFrom(args as any) as Promise<any>;
1703
+ },
1704
+ /**
1705
+ * Simulate setApprovalForAll
1706
+ * Returns gas estimate and result without sending transaction
1707
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1708
+ */
1709
+ async setApprovalForAll(operator: `0x${string}`, approved: boolean, options?: {
1710
+ accessList?: import('viem').AccessList;
1711
+ authorizationList?: import('viem').AuthorizationList;
1712
+ chain?: import('viem').Chain | null;
1713
+ dataSuffix?: `0x${string}`;
1714
+ gas?: bigint;
1715
+ gasPrice?: bigint;
1716
+ maxFeePerGas?: bigint;
1717
+ maxPriorityFeePerGas?: bigint;
1718
+ nonce?: number;
1719
+ value?: bigint;
1720
+ }): Promise<void> {
1721
+ return contract.simulate.setApprovalForAll([operator, approved] as const, options) as Promise<void>;
1722
+ },
1723
+ /**
1724
+ * Simulate transferFrom
1725
+ * Returns gas estimate and result without sending transaction
1726
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1727
+ */
1728
+ async transferFrom(from: `0x${string}`, to: `0x${string}`, tokenId: bigint, options?: {
1729
+ accessList?: import('viem').AccessList;
1730
+ authorizationList?: import('viem').AuthorizationList;
1731
+ chain?: import('viem').Chain | null;
1732
+ dataSuffix?: `0x${string}`;
1733
+ gas?: bigint;
1734
+ gasPrice?: bigint;
1735
+ maxFeePerGas?: bigint;
1736
+ maxPriorityFeePerGas?: bigint;
1737
+ nonce?: number;
1738
+ value?: bigint;
1739
+ }): Promise<void> {
1740
+ return contract.simulate.transferFrom([from, to, tokenId] as const, options) as Promise<void>;
1741
+ },
1742
+ /**
1743
+ * Simulate unpause
1744
+ * Returns gas estimate and result without sending transaction
1745
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1746
+ */
1747
+ async unpause(options?: {
1748
+ accessList?: import('viem').AccessList;
1749
+ authorizationList?: import('viem').AuthorizationList;
1750
+ chain?: import('viem').Chain | null;
1751
+ dataSuffix?: `0x${string}`;
1752
+ gas?: bigint;
1753
+ gasPrice?: bigint;
1754
+ maxFeePerGas?: bigint;
1755
+ maxPriorityFeePerGas?: bigint;
1756
+ nonce?: number;
1757
+ value?: bigint;
1758
+ }): Promise<void> {
1759
+ return contract.simulate.unpause(options) as Promise<void>;
1760
+ },
1761
+ /**
1762
+ * Simulate upgradeTo
1763
+ * Returns gas estimate and result without sending transaction
1764
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1765
+ */
1766
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
1767
+ accessList?: import('viem').AccessList;
1768
+ authorizationList?: import('viem').AuthorizationList;
1769
+ chain?: import('viem').Chain | null;
1770
+ dataSuffix?: `0x${string}`;
1771
+ gas?: bigint;
1772
+ gasPrice?: bigint;
1773
+ maxFeePerGas?: bigint;
1774
+ maxPriorityFeePerGas?: bigint;
1775
+ nonce?: number;
1776
+ value?: bigint;
1777
+ }): Promise<void> {
1778
+ return contract.simulate.upgradeTo([newImplementation] as const, options) as Promise<void>;
1779
+ },
1780
+ /**
1781
+ * Simulate upgradeToAndCall
1782
+ * Returns gas estimate and result without sending transaction
1783
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1784
+ */
1785
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
1786
+ accessList?: import('viem').AccessList;
1787
+ authorizationList?: import('viem').AuthorizationList;
1788
+ chain?: import('viem').Chain | null;
1789
+ dataSuffix?: `0x${string}`;
1790
+ gas?: bigint;
1791
+ gasPrice?: bigint;
1792
+ maxFeePerGas?: bigint;
1793
+ maxPriorityFeePerGas?: bigint;
1794
+ nonce?: number;
1795
+ value?: bigint;
1796
+ }): Promise<void> {
1797
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
1798
+ }
1799
+ };
1800
+ }
1801
+
1802
+ /**
1803
+ * Watch contract events
1804
+ *
1805
+ * @example
1806
+ * // Watch all Transfer events
1807
+ * const unwatch = contract.watch.Transfer((event) => {
1808
+ * console.log('Transfer:', event);
1809
+ * });
1810
+ *
1811
+ * // Stop watching
1812
+ * unwatch();
1813
+ */
1814
+ get watch() {
1815
+ return {
1816
+ /**
1817
+ * Watch AdminChanged events
1818
+ * @param callback Function to call when event is emitted
1819
+ * @param filter Optional filter for indexed parameters
1820
+ * @returns Unwatch function to stop listening
1821
+ */
1822
+ AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
1823
+ return this.publicClient.watchContractEvent({
1824
+ address: this.contractAddress,
1825
+ abi: MonegraphERC721_jsonAbi,
1826
+ eventName: 'AdminChanged',
1827
+
1828
+ onLogs: (logs: any[]) => {
1829
+ logs.forEach((log: any) => {
1830
+ callback(log.args as any);
1831
+ });
1832
+ },
1833
+ }) as () => void;
1834
+ },
1835
+ /**
1836
+ * Watch Approval events
1837
+ * @param callback Function to call when event is emitted
1838
+ * @param filter Optional filter for indexed parameters
1839
+ * @returns Unwatch function to stop listening
1840
+ */
1841
+ Approval: (callback: (event: { owner: `0x${string}`; approved: `0x${string}`; tokenId: bigint }) => void, filter?: { owner: `0x${string}`; approved: `0x${string}`; tokenId: bigint }) => {
1842
+ return this.publicClient.watchContractEvent({
1843
+ address: this.contractAddress,
1844
+ abi: MonegraphERC721_jsonAbi,
1845
+ eventName: 'Approval',
1846
+ args: filter,
1847
+ onLogs: (logs: any[]) => {
1848
+ logs.forEach((log: any) => {
1849
+ callback(log.args as any);
1850
+ });
1851
+ },
1852
+ }) as () => void;
1853
+ },
1854
+ /**
1855
+ * Watch ApprovalForAll events
1856
+ * @param callback Function to call when event is emitted
1857
+ * @param filter Optional filter for indexed parameters
1858
+ * @returns Unwatch function to stop listening
1859
+ */
1860
+ ApprovalForAll: (callback: (event: { owner: `0x${string}`; operator: `0x${string}`; approved: boolean }) => void, filter?: { owner: `0x${string}`; operator: `0x${string}` }) => {
1861
+ return this.publicClient.watchContractEvent({
1862
+ address: this.contractAddress,
1863
+ abi: MonegraphERC721_jsonAbi,
1864
+ eventName: 'ApprovalForAll',
1865
+ args: filter,
1866
+ onLogs: (logs: any[]) => {
1867
+ logs.forEach((log: any) => {
1868
+ callback(log.args as any);
1869
+ });
1870
+ },
1871
+ }) as () => void;
1872
+ },
1873
+ /**
1874
+ * Watch BeaconUpgraded events
1875
+ * @param callback Function to call when event is emitted
1876
+ * @param filter Optional filter for indexed parameters
1877
+ * @returns Unwatch function to stop listening
1878
+ */
1879
+ BeaconUpgraded: (callback: (event: { beacon: `0x${string}` }) => void, filter?: { beacon: `0x${string}` }) => {
1880
+ return this.publicClient.watchContractEvent({
1881
+ address: this.contractAddress,
1882
+ abi: MonegraphERC721_jsonAbi,
1883
+ eventName: 'BeaconUpgraded',
1884
+ args: filter,
1885
+ onLogs: (logs: any[]) => {
1886
+ logs.forEach((log: any) => {
1887
+ callback(log.args as any);
1888
+ });
1889
+ },
1890
+ }) as () => void;
1891
+ },
1892
+ /**
1893
+ * Watch NFTAttributes events
1894
+ * @param callback Function to call when event is emitted
1895
+ * @param filter Optional filter for indexed parameters
1896
+ * @returns Unwatch function to stop listening
1897
+ */
1898
+ NFTAttributes: (callback: (event: { tokenId: bigint; attributes: MonegraphERC721_Attributes; uri: string }) => void) => {
1899
+ return this.publicClient.watchContractEvent({
1900
+ address: this.contractAddress,
1901
+ abi: MonegraphERC721_jsonAbi,
1902
+ eventName: 'NFTAttributes',
1903
+
1904
+ onLogs: (logs: any[]) => {
1905
+ logs.forEach((log: any) => {
1906
+ callback(log.args as any);
1907
+ });
1908
+ },
1909
+ }) as () => void;
1910
+ },
1911
+ /**
1912
+ * Watch Paused events
1913
+ * @param callback Function to call when event is emitted
1914
+ * @param filter Optional filter for indexed parameters
1915
+ * @returns Unwatch function to stop listening
1916
+ */
1917
+ Paused: (callback: (event: { account: `0x${string}` }) => void) => {
1918
+ return this.publicClient.watchContractEvent({
1919
+ address: this.contractAddress,
1920
+ abi: MonegraphERC721_jsonAbi,
1921
+ eventName: 'Paused',
1922
+
1923
+ onLogs: (logs: any[]) => {
1924
+ logs.forEach((log: any) => {
1925
+ callback(log.args as any);
1926
+ });
1927
+ },
1928
+ }) as () => void;
1929
+ },
1930
+ /**
1931
+ * Watch RoleAdminChanged events
1932
+ * @param callback Function to call when event is emitted
1933
+ * @param filter Optional filter for indexed parameters
1934
+ * @returns Unwatch function to stop listening
1935
+ */
1936
+ RoleAdminChanged: (callback: (event: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => void, filter?: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => {
1937
+ return this.publicClient.watchContractEvent({
1938
+ address: this.contractAddress,
1939
+ abi: MonegraphERC721_jsonAbi,
1940
+ eventName: 'RoleAdminChanged',
1941
+ args: filter,
1942
+ onLogs: (logs: any[]) => {
1943
+ logs.forEach((log: any) => {
1944
+ callback(log.args as any);
1945
+ });
1946
+ },
1947
+ }) as () => void;
1948
+ },
1949
+ /**
1950
+ * Watch RoleGranted events
1951
+ * @param callback Function to call when event is emitted
1952
+ * @param filter Optional filter for indexed parameters
1953
+ * @returns Unwatch function to stop listening
1954
+ */
1955
+ RoleGranted: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
1956
+ return this.publicClient.watchContractEvent({
1957
+ address: this.contractAddress,
1958
+ abi: MonegraphERC721_jsonAbi,
1959
+ eventName: 'RoleGranted',
1960
+ args: filter,
1961
+ onLogs: (logs: any[]) => {
1962
+ logs.forEach((log: any) => {
1963
+ callback(log.args as any);
1964
+ });
1965
+ },
1966
+ }) as () => void;
1967
+ },
1968
+ /**
1969
+ * Watch RoleRevoked events
1970
+ * @param callback Function to call when event is emitted
1971
+ * @param filter Optional filter for indexed parameters
1972
+ * @returns Unwatch function to stop listening
1973
+ */
1974
+ RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => {
1975
+ return this.publicClient.watchContractEvent({
1976
+ address: this.contractAddress,
1977
+ abi: MonegraphERC721_jsonAbi,
1978
+ eventName: 'RoleRevoked',
1979
+ args: filter,
1980
+ onLogs: (logs: any[]) => {
1981
+ logs.forEach((log: any) => {
1982
+ callback(log.args as any);
1983
+ });
1984
+ },
1985
+ }) as () => void;
1986
+ },
1987
+ /**
1988
+ * Watch Transfer events
1989
+ * @param callback Function to call when event is emitted
1990
+ * @param filter Optional filter for indexed parameters
1991
+ * @returns Unwatch function to stop listening
1992
+ */
1993
+ Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; tokenId: bigint }) => void, filter?: { from: `0x${string}`; to: `0x${string}`; tokenId: bigint }) => {
1994
+ return this.publicClient.watchContractEvent({
1995
+ address: this.contractAddress,
1996
+ abi: MonegraphERC721_jsonAbi,
1997
+ eventName: 'Transfer',
1998
+ args: filter,
1999
+ onLogs: (logs: any[]) => {
2000
+ logs.forEach((log: any) => {
2001
+ callback(log.args as any);
2002
+ });
2003
+ },
2004
+ }) as () => void;
2005
+ },
2006
+ /**
2007
+ * Watch Unpaused events
2008
+ * @param callback Function to call when event is emitted
2009
+ * @param filter Optional filter for indexed parameters
2010
+ * @returns Unwatch function to stop listening
2011
+ */
2012
+ Unpaused: (callback: (event: { account: `0x${string}` }) => void) => {
2013
+ return this.publicClient.watchContractEvent({
2014
+ address: this.contractAddress,
2015
+ abi: MonegraphERC721_jsonAbi,
2016
+ eventName: 'Unpaused',
2017
+
2018
+ onLogs: (logs: any[]) => {
2019
+ logs.forEach((log: any) => {
2020
+ callback(log.args as any);
2021
+ });
2022
+ },
2023
+ }) as () => void;
2024
+ },
2025
+ /**
2026
+ * Watch Upgraded events
2027
+ * @param callback Function to call when event is emitted
2028
+ * @param filter Optional filter for indexed parameters
2029
+ * @returns Unwatch function to stop listening
2030
+ */
2031
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
2032
+ return this.publicClient.watchContractEvent({
2033
+ address: this.contractAddress,
2034
+ abi: MonegraphERC721_jsonAbi,
2035
+ eventName: 'Upgraded',
2036
+ args: filter,
2037
+ onLogs: (logs: any[]) => {
2038
+ logs.forEach((log: any) => {
2039
+ callback(log.args as any);
2040
+ });
2041
+ },
2042
+ }) as () => void;
2043
+ }
2044
+ };
2045
+ }
2046
+ }