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