@gitmyabi-stg/1inch 0.0.1

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