@gitmyabi-stg/nxm 0.0.1

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,998 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NXMToken = exports.NXMTokenAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * NXMToken ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.NXMTokenAbi = [
11
+ {
12
+ "constant": false,
13
+ "inputs": [
14
+ {
15
+ "name": "_member",
16
+ "type": "address"
17
+ }
18
+ ],
19
+ "name": "removeFromWhiteList",
20
+ "outputs": [
21
+ {
22
+ "name": "",
23
+ "type": "bool"
24
+ }
25
+ ],
26
+ "payable": false,
27
+ "stateMutability": "nonpayable",
28
+ "type": "function"
29
+ },
30
+ {
31
+ "constant": false,
32
+ "inputs": [
33
+ {
34
+ "name": "_newOperator",
35
+ "type": "address"
36
+ }
37
+ ],
38
+ "name": "changeOperator",
39
+ "outputs": [
40
+ {
41
+ "name": "",
42
+ "type": "bool"
43
+ }
44
+ ],
45
+ "payable": false,
46
+ "stateMutability": "nonpayable",
47
+ "type": "function"
48
+ },
49
+ {
50
+ "constant": true,
51
+ "inputs": [],
52
+ "name": "name",
53
+ "outputs": [
54
+ {
55
+ "name": "",
56
+ "type": "string"
57
+ }
58
+ ],
59
+ "payable": false,
60
+ "stateMutability": "view",
61
+ "type": "function"
62
+ },
63
+ {
64
+ "constant": false,
65
+ "inputs": [
66
+ {
67
+ "name": "spender",
68
+ "type": "address"
69
+ },
70
+ {
71
+ "name": "value",
72
+ "type": "uint256"
73
+ }
74
+ ],
75
+ "name": "approve",
76
+ "outputs": [
77
+ {
78
+ "name": "",
79
+ "type": "bool"
80
+ }
81
+ ],
82
+ "payable": false,
83
+ "stateMutability": "nonpayable",
84
+ "type": "function"
85
+ },
86
+ {
87
+ "constant": true,
88
+ "inputs": [],
89
+ "name": "totalSupply",
90
+ "outputs": [
91
+ {
92
+ "name": "",
93
+ "type": "uint256"
94
+ }
95
+ ],
96
+ "payable": false,
97
+ "stateMutability": "view",
98
+ "type": "function"
99
+ },
100
+ {
101
+ "constant": false,
102
+ "inputs": [
103
+ {
104
+ "name": "from",
105
+ "type": "address"
106
+ },
107
+ {
108
+ "name": "to",
109
+ "type": "address"
110
+ },
111
+ {
112
+ "name": "value",
113
+ "type": "uint256"
114
+ }
115
+ ],
116
+ "name": "transferFrom",
117
+ "outputs": [
118
+ {
119
+ "name": "",
120
+ "type": "bool"
121
+ }
122
+ ],
123
+ "payable": false,
124
+ "stateMutability": "nonpayable",
125
+ "type": "function"
126
+ },
127
+ {
128
+ "constant": true,
129
+ "inputs": [],
130
+ "name": "decimals",
131
+ "outputs": [
132
+ {
133
+ "name": "",
134
+ "type": "uint8"
135
+ }
136
+ ],
137
+ "payable": false,
138
+ "stateMutability": "view",
139
+ "type": "function"
140
+ },
141
+ {
142
+ "constant": false,
143
+ "inputs": [
144
+ {
145
+ "name": "spender",
146
+ "type": "address"
147
+ },
148
+ {
149
+ "name": "addedValue",
150
+ "type": "uint256"
151
+ }
152
+ ],
153
+ "name": "increaseAllowance",
154
+ "outputs": [
155
+ {
156
+ "name": "",
157
+ "type": "bool"
158
+ }
159
+ ],
160
+ "payable": false,
161
+ "stateMutability": "nonpayable",
162
+ "type": "function"
163
+ },
164
+ {
165
+ "constant": false,
166
+ "inputs": [
167
+ {
168
+ "name": "account",
169
+ "type": "address"
170
+ },
171
+ {
172
+ "name": "amount",
173
+ "type": "uint256"
174
+ }
175
+ ],
176
+ "name": "mint",
177
+ "outputs": [],
178
+ "payable": false,
179
+ "stateMutability": "nonpayable",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "constant": false,
184
+ "inputs": [
185
+ {
186
+ "name": "amount",
187
+ "type": "uint256"
188
+ }
189
+ ],
190
+ "name": "burn",
191
+ "outputs": [
192
+ {
193
+ "name": "",
194
+ "type": "bool"
195
+ }
196
+ ],
197
+ "payable": false,
198
+ "stateMutability": "nonpayable",
199
+ "type": "function"
200
+ },
201
+ {
202
+ "constant": false,
203
+ "inputs": [
204
+ {
205
+ "name": "_member",
206
+ "type": "address"
207
+ }
208
+ ],
209
+ "name": "addToWhiteList",
210
+ "outputs": [
211
+ {
212
+ "name": "",
213
+ "type": "bool"
214
+ }
215
+ ],
216
+ "payable": false,
217
+ "stateMutability": "nonpayable",
218
+ "type": "function"
219
+ },
220
+ {
221
+ "constant": false,
222
+ "inputs": [
223
+ {
224
+ "name": "_of",
225
+ "type": "address"
226
+ },
227
+ {
228
+ "name": "_days",
229
+ "type": "uint256"
230
+ }
231
+ ],
232
+ "name": "lockForMemberVote",
233
+ "outputs": [],
234
+ "payable": false,
235
+ "stateMutability": "nonpayable",
236
+ "type": "function"
237
+ },
238
+ {
239
+ "constant": true,
240
+ "inputs": [],
241
+ "name": "operator",
242
+ "outputs": [
243
+ {
244
+ "name": "",
245
+ "type": "address"
246
+ }
247
+ ],
248
+ "payable": false,
249
+ "stateMutability": "view",
250
+ "type": "function"
251
+ },
252
+ {
253
+ "constant": true,
254
+ "inputs": [
255
+ {
256
+ "name": "owner",
257
+ "type": "address"
258
+ }
259
+ ],
260
+ "name": "balanceOf",
261
+ "outputs": [
262
+ {
263
+ "name": "",
264
+ "type": "uint256"
265
+ }
266
+ ],
267
+ "payable": false,
268
+ "stateMutability": "view",
269
+ "type": "function"
270
+ },
271
+ {
272
+ "constant": false,
273
+ "inputs": [
274
+ {
275
+ "name": "from",
276
+ "type": "address"
277
+ },
278
+ {
279
+ "name": "value",
280
+ "type": "uint256"
281
+ }
282
+ ],
283
+ "name": "burnFrom",
284
+ "outputs": [
285
+ {
286
+ "name": "",
287
+ "type": "bool"
288
+ }
289
+ ],
290
+ "payable": false,
291
+ "stateMutability": "nonpayable",
292
+ "type": "function"
293
+ },
294
+ {
295
+ "constant": true,
296
+ "inputs": [],
297
+ "name": "symbol",
298
+ "outputs": [
299
+ {
300
+ "name": "",
301
+ "type": "string"
302
+ }
303
+ ],
304
+ "payable": false,
305
+ "stateMutability": "view",
306
+ "type": "function"
307
+ },
308
+ {
309
+ "constant": true,
310
+ "inputs": [
311
+ {
312
+ "name": "",
313
+ "type": "address"
314
+ }
315
+ ],
316
+ "name": "isLockedForMV",
317
+ "outputs": [
318
+ {
319
+ "name": "",
320
+ "type": "uint256"
321
+ }
322
+ ],
323
+ "payable": false,
324
+ "stateMutability": "view",
325
+ "type": "function"
326
+ },
327
+ {
328
+ "constant": false,
329
+ "inputs": [
330
+ {
331
+ "name": "spender",
332
+ "type": "address"
333
+ },
334
+ {
335
+ "name": "subtractedValue",
336
+ "type": "uint256"
337
+ }
338
+ ],
339
+ "name": "decreaseAllowance",
340
+ "outputs": [
341
+ {
342
+ "name": "",
343
+ "type": "bool"
344
+ }
345
+ ],
346
+ "payable": false,
347
+ "stateMutability": "nonpayable",
348
+ "type": "function"
349
+ },
350
+ {
351
+ "constant": false,
352
+ "inputs": [
353
+ {
354
+ "name": "to",
355
+ "type": "address"
356
+ },
357
+ {
358
+ "name": "value",
359
+ "type": "uint256"
360
+ }
361
+ ],
362
+ "name": "transfer",
363
+ "outputs": [
364
+ {
365
+ "name": "",
366
+ "type": "bool"
367
+ }
368
+ ],
369
+ "payable": false,
370
+ "stateMutability": "nonpayable",
371
+ "type": "function"
372
+ },
373
+ {
374
+ "constant": false,
375
+ "inputs": [
376
+ {
377
+ "name": "from",
378
+ "type": "address"
379
+ },
380
+ {
381
+ "name": "value",
382
+ "type": "uint256"
383
+ }
384
+ ],
385
+ "name": "operatorTransfer",
386
+ "outputs": [
387
+ {
388
+ "name": "",
389
+ "type": "bool"
390
+ }
391
+ ],
392
+ "payable": false,
393
+ "stateMutability": "nonpayable",
394
+ "type": "function"
395
+ },
396
+ {
397
+ "constant": true,
398
+ "inputs": [
399
+ {
400
+ "name": "owner",
401
+ "type": "address"
402
+ },
403
+ {
404
+ "name": "spender",
405
+ "type": "address"
406
+ }
407
+ ],
408
+ "name": "allowance",
409
+ "outputs": [
410
+ {
411
+ "name": "",
412
+ "type": "uint256"
413
+ }
414
+ ],
415
+ "payable": false,
416
+ "stateMutability": "view",
417
+ "type": "function"
418
+ },
419
+ {
420
+ "constant": true,
421
+ "inputs": [
422
+ {
423
+ "name": "",
424
+ "type": "address"
425
+ }
426
+ ],
427
+ "name": "whiteListed",
428
+ "outputs": [
429
+ {
430
+ "name": "",
431
+ "type": "bool"
432
+ }
433
+ ],
434
+ "payable": false,
435
+ "stateMutability": "view",
436
+ "type": "function"
437
+ },
438
+ {
439
+ "inputs": [
440
+ {
441
+ "name": "_founderAddress",
442
+ "type": "address"
443
+ },
444
+ {
445
+ "name": "_initialSupply",
446
+ "type": "uint256"
447
+ }
448
+ ],
449
+ "payable": false,
450
+ "stateMutability": "nonpayable",
451
+ "type": "constructor"
452
+ },
453
+ {
454
+ "anonymous": false,
455
+ "inputs": [
456
+ {
457
+ "indexed": true,
458
+ "name": "member",
459
+ "type": "address"
460
+ }
461
+ ],
462
+ "name": "WhiteListed",
463
+ "type": "event"
464
+ },
465
+ {
466
+ "anonymous": false,
467
+ "inputs": [
468
+ {
469
+ "indexed": true,
470
+ "name": "member",
471
+ "type": "address"
472
+ }
473
+ ],
474
+ "name": "BlackListed",
475
+ "type": "event"
476
+ },
477
+ {
478
+ "anonymous": false,
479
+ "inputs": [
480
+ {
481
+ "indexed": true,
482
+ "name": "from",
483
+ "type": "address"
484
+ },
485
+ {
486
+ "indexed": true,
487
+ "name": "to",
488
+ "type": "address"
489
+ },
490
+ {
491
+ "indexed": false,
492
+ "name": "value",
493
+ "type": "uint256"
494
+ }
495
+ ],
496
+ "name": "Transfer",
497
+ "type": "event"
498
+ },
499
+ {
500
+ "anonymous": false,
501
+ "inputs": [
502
+ {
503
+ "indexed": true,
504
+ "name": "owner",
505
+ "type": "address"
506
+ },
507
+ {
508
+ "indexed": true,
509
+ "name": "spender",
510
+ "type": "address"
511
+ },
512
+ {
513
+ "indexed": false,
514
+ "name": "value",
515
+ "type": "uint256"
516
+ }
517
+ ],
518
+ "name": "Approval",
519
+ "type": "event"
520
+ }
521
+ ];
522
+ /**
523
+ * NXMToken Contract Class
524
+ *
525
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
526
+ *
527
+ * @example
528
+ * ```typescript
529
+ * import { createPublicClient, createWalletClient, http } from 'viem';
530
+ * import { mainnet } from 'viem/chains';
531
+ * import { NXMToken } from 'NXMToken';
532
+ *
533
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
534
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
535
+ *
536
+ * const contract = new NXMToken('0x...', { publicClient, walletClient });
537
+ *
538
+ * // Read functions
539
+ * const result = await contract.balanceOf('0x...');
540
+ *
541
+ * // Write functions
542
+ * const hash = await contract.transfer('0x...', 1000n);
543
+ *
544
+ * // Simulate transactions (dry-run)
545
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
546
+ * console.log('Gas estimate:', simulation.request.gas);
547
+ *
548
+ * // Watch events
549
+ * const unwatch = contract.watch.Transfer((event) => {
550
+ * console.log('Transfer event:', event);
551
+ * });
552
+ * ```
553
+ */
554
+ class NXMToken {
555
+ constructor(address, clients) {
556
+ this.contractAddress = address;
557
+ this.publicClient = clients.publicClient;
558
+ this.contract = (0, viem_1.getContract)({
559
+ address,
560
+ abi: exports.NXMTokenAbi,
561
+ client: {
562
+ public: clients.publicClient,
563
+ wallet: clients.walletClient,
564
+ },
565
+ });
566
+ }
567
+ /**
568
+ * Get the contract address
569
+ */
570
+ get address() {
571
+ return this.contractAddress;
572
+ }
573
+ /**
574
+ * Get the underlying viem contract instance.
575
+ */
576
+ getContract() {
577
+ return this.contract;
578
+ }
579
+ /**
580
+ * name
581
+ * view
582
+ */
583
+ async name() {
584
+ return this.contract.read.name();
585
+ }
586
+ /**
587
+ * totalSupply
588
+ * view
589
+ */
590
+ async totalSupply() {
591
+ return this.contract.read.totalSupply();
592
+ }
593
+ /**
594
+ * decimals
595
+ * view
596
+ */
597
+ async decimals() {
598
+ return this.contract.read.decimals();
599
+ }
600
+ /**
601
+ * operator
602
+ * view
603
+ */
604
+ async operator() {
605
+ return this.contract.read.operator();
606
+ }
607
+ /**
608
+ * balanceOf
609
+ * view
610
+ */
611
+ async balanceOf(owner) {
612
+ return this.contract.read.balanceOf([owner]);
613
+ }
614
+ /**
615
+ * symbol
616
+ * view
617
+ */
618
+ async symbol() {
619
+ return this.contract.read.symbol();
620
+ }
621
+ /**
622
+ * isLockedForMV
623
+ * view
624
+ */
625
+ async isLockedForMV(arg0) {
626
+ return this.contract.read.isLockedForMV([arg0]);
627
+ }
628
+ /**
629
+ * allowance
630
+ * view
631
+ */
632
+ async allowance(owner, spender) {
633
+ return this.contract.read.allowance([owner, spender]);
634
+ }
635
+ /**
636
+ * whiteListed
637
+ * view
638
+ */
639
+ async whiteListed(arg0) {
640
+ return this.contract.read.whiteListed([arg0]);
641
+ }
642
+ /**
643
+ * removeFromWhiteList
644
+ * nonpayable
645
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
646
+ */
647
+ async removeFromWhiteList(_member, options) {
648
+ if (!this.contract.write) {
649
+ throw new Error('Wallet client is required for write operations');
650
+ }
651
+ return this.contract.write.removeFromWhiteList([_member], options);
652
+ }
653
+ /**
654
+ * changeOperator
655
+ * nonpayable
656
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
657
+ */
658
+ async changeOperator(_newOperator, options) {
659
+ if (!this.contract.write) {
660
+ throw new Error('Wallet client is required for write operations');
661
+ }
662
+ return this.contract.write.changeOperator([_newOperator], options);
663
+ }
664
+ /**
665
+ * approve
666
+ * nonpayable
667
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
668
+ */
669
+ async approve(spender, value, options) {
670
+ if (!this.contract.write) {
671
+ throw new Error('Wallet client is required for write operations');
672
+ }
673
+ return this.contract.write.approve([spender, value], options);
674
+ }
675
+ /**
676
+ * transferFrom
677
+ * nonpayable
678
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
679
+ */
680
+ async transferFrom(from, to, value, options) {
681
+ if (!this.contract.write) {
682
+ throw new Error('Wallet client is required for write operations');
683
+ }
684
+ return this.contract.write.transferFrom([from, to, value], options);
685
+ }
686
+ /**
687
+ * increaseAllowance
688
+ * nonpayable
689
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
690
+ */
691
+ async increaseAllowance(spender, addedValue, options) {
692
+ if (!this.contract.write) {
693
+ throw new Error('Wallet client is required for write operations');
694
+ }
695
+ return this.contract.write.increaseAllowance([spender, addedValue], options);
696
+ }
697
+ /**
698
+ * mint
699
+ * nonpayable
700
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
701
+ */
702
+ async mint(account, amount, options) {
703
+ if (!this.contract.write) {
704
+ throw new Error('Wallet client is required for write operations');
705
+ }
706
+ return this.contract.write.mint([account, amount], options);
707
+ }
708
+ /**
709
+ * burn
710
+ * nonpayable
711
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
712
+ */
713
+ async burn(amount, options) {
714
+ if (!this.contract.write) {
715
+ throw new Error('Wallet client is required for write operations');
716
+ }
717
+ return this.contract.write.burn([amount], options);
718
+ }
719
+ /**
720
+ * addToWhiteList
721
+ * nonpayable
722
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
723
+ */
724
+ async addToWhiteList(_member, options) {
725
+ if (!this.contract.write) {
726
+ throw new Error('Wallet client is required for write operations');
727
+ }
728
+ return this.contract.write.addToWhiteList([_member], options);
729
+ }
730
+ /**
731
+ * lockForMemberVote
732
+ * nonpayable
733
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
734
+ */
735
+ async lockForMemberVote(_of, _days, options) {
736
+ if (!this.contract.write) {
737
+ throw new Error('Wallet client is required for write operations');
738
+ }
739
+ return this.contract.write.lockForMemberVote([_of, _days], options);
740
+ }
741
+ /**
742
+ * burnFrom
743
+ * nonpayable
744
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
745
+ */
746
+ async burnFrom(from, value, options) {
747
+ if (!this.contract.write) {
748
+ throw new Error('Wallet client is required for write operations');
749
+ }
750
+ return this.contract.write.burnFrom([from, value], options);
751
+ }
752
+ /**
753
+ * decreaseAllowance
754
+ * nonpayable
755
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
756
+ */
757
+ async decreaseAllowance(spender, subtractedValue, options) {
758
+ if (!this.contract.write) {
759
+ throw new Error('Wallet client is required for write operations');
760
+ }
761
+ return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
762
+ }
763
+ /**
764
+ * transfer
765
+ * nonpayable
766
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
767
+ */
768
+ async transfer(to, value, options) {
769
+ if (!this.contract.write) {
770
+ throw new Error('Wallet client is required for write operations');
771
+ }
772
+ return this.contract.write.transfer([to, value], options);
773
+ }
774
+ /**
775
+ * operatorTransfer
776
+ * nonpayable
777
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
778
+ */
779
+ async operatorTransfer(from, value, options) {
780
+ if (!this.contract.write) {
781
+ throw new Error('Wallet client is required for write operations');
782
+ }
783
+ return this.contract.write.operatorTransfer([from, value], options);
784
+ }
785
+ /**
786
+ * Simulate contract write operations (dry-run without sending transaction)
787
+ *
788
+ * @example
789
+ * const result = await contract.simulate.transfer('0x...', 1000n);
790
+ * console.log('Gas estimate:', result.request.gas);
791
+ * console.log('Would succeed:', result.result);
792
+ */
793
+ get simulate() {
794
+ const contract = this.contract;
795
+ if (!contract.simulate) {
796
+ throw new Error('Public client is required for simulation');
797
+ }
798
+ return {
799
+ /**
800
+ * Simulate removeFromWhiteList
801
+ * Returns gas estimate and result without sending transaction
802
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
803
+ */
804
+ async removeFromWhiteList(_member, options) {
805
+ return contract.simulate.removeFromWhiteList([_member], options);
806
+ },
807
+ /**
808
+ * Simulate changeOperator
809
+ * Returns gas estimate and result without sending transaction
810
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
811
+ */
812
+ async changeOperator(_newOperator, options) {
813
+ return contract.simulate.changeOperator([_newOperator], options);
814
+ },
815
+ /**
816
+ * Simulate approve
817
+ * Returns gas estimate and result without sending transaction
818
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
819
+ */
820
+ async approve(spender, value, options) {
821
+ return contract.simulate.approve([spender, value], options);
822
+ },
823
+ /**
824
+ * Simulate transferFrom
825
+ * Returns gas estimate and result without sending transaction
826
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
827
+ */
828
+ async transferFrom(from, to, value, options) {
829
+ return contract.simulate.transferFrom([from, to, value], options);
830
+ },
831
+ /**
832
+ * Simulate increaseAllowance
833
+ * Returns gas estimate and result without sending transaction
834
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
835
+ */
836
+ async increaseAllowance(spender, addedValue, options) {
837
+ return contract.simulate.increaseAllowance([spender, addedValue], options);
838
+ },
839
+ /**
840
+ * Simulate mint
841
+ * Returns gas estimate and result without sending transaction
842
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
843
+ */
844
+ async mint(account, amount, options) {
845
+ return contract.simulate.mint([account, amount], options);
846
+ },
847
+ /**
848
+ * Simulate burn
849
+ * Returns gas estimate and result without sending transaction
850
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
851
+ */
852
+ async burn(amount, options) {
853
+ return contract.simulate.burn([amount], options);
854
+ },
855
+ /**
856
+ * Simulate addToWhiteList
857
+ * Returns gas estimate and result without sending transaction
858
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
859
+ */
860
+ async addToWhiteList(_member, options) {
861
+ return contract.simulate.addToWhiteList([_member], options);
862
+ },
863
+ /**
864
+ * Simulate lockForMemberVote
865
+ * Returns gas estimate and result without sending transaction
866
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
867
+ */
868
+ async lockForMemberVote(_of, _days, options) {
869
+ return contract.simulate.lockForMemberVote([_of, _days], options);
870
+ },
871
+ /**
872
+ * Simulate burnFrom
873
+ * Returns gas estimate and result without sending transaction
874
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
875
+ */
876
+ async burnFrom(from, value, options) {
877
+ return contract.simulate.burnFrom([from, value], options);
878
+ },
879
+ /**
880
+ * Simulate decreaseAllowance
881
+ * Returns gas estimate and result without sending transaction
882
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
883
+ */
884
+ async decreaseAllowance(spender, subtractedValue, options) {
885
+ return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
886
+ },
887
+ /**
888
+ * Simulate transfer
889
+ * Returns gas estimate and result without sending transaction
890
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
891
+ */
892
+ async transfer(to, value, options) {
893
+ return contract.simulate.transfer([to, value], options);
894
+ },
895
+ /**
896
+ * Simulate operatorTransfer
897
+ * Returns gas estimate and result without sending transaction
898
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
899
+ */
900
+ async operatorTransfer(from, value, options) {
901
+ return contract.simulate.operatorTransfer([from, value], options);
902
+ }
903
+ };
904
+ }
905
+ /**
906
+ * Watch contract events
907
+ *
908
+ * @example
909
+ * // Watch all Transfer events
910
+ * const unwatch = contract.watch.Transfer((event) => {
911
+ * console.log('Transfer:', event);
912
+ * });
913
+ *
914
+ * // Stop watching
915
+ * unwatch();
916
+ */
917
+ get watch() {
918
+ return {
919
+ /**
920
+ * Watch WhiteListed events
921
+ * @param callback Function to call when event is emitted
922
+ * @param filter Optional filter for indexed parameters
923
+ * @returns Unwatch function to stop listening
924
+ */
925
+ WhiteListed: (callback, filter) => {
926
+ return this.publicClient.watchContractEvent({
927
+ address: this.contractAddress,
928
+ abi: exports.NXMTokenAbi,
929
+ eventName: 'WhiteListed',
930
+ args: filter,
931
+ onLogs: (logs) => {
932
+ logs.forEach((log) => {
933
+ callback(log.args);
934
+ });
935
+ },
936
+ });
937
+ },
938
+ /**
939
+ * Watch BlackListed events
940
+ * @param callback Function to call when event is emitted
941
+ * @param filter Optional filter for indexed parameters
942
+ * @returns Unwatch function to stop listening
943
+ */
944
+ BlackListed: (callback, filter) => {
945
+ return this.publicClient.watchContractEvent({
946
+ address: this.contractAddress,
947
+ abi: exports.NXMTokenAbi,
948
+ eventName: 'BlackListed',
949
+ args: filter,
950
+ onLogs: (logs) => {
951
+ logs.forEach((log) => {
952
+ callback(log.args);
953
+ });
954
+ },
955
+ });
956
+ },
957
+ /**
958
+ * Watch Transfer events
959
+ * @param callback Function to call when event is emitted
960
+ * @param filter Optional filter for indexed parameters
961
+ * @returns Unwatch function to stop listening
962
+ */
963
+ Transfer: (callback, filter) => {
964
+ return this.publicClient.watchContractEvent({
965
+ address: this.contractAddress,
966
+ abi: exports.NXMTokenAbi,
967
+ eventName: 'Transfer',
968
+ args: filter,
969
+ onLogs: (logs) => {
970
+ logs.forEach((log) => {
971
+ callback(log.args);
972
+ });
973
+ },
974
+ });
975
+ },
976
+ /**
977
+ * Watch Approval events
978
+ * @param callback Function to call when event is emitted
979
+ * @param filter Optional filter for indexed parameters
980
+ * @returns Unwatch function to stop listening
981
+ */
982
+ Approval: (callback, filter) => {
983
+ return this.publicClient.watchContractEvent({
984
+ address: this.contractAddress,
985
+ abi: exports.NXMTokenAbi,
986
+ eventName: 'Approval',
987
+ args: filter,
988
+ onLogs: (logs) => {
989
+ logs.forEach((log) => {
990
+ callback(log.args);
991
+ });
992
+ },
993
+ });
994
+ }
995
+ };
996
+ }
997
+ }
998
+ exports.NXMToken = NXMToken;