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