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