@gitmyabi/ddawgs 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,768 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeputyDawgsToken_json = exports.DeputyDawgsToken_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * DeputyDawgsToken_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.DeputyDawgsToken_jsonAbi = [
11
+ {
12
+ "inputs": [],
13
+ "stateMutability": "nonpayable",
14
+ "type": "constructor"
15
+ },
16
+ {
17
+ "anonymous": false,
18
+ "inputs": [
19
+ {
20
+ "indexed": true,
21
+ "internalType": "address",
22
+ "name": "owner",
23
+ "type": "address"
24
+ },
25
+ {
26
+ "indexed": true,
27
+ "internalType": "address",
28
+ "name": "spender",
29
+ "type": "address"
30
+ },
31
+ {
32
+ "indexed": false,
33
+ "internalType": "uint256",
34
+ "name": "value",
35
+ "type": "uint256"
36
+ }
37
+ ],
38
+ "name": "Approval",
39
+ "type": "event"
40
+ },
41
+ {
42
+ "anonymous": false,
43
+ "inputs": [
44
+ {
45
+ "indexed": true,
46
+ "internalType": "address",
47
+ "name": "previousOwner",
48
+ "type": "address"
49
+ },
50
+ {
51
+ "indexed": true,
52
+ "internalType": "address",
53
+ "name": "newOwner",
54
+ "type": "address"
55
+ }
56
+ ],
57
+ "name": "OwnershipTransferred",
58
+ "type": "event"
59
+ },
60
+ {
61
+ "anonymous": false,
62
+ "inputs": [
63
+ {
64
+ "indexed": true,
65
+ "internalType": "address",
66
+ "name": "from",
67
+ "type": "address"
68
+ },
69
+ {
70
+ "indexed": true,
71
+ "internalType": "address",
72
+ "name": "to",
73
+ "type": "address"
74
+ },
75
+ {
76
+ "indexed": false,
77
+ "internalType": "uint256",
78
+ "name": "value",
79
+ "type": "uint256"
80
+ }
81
+ ],
82
+ "name": "Transfer",
83
+ "type": "event"
84
+ },
85
+ {
86
+ "inputs": [
87
+ {
88
+ "internalType": "address",
89
+ "name": "owner",
90
+ "type": "address"
91
+ },
92
+ {
93
+ "internalType": "address",
94
+ "name": "spender",
95
+ "type": "address"
96
+ }
97
+ ],
98
+ "name": "allowance",
99
+ "outputs": [
100
+ {
101
+ "internalType": "uint256",
102
+ "name": "",
103
+ "type": "uint256"
104
+ }
105
+ ],
106
+ "stateMutability": "view",
107
+ "type": "function"
108
+ },
109
+ {
110
+ "inputs": [
111
+ {
112
+ "internalType": "address",
113
+ "name": "spender",
114
+ "type": "address"
115
+ },
116
+ {
117
+ "internalType": "uint256",
118
+ "name": "amount",
119
+ "type": "uint256"
120
+ }
121
+ ],
122
+ "name": "approve",
123
+ "outputs": [
124
+ {
125
+ "internalType": "bool",
126
+ "name": "",
127
+ "type": "bool"
128
+ }
129
+ ],
130
+ "stateMutability": "nonpayable",
131
+ "type": "function"
132
+ },
133
+ {
134
+ "inputs": [
135
+ {
136
+ "internalType": "address",
137
+ "name": "account",
138
+ "type": "address"
139
+ }
140
+ ],
141
+ "name": "balanceOf",
142
+ "outputs": [
143
+ {
144
+ "internalType": "uint256",
145
+ "name": "",
146
+ "type": "uint256"
147
+ }
148
+ ],
149
+ "stateMutability": "view",
150
+ "type": "function"
151
+ },
152
+ {
153
+ "inputs": [],
154
+ "name": "decimals",
155
+ "outputs": [
156
+ {
157
+ "internalType": "uint8",
158
+ "name": "",
159
+ "type": "uint8"
160
+ }
161
+ ],
162
+ "stateMutability": "view",
163
+ "type": "function"
164
+ },
165
+ {
166
+ "inputs": [
167
+ {
168
+ "internalType": "address",
169
+ "name": "spender",
170
+ "type": "address"
171
+ },
172
+ {
173
+ "internalType": "uint256",
174
+ "name": "subtractedValue",
175
+ "type": "uint256"
176
+ }
177
+ ],
178
+ "name": "decreaseAllowance",
179
+ "outputs": [
180
+ {
181
+ "internalType": "bool",
182
+ "name": "",
183
+ "type": "bool"
184
+ }
185
+ ],
186
+ "stateMutability": "nonpayable",
187
+ "type": "function"
188
+ },
189
+ {
190
+ "inputs": [],
191
+ "name": "distributeTokensToTeamWallets",
192
+ "outputs": [],
193
+ "stateMutability": "nonpayable",
194
+ "type": "function"
195
+ },
196
+ {
197
+ "inputs": [
198
+ {
199
+ "internalType": "address",
200
+ "name": "spender",
201
+ "type": "address"
202
+ },
203
+ {
204
+ "internalType": "uint256",
205
+ "name": "addedValue",
206
+ "type": "uint256"
207
+ }
208
+ ],
209
+ "name": "increaseAllowance",
210
+ "outputs": [
211
+ {
212
+ "internalType": "bool",
213
+ "name": "",
214
+ "type": "bool"
215
+ }
216
+ ],
217
+ "stateMutability": "nonpayable",
218
+ "type": "function"
219
+ },
220
+ {
221
+ "inputs": [
222
+ {
223
+ "internalType": "address",
224
+ "name": "account",
225
+ "type": "address"
226
+ },
227
+ {
228
+ "internalType": "uint256",
229
+ "name": "amount",
230
+ "type": "uint256"
231
+ }
232
+ ],
233
+ "name": "mint",
234
+ "outputs": [],
235
+ "stateMutability": "nonpayable",
236
+ "type": "function"
237
+ },
238
+ {
239
+ "inputs": [],
240
+ "name": "name",
241
+ "outputs": [
242
+ {
243
+ "internalType": "string",
244
+ "name": "",
245
+ "type": "string"
246
+ }
247
+ ],
248
+ "stateMutability": "view",
249
+ "type": "function"
250
+ },
251
+ {
252
+ "inputs": [],
253
+ "name": "owner",
254
+ "outputs": [
255
+ {
256
+ "internalType": "address",
257
+ "name": "",
258
+ "type": "address"
259
+ }
260
+ ],
261
+ "stateMutability": "view",
262
+ "type": "function"
263
+ },
264
+ {
265
+ "inputs": [],
266
+ "name": "renounceOwnership",
267
+ "outputs": [],
268
+ "stateMutability": "nonpayable",
269
+ "type": "function"
270
+ },
271
+ {
272
+ "inputs": [
273
+ {
274
+ "internalType": "address[]",
275
+ "name": "wallets",
276
+ "type": "address[]"
277
+ },
278
+ {
279
+ "internalType": "uint256[]",
280
+ "name": "percentages",
281
+ "type": "uint256[]"
282
+ }
283
+ ],
284
+ "name": "setTeamWallets",
285
+ "outputs": [],
286
+ "stateMutability": "nonpayable",
287
+ "type": "function"
288
+ },
289
+ {
290
+ "inputs": [],
291
+ "name": "symbol",
292
+ "outputs": [
293
+ {
294
+ "internalType": "string",
295
+ "name": "",
296
+ "type": "string"
297
+ }
298
+ ],
299
+ "stateMutability": "view",
300
+ "type": "function"
301
+ },
302
+ {
303
+ "inputs": [],
304
+ "name": "totalSupply",
305
+ "outputs": [
306
+ {
307
+ "internalType": "uint256",
308
+ "name": "",
309
+ "type": "uint256"
310
+ }
311
+ ],
312
+ "stateMutability": "view",
313
+ "type": "function"
314
+ },
315
+ {
316
+ "inputs": [
317
+ {
318
+ "internalType": "address",
319
+ "name": "to",
320
+ "type": "address"
321
+ },
322
+ {
323
+ "internalType": "uint256",
324
+ "name": "amount",
325
+ "type": "uint256"
326
+ }
327
+ ],
328
+ "name": "transfer",
329
+ "outputs": [
330
+ {
331
+ "internalType": "bool",
332
+ "name": "",
333
+ "type": "bool"
334
+ }
335
+ ],
336
+ "stateMutability": "nonpayable",
337
+ "type": "function"
338
+ },
339
+ {
340
+ "inputs": [
341
+ {
342
+ "internalType": "address",
343
+ "name": "from",
344
+ "type": "address"
345
+ },
346
+ {
347
+ "internalType": "address",
348
+ "name": "to",
349
+ "type": "address"
350
+ },
351
+ {
352
+ "internalType": "uint256",
353
+ "name": "amount",
354
+ "type": "uint256"
355
+ }
356
+ ],
357
+ "name": "transferFrom",
358
+ "outputs": [
359
+ {
360
+ "internalType": "bool",
361
+ "name": "",
362
+ "type": "bool"
363
+ }
364
+ ],
365
+ "stateMutability": "nonpayable",
366
+ "type": "function"
367
+ },
368
+ {
369
+ "inputs": [
370
+ {
371
+ "internalType": "address",
372
+ "name": "newOwner",
373
+ "type": "address"
374
+ }
375
+ ],
376
+ "name": "transferOwnership",
377
+ "outputs": [],
378
+ "stateMutability": "nonpayable",
379
+ "type": "function"
380
+ }
381
+ ];
382
+ /**
383
+ * DeputyDawgsToken_json Contract Class
384
+ *
385
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
386
+ *
387
+ * @example
388
+ * ```typescript
389
+ * import { createPublicClient, createWalletClient, http } from 'viem';
390
+ * import { mainnet } from 'viem/chains';
391
+ * import { DeputyDawgsToken_json } from 'DeputyDawgsToken_json';
392
+ *
393
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
394
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
395
+ *
396
+ * const contract = new DeputyDawgsToken_json('0x...', { publicClient, walletClient });
397
+ *
398
+ * // Read functions
399
+ * const result = await contract.balanceOf('0x...');
400
+ *
401
+ * // Write functions
402
+ * const hash = await contract.transfer('0x...', 1000n);
403
+ *
404
+ * // Simulate transactions (dry-run)
405
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
406
+ * console.log('Gas estimate:', simulation.request.gas);
407
+ *
408
+ * // Watch events
409
+ * const unwatch = contract.watch.Transfer((event) => {
410
+ * console.log('Transfer event:', event);
411
+ * });
412
+ * ```
413
+ */
414
+ class DeputyDawgsToken_json {
415
+ constructor(address, clients) {
416
+ this.contractAddress = address;
417
+ this.publicClient = clients.publicClient;
418
+ this.contract = (0, viem_1.getContract)({
419
+ address,
420
+ abi: exports.DeputyDawgsToken_jsonAbi,
421
+ client: {
422
+ public: clients.publicClient,
423
+ wallet: clients.walletClient,
424
+ },
425
+ });
426
+ }
427
+ /**
428
+ * Get the contract address
429
+ */
430
+ get address() {
431
+ return this.contractAddress;
432
+ }
433
+ /**
434
+ * Get the underlying viem contract instance
435
+ */
436
+ getContract() {
437
+ return this.contract;
438
+ }
439
+ /**
440
+ * allowance
441
+ * view
442
+ */
443
+ async allowance(owner, spender) {
444
+ return this.contract.read.allowance([owner, spender]);
445
+ }
446
+ /**
447
+ * balanceOf
448
+ * view
449
+ */
450
+ async balanceOf(account) {
451
+ return this.contract.read.balanceOf([account]);
452
+ }
453
+ /**
454
+ * decimals
455
+ * view
456
+ */
457
+ async decimals() {
458
+ return this.contract.read.decimals();
459
+ }
460
+ /**
461
+ * name
462
+ * view
463
+ */
464
+ async name() {
465
+ return this.contract.read.name();
466
+ }
467
+ /**
468
+ * owner
469
+ * view
470
+ */
471
+ async owner() {
472
+ return this.contract.read.owner();
473
+ }
474
+ /**
475
+ * symbol
476
+ * view
477
+ */
478
+ async symbol() {
479
+ return this.contract.read.symbol();
480
+ }
481
+ /**
482
+ * totalSupply
483
+ * view
484
+ */
485
+ async totalSupply() {
486
+ return this.contract.read.totalSupply();
487
+ }
488
+ /**
489
+ * approve
490
+ * nonpayable
491
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
492
+ */
493
+ async approve(spender, amount, options) {
494
+ if (!this.contract.write) {
495
+ throw new Error('Wallet client is required for write operations');
496
+ }
497
+ return this.contract.write.approve([spender, amount], options);
498
+ }
499
+ /**
500
+ * decreaseAllowance
501
+ * nonpayable
502
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
503
+ */
504
+ async decreaseAllowance(spender, subtractedValue, options) {
505
+ if (!this.contract.write) {
506
+ throw new Error('Wallet client is required for write operations');
507
+ }
508
+ return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
509
+ }
510
+ /**
511
+ * distributeTokensToTeamWallets
512
+ * nonpayable
513
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
514
+ */
515
+ async distributeTokensToTeamWallets(options) {
516
+ if (!this.contract.write) {
517
+ throw new Error('Wallet client is required for write operations');
518
+ }
519
+ return this.contract.write.distributeTokensToTeamWallets(options);
520
+ }
521
+ /**
522
+ * increaseAllowance
523
+ * nonpayable
524
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
525
+ */
526
+ async increaseAllowance(spender, addedValue, options) {
527
+ if (!this.contract.write) {
528
+ throw new Error('Wallet client is required for write operations');
529
+ }
530
+ return this.contract.write.increaseAllowance([spender, addedValue], options);
531
+ }
532
+ /**
533
+ * mint
534
+ * nonpayable
535
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
536
+ */
537
+ async mint(account, amount, options) {
538
+ if (!this.contract.write) {
539
+ throw new Error('Wallet client is required for write operations');
540
+ }
541
+ return this.contract.write.mint([account, amount], options);
542
+ }
543
+ /**
544
+ * renounceOwnership
545
+ * nonpayable
546
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
547
+ */
548
+ async renounceOwnership(options) {
549
+ if (!this.contract.write) {
550
+ throw new Error('Wallet client is required for write operations');
551
+ }
552
+ return this.contract.write.renounceOwnership(options);
553
+ }
554
+ /**
555
+ * setTeamWallets
556
+ * nonpayable
557
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
558
+ */
559
+ async setTeamWallets(wallets, percentages, options) {
560
+ if (!this.contract.write) {
561
+ throw new Error('Wallet client is required for write operations');
562
+ }
563
+ return this.contract.write.setTeamWallets([wallets, percentages], options);
564
+ }
565
+ /**
566
+ * transfer
567
+ * nonpayable
568
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
569
+ */
570
+ async transfer(to, amount, options) {
571
+ if (!this.contract.write) {
572
+ throw new Error('Wallet client is required for write operations');
573
+ }
574
+ return this.contract.write.transfer([to, amount], options);
575
+ }
576
+ /**
577
+ * transferFrom
578
+ * nonpayable
579
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
580
+ */
581
+ async transferFrom(from, to, amount, options) {
582
+ if (!this.contract.write) {
583
+ throw new Error('Wallet client is required for write operations');
584
+ }
585
+ return this.contract.write.transferFrom([from, to, amount], options);
586
+ }
587
+ /**
588
+ * transferOwnership
589
+ * nonpayable
590
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
591
+ */
592
+ async transferOwnership(newOwner, options) {
593
+ if (!this.contract.write) {
594
+ throw new Error('Wallet client is required for write operations');
595
+ }
596
+ return this.contract.write.transferOwnership([newOwner], options);
597
+ }
598
+ /**
599
+ * Simulate contract write operations (dry-run without sending transaction)
600
+ *
601
+ * @example
602
+ * const result = await contract.simulate.transfer('0x...', 1000n);
603
+ * console.log('Gas estimate:', result.request.gas);
604
+ * console.log('Would succeed:', result.result);
605
+ */
606
+ get simulate() {
607
+ const contract = this.contract;
608
+ if (!contract.simulate) {
609
+ throw new Error('Public client is required for simulation');
610
+ }
611
+ return {
612
+ /**
613
+ * Simulate approve
614
+ * Returns gas estimate and result without sending transaction
615
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
616
+ */
617
+ async approve(spender, amount, options) {
618
+ return contract.simulate.approve([spender, amount], options);
619
+ },
620
+ /**
621
+ * Simulate decreaseAllowance
622
+ * Returns gas estimate and result without sending transaction
623
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
624
+ */
625
+ async decreaseAllowance(spender, subtractedValue, options) {
626
+ return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
627
+ },
628
+ /**
629
+ * Simulate distributeTokensToTeamWallets
630
+ * Returns gas estimate and result without sending transaction
631
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
632
+ */
633
+ async distributeTokensToTeamWallets(options) {
634
+ return contract.simulate.distributeTokensToTeamWallets(options);
635
+ },
636
+ /**
637
+ * Simulate increaseAllowance
638
+ * Returns gas estimate and result without sending transaction
639
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
640
+ */
641
+ async increaseAllowance(spender, addedValue, options) {
642
+ return contract.simulate.increaseAllowance([spender, addedValue], options);
643
+ },
644
+ /**
645
+ * Simulate mint
646
+ * Returns gas estimate and result without sending transaction
647
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
648
+ */
649
+ async mint(account, amount, options) {
650
+ return contract.simulate.mint([account, amount], options);
651
+ },
652
+ /**
653
+ * Simulate renounceOwnership
654
+ * Returns gas estimate and result without sending transaction
655
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
656
+ */
657
+ async renounceOwnership(options) {
658
+ return contract.simulate.renounceOwnership(options);
659
+ },
660
+ /**
661
+ * Simulate setTeamWallets
662
+ * Returns gas estimate and result without sending transaction
663
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
664
+ */
665
+ async setTeamWallets(wallets, percentages, options) {
666
+ return contract.simulate.setTeamWallets([wallets, percentages], options);
667
+ },
668
+ /**
669
+ * Simulate transfer
670
+ * Returns gas estimate and result without sending transaction
671
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
672
+ */
673
+ async transfer(to, amount, options) {
674
+ return contract.simulate.transfer([to, amount], options);
675
+ },
676
+ /**
677
+ * Simulate transferFrom
678
+ * Returns gas estimate and result without sending transaction
679
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
680
+ */
681
+ async transferFrom(from, to, amount, options) {
682
+ return contract.simulate.transferFrom([from, to, amount], options);
683
+ },
684
+ /**
685
+ * Simulate transferOwnership
686
+ * Returns gas estimate and result without sending transaction
687
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
688
+ */
689
+ async transferOwnership(newOwner, options) {
690
+ return contract.simulate.transferOwnership([newOwner], options);
691
+ }
692
+ };
693
+ }
694
+ /**
695
+ * Watch contract events
696
+ *
697
+ * @example
698
+ * // Watch all Transfer events
699
+ * const unwatch = contract.watch.Transfer((event) => {
700
+ * console.log('Transfer:', event);
701
+ * });
702
+ *
703
+ * // Stop watching
704
+ * unwatch();
705
+ */
706
+ get watch() {
707
+ return {
708
+ /**
709
+ * Watch Approval events
710
+ * @param callback Function to call when event is emitted
711
+ * @param filter Optional filter for indexed parameters
712
+ * @returns Unwatch function to stop listening
713
+ */
714
+ Approval: (callback, filter) => {
715
+ return this.publicClient.watchContractEvent({
716
+ address: this.contractAddress,
717
+ abi: exports.DeputyDawgsToken_jsonAbi,
718
+ eventName: 'Approval',
719
+ args: filter,
720
+ onLogs: (logs) => {
721
+ logs.forEach((log) => {
722
+ callback(log.args);
723
+ });
724
+ },
725
+ });
726
+ },
727
+ /**
728
+ * Watch OwnershipTransferred events
729
+ * @param callback Function to call when event is emitted
730
+ * @param filter Optional filter for indexed parameters
731
+ * @returns Unwatch function to stop listening
732
+ */
733
+ OwnershipTransferred: (callback, filter) => {
734
+ return this.publicClient.watchContractEvent({
735
+ address: this.contractAddress,
736
+ abi: exports.DeputyDawgsToken_jsonAbi,
737
+ eventName: 'OwnershipTransferred',
738
+ args: filter,
739
+ onLogs: (logs) => {
740
+ logs.forEach((log) => {
741
+ callback(log.args);
742
+ });
743
+ },
744
+ });
745
+ },
746
+ /**
747
+ * Watch Transfer events
748
+ * @param callback Function to call when event is emitted
749
+ * @param filter Optional filter for indexed parameters
750
+ * @returns Unwatch function to stop listening
751
+ */
752
+ Transfer: (callback, filter) => {
753
+ return this.publicClient.watchContractEvent({
754
+ address: this.contractAddress,
755
+ abi: exports.DeputyDawgsToken_jsonAbi,
756
+ eventName: 'Transfer',
757
+ args: filter,
758
+ onLogs: (logs) => {
759
+ logs.forEach((log) => {
760
+ callback(log.args);
761
+ });
762
+ },
763
+ });
764
+ }
765
+ };
766
+ }
767
+ }
768
+ exports.DeputyDawgsToken_json = DeputyDawgsToken_json;