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