@gitmyabi/rari 1.0.0 → 1.0.2

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