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