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