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