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