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