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