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