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