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