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