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