@gitmyabi/onewaybidhook 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,1615 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OneWayBidHook_json = exports.OneWayBidHook_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * OneWayBidHook_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.OneWayBidHook_jsonAbi = [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "contract IPoolManager",
15
+ "name": "_poolManager",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "internalType": "address",
20
+ "name": "_accumulatedToken",
21
+ "type": "address"
22
+ },
23
+ {
24
+ "internalType": "uint24",
25
+ "name": "_allowedDirectionFee",
26
+ "type": "uint24"
27
+ },
28
+ {
29
+ "internalType": "uint24",
30
+ "name": "_blockedDirectionFee",
31
+ "type": "uint24"
32
+ },
33
+ {
34
+ "internalType": "address",
35
+ "name": "_owner",
36
+ "type": "address"
37
+ }
38
+ ],
39
+ "stateMutability": "nonpayable",
40
+ "type": "constructor"
41
+ },
42
+ {
43
+ "inputs": [],
44
+ "name": "FeeOutOfRange",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "inputs": [],
49
+ "name": "HookNotImplemented",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "inputs": [],
54
+ "name": "NotOwner",
55
+ "type": "error"
56
+ },
57
+ {
58
+ "inputs": [],
59
+ "name": "NotPoolManager",
60
+ "type": "error"
61
+ },
62
+ {
63
+ "inputs": [],
64
+ "name": "ZeroAddress",
65
+ "type": "error"
66
+ },
67
+ {
68
+ "anonymous": false,
69
+ "inputs": [
70
+ {
71
+ "indexed": false,
72
+ "internalType": "uint24",
73
+ "name": "oldFee",
74
+ "type": "uint24"
75
+ },
76
+ {
77
+ "indexed": false,
78
+ "internalType": "uint24",
79
+ "name": "newFee",
80
+ "type": "uint24"
81
+ }
82
+ ],
83
+ "name": "AllowedFeeUpdated",
84
+ "type": "event"
85
+ },
86
+ {
87
+ "anonymous": false,
88
+ "inputs": [
89
+ {
90
+ "indexed": false,
91
+ "internalType": "uint24",
92
+ "name": "oldFee",
93
+ "type": "uint24"
94
+ },
95
+ {
96
+ "indexed": false,
97
+ "internalType": "uint24",
98
+ "name": "newFee",
99
+ "type": "uint24"
100
+ }
101
+ ],
102
+ "name": "BlockedFeeUpdated",
103
+ "type": "event"
104
+ },
105
+ {
106
+ "anonymous": false,
107
+ "inputs": [
108
+ {
109
+ "indexed": true,
110
+ "internalType": "address",
111
+ "name": "oldOwner",
112
+ "type": "address"
113
+ },
114
+ {
115
+ "indexed": true,
116
+ "internalType": "address",
117
+ "name": "newOwner",
118
+ "type": "address"
119
+ }
120
+ ],
121
+ "name": "OwnerTransferred",
122
+ "type": "event"
123
+ },
124
+ {
125
+ "inputs": [],
126
+ "name": "MAX_ALLOWED_FEE",
127
+ "outputs": [
128
+ {
129
+ "internalType": "uint24",
130
+ "name": "",
131
+ "type": "uint24"
132
+ }
133
+ ],
134
+ "stateMutability": "view",
135
+ "type": "function"
136
+ },
137
+ {
138
+ "inputs": [],
139
+ "name": "MAX_BLOCKED_FEE",
140
+ "outputs": [
141
+ {
142
+ "internalType": "uint24",
143
+ "name": "",
144
+ "type": "uint24"
145
+ }
146
+ ],
147
+ "stateMutability": "view",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "inputs": [],
152
+ "name": "MIN_ALLOWED_FEE",
153
+ "outputs": [
154
+ {
155
+ "internalType": "uint24",
156
+ "name": "",
157
+ "type": "uint24"
158
+ }
159
+ ],
160
+ "stateMutability": "view",
161
+ "type": "function"
162
+ },
163
+ {
164
+ "inputs": [],
165
+ "name": "MIN_BLOCKED_FEE",
166
+ "outputs": [
167
+ {
168
+ "internalType": "uint24",
169
+ "name": "",
170
+ "type": "uint24"
171
+ }
172
+ ],
173
+ "stateMutability": "view",
174
+ "type": "function"
175
+ },
176
+ {
177
+ "inputs": [],
178
+ "name": "accumulatedToken",
179
+ "outputs": [
180
+ {
181
+ "internalType": "address",
182
+ "name": "",
183
+ "type": "address"
184
+ }
185
+ ],
186
+ "stateMutability": "view",
187
+ "type": "function"
188
+ },
189
+ {
190
+ "inputs": [
191
+ {
192
+ "internalType": "address",
193
+ "name": "sender",
194
+ "type": "address"
195
+ },
196
+ {
197
+ "components": [
198
+ {
199
+ "internalType": "Currency",
200
+ "name": "currency0",
201
+ "type": "address"
202
+ },
203
+ {
204
+ "internalType": "Currency",
205
+ "name": "currency1",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "internalType": "uint24",
210
+ "name": "fee",
211
+ "type": "uint24"
212
+ },
213
+ {
214
+ "internalType": "int24",
215
+ "name": "tickSpacing",
216
+ "type": "int24"
217
+ },
218
+ {
219
+ "internalType": "contract IHooks",
220
+ "name": "hooks",
221
+ "type": "address"
222
+ }
223
+ ],
224
+ "internalType": "struct PoolKey",
225
+ "name": "key",
226
+ "type": "tuple"
227
+ },
228
+ {
229
+ "components": [
230
+ {
231
+ "internalType": "int24",
232
+ "name": "tickLower",
233
+ "type": "int24"
234
+ },
235
+ {
236
+ "internalType": "int24",
237
+ "name": "tickUpper",
238
+ "type": "int24"
239
+ },
240
+ {
241
+ "internalType": "int256",
242
+ "name": "liquidityDelta",
243
+ "type": "int256"
244
+ },
245
+ {
246
+ "internalType": "bytes32",
247
+ "name": "salt",
248
+ "type": "bytes32"
249
+ }
250
+ ],
251
+ "internalType": "struct ModifyLiquidityParams",
252
+ "name": "params",
253
+ "type": "tuple"
254
+ },
255
+ {
256
+ "internalType": "BalanceDelta",
257
+ "name": "delta",
258
+ "type": "int256"
259
+ },
260
+ {
261
+ "internalType": "BalanceDelta",
262
+ "name": "feesAccrued",
263
+ "type": "int256"
264
+ },
265
+ {
266
+ "internalType": "bytes",
267
+ "name": "hookData",
268
+ "type": "bytes"
269
+ }
270
+ ],
271
+ "name": "afterAddLiquidity",
272
+ "outputs": [
273
+ {
274
+ "internalType": "bytes4",
275
+ "name": "",
276
+ "type": "bytes4"
277
+ },
278
+ {
279
+ "internalType": "BalanceDelta",
280
+ "name": "",
281
+ "type": "int256"
282
+ }
283
+ ],
284
+ "stateMutability": "nonpayable",
285
+ "type": "function"
286
+ },
287
+ {
288
+ "inputs": [
289
+ {
290
+ "internalType": "address",
291
+ "name": "sender",
292
+ "type": "address"
293
+ },
294
+ {
295
+ "components": [
296
+ {
297
+ "internalType": "Currency",
298
+ "name": "currency0",
299
+ "type": "address"
300
+ },
301
+ {
302
+ "internalType": "Currency",
303
+ "name": "currency1",
304
+ "type": "address"
305
+ },
306
+ {
307
+ "internalType": "uint24",
308
+ "name": "fee",
309
+ "type": "uint24"
310
+ },
311
+ {
312
+ "internalType": "int24",
313
+ "name": "tickSpacing",
314
+ "type": "int24"
315
+ },
316
+ {
317
+ "internalType": "contract IHooks",
318
+ "name": "hooks",
319
+ "type": "address"
320
+ }
321
+ ],
322
+ "internalType": "struct PoolKey",
323
+ "name": "key",
324
+ "type": "tuple"
325
+ },
326
+ {
327
+ "internalType": "uint256",
328
+ "name": "amount0",
329
+ "type": "uint256"
330
+ },
331
+ {
332
+ "internalType": "uint256",
333
+ "name": "amount1",
334
+ "type": "uint256"
335
+ },
336
+ {
337
+ "internalType": "bytes",
338
+ "name": "hookData",
339
+ "type": "bytes"
340
+ }
341
+ ],
342
+ "name": "afterDonate",
343
+ "outputs": [
344
+ {
345
+ "internalType": "bytes4",
346
+ "name": "",
347
+ "type": "bytes4"
348
+ }
349
+ ],
350
+ "stateMutability": "nonpayable",
351
+ "type": "function"
352
+ },
353
+ {
354
+ "inputs": [
355
+ {
356
+ "internalType": "address",
357
+ "name": "sender",
358
+ "type": "address"
359
+ },
360
+ {
361
+ "components": [
362
+ {
363
+ "internalType": "Currency",
364
+ "name": "currency0",
365
+ "type": "address"
366
+ },
367
+ {
368
+ "internalType": "Currency",
369
+ "name": "currency1",
370
+ "type": "address"
371
+ },
372
+ {
373
+ "internalType": "uint24",
374
+ "name": "fee",
375
+ "type": "uint24"
376
+ },
377
+ {
378
+ "internalType": "int24",
379
+ "name": "tickSpacing",
380
+ "type": "int24"
381
+ },
382
+ {
383
+ "internalType": "contract IHooks",
384
+ "name": "hooks",
385
+ "type": "address"
386
+ }
387
+ ],
388
+ "internalType": "struct PoolKey",
389
+ "name": "key",
390
+ "type": "tuple"
391
+ },
392
+ {
393
+ "internalType": "uint160",
394
+ "name": "sqrtPriceX96",
395
+ "type": "uint160"
396
+ },
397
+ {
398
+ "internalType": "int24",
399
+ "name": "tick",
400
+ "type": "int24"
401
+ }
402
+ ],
403
+ "name": "afterInitialize",
404
+ "outputs": [
405
+ {
406
+ "internalType": "bytes4",
407
+ "name": "",
408
+ "type": "bytes4"
409
+ }
410
+ ],
411
+ "stateMutability": "nonpayable",
412
+ "type": "function"
413
+ },
414
+ {
415
+ "inputs": [
416
+ {
417
+ "internalType": "address",
418
+ "name": "sender",
419
+ "type": "address"
420
+ },
421
+ {
422
+ "components": [
423
+ {
424
+ "internalType": "Currency",
425
+ "name": "currency0",
426
+ "type": "address"
427
+ },
428
+ {
429
+ "internalType": "Currency",
430
+ "name": "currency1",
431
+ "type": "address"
432
+ },
433
+ {
434
+ "internalType": "uint24",
435
+ "name": "fee",
436
+ "type": "uint24"
437
+ },
438
+ {
439
+ "internalType": "int24",
440
+ "name": "tickSpacing",
441
+ "type": "int24"
442
+ },
443
+ {
444
+ "internalType": "contract IHooks",
445
+ "name": "hooks",
446
+ "type": "address"
447
+ }
448
+ ],
449
+ "internalType": "struct PoolKey",
450
+ "name": "key",
451
+ "type": "tuple"
452
+ },
453
+ {
454
+ "components": [
455
+ {
456
+ "internalType": "int24",
457
+ "name": "tickLower",
458
+ "type": "int24"
459
+ },
460
+ {
461
+ "internalType": "int24",
462
+ "name": "tickUpper",
463
+ "type": "int24"
464
+ },
465
+ {
466
+ "internalType": "int256",
467
+ "name": "liquidityDelta",
468
+ "type": "int256"
469
+ },
470
+ {
471
+ "internalType": "bytes32",
472
+ "name": "salt",
473
+ "type": "bytes32"
474
+ }
475
+ ],
476
+ "internalType": "struct ModifyLiquidityParams",
477
+ "name": "params",
478
+ "type": "tuple"
479
+ },
480
+ {
481
+ "internalType": "BalanceDelta",
482
+ "name": "delta",
483
+ "type": "int256"
484
+ },
485
+ {
486
+ "internalType": "BalanceDelta",
487
+ "name": "feesAccrued",
488
+ "type": "int256"
489
+ },
490
+ {
491
+ "internalType": "bytes",
492
+ "name": "hookData",
493
+ "type": "bytes"
494
+ }
495
+ ],
496
+ "name": "afterRemoveLiquidity",
497
+ "outputs": [
498
+ {
499
+ "internalType": "bytes4",
500
+ "name": "",
501
+ "type": "bytes4"
502
+ },
503
+ {
504
+ "internalType": "BalanceDelta",
505
+ "name": "",
506
+ "type": "int256"
507
+ }
508
+ ],
509
+ "stateMutability": "nonpayable",
510
+ "type": "function"
511
+ },
512
+ {
513
+ "inputs": [
514
+ {
515
+ "internalType": "address",
516
+ "name": "sender",
517
+ "type": "address"
518
+ },
519
+ {
520
+ "components": [
521
+ {
522
+ "internalType": "Currency",
523
+ "name": "currency0",
524
+ "type": "address"
525
+ },
526
+ {
527
+ "internalType": "Currency",
528
+ "name": "currency1",
529
+ "type": "address"
530
+ },
531
+ {
532
+ "internalType": "uint24",
533
+ "name": "fee",
534
+ "type": "uint24"
535
+ },
536
+ {
537
+ "internalType": "int24",
538
+ "name": "tickSpacing",
539
+ "type": "int24"
540
+ },
541
+ {
542
+ "internalType": "contract IHooks",
543
+ "name": "hooks",
544
+ "type": "address"
545
+ }
546
+ ],
547
+ "internalType": "struct PoolKey",
548
+ "name": "key",
549
+ "type": "tuple"
550
+ },
551
+ {
552
+ "components": [
553
+ {
554
+ "internalType": "bool",
555
+ "name": "zeroForOne",
556
+ "type": "bool"
557
+ },
558
+ {
559
+ "internalType": "int256",
560
+ "name": "amountSpecified",
561
+ "type": "int256"
562
+ },
563
+ {
564
+ "internalType": "uint160",
565
+ "name": "sqrtPriceLimitX96",
566
+ "type": "uint160"
567
+ }
568
+ ],
569
+ "internalType": "struct SwapParams",
570
+ "name": "params",
571
+ "type": "tuple"
572
+ },
573
+ {
574
+ "internalType": "BalanceDelta",
575
+ "name": "delta",
576
+ "type": "int256"
577
+ },
578
+ {
579
+ "internalType": "bytes",
580
+ "name": "hookData",
581
+ "type": "bytes"
582
+ }
583
+ ],
584
+ "name": "afterSwap",
585
+ "outputs": [
586
+ {
587
+ "internalType": "bytes4",
588
+ "name": "",
589
+ "type": "bytes4"
590
+ },
591
+ {
592
+ "internalType": "int128",
593
+ "name": "",
594
+ "type": "int128"
595
+ }
596
+ ],
597
+ "stateMutability": "nonpayable",
598
+ "type": "function"
599
+ },
600
+ {
601
+ "inputs": [],
602
+ "name": "allowedDirectionFee",
603
+ "outputs": [
604
+ {
605
+ "internalType": "uint24",
606
+ "name": "",
607
+ "type": "uint24"
608
+ }
609
+ ],
610
+ "stateMutability": "view",
611
+ "type": "function"
612
+ },
613
+ {
614
+ "inputs": [
615
+ {
616
+ "internalType": "address",
617
+ "name": "sender",
618
+ "type": "address"
619
+ },
620
+ {
621
+ "components": [
622
+ {
623
+ "internalType": "Currency",
624
+ "name": "currency0",
625
+ "type": "address"
626
+ },
627
+ {
628
+ "internalType": "Currency",
629
+ "name": "currency1",
630
+ "type": "address"
631
+ },
632
+ {
633
+ "internalType": "uint24",
634
+ "name": "fee",
635
+ "type": "uint24"
636
+ },
637
+ {
638
+ "internalType": "int24",
639
+ "name": "tickSpacing",
640
+ "type": "int24"
641
+ },
642
+ {
643
+ "internalType": "contract IHooks",
644
+ "name": "hooks",
645
+ "type": "address"
646
+ }
647
+ ],
648
+ "internalType": "struct PoolKey",
649
+ "name": "key",
650
+ "type": "tuple"
651
+ },
652
+ {
653
+ "components": [
654
+ {
655
+ "internalType": "int24",
656
+ "name": "tickLower",
657
+ "type": "int24"
658
+ },
659
+ {
660
+ "internalType": "int24",
661
+ "name": "tickUpper",
662
+ "type": "int24"
663
+ },
664
+ {
665
+ "internalType": "int256",
666
+ "name": "liquidityDelta",
667
+ "type": "int256"
668
+ },
669
+ {
670
+ "internalType": "bytes32",
671
+ "name": "salt",
672
+ "type": "bytes32"
673
+ }
674
+ ],
675
+ "internalType": "struct ModifyLiquidityParams",
676
+ "name": "params",
677
+ "type": "tuple"
678
+ },
679
+ {
680
+ "internalType": "bytes",
681
+ "name": "hookData",
682
+ "type": "bytes"
683
+ }
684
+ ],
685
+ "name": "beforeAddLiquidity",
686
+ "outputs": [
687
+ {
688
+ "internalType": "bytes4",
689
+ "name": "",
690
+ "type": "bytes4"
691
+ }
692
+ ],
693
+ "stateMutability": "nonpayable",
694
+ "type": "function"
695
+ },
696
+ {
697
+ "inputs": [
698
+ {
699
+ "internalType": "address",
700
+ "name": "sender",
701
+ "type": "address"
702
+ },
703
+ {
704
+ "components": [
705
+ {
706
+ "internalType": "Currency",
707
+ "name": "currency0",
708
+ "type": "address"
709
+ },
710
+ {
711
+ "internalType": "Currency",
712
+ "name": "currency1",
713
+ "type": "address"
714
+ },
715
+ {
716
+ "internalType": "uint24",
717
+ "name": "fee",
718
+ "type": "uint24"
719
+ },
720
+ {
721
+ "internalType": "int24",
722
+ "name": "tickSpacing",
723
+ "type": "int24"
724
+ },
725
+ {
726
+ "internalType": "contract IHooks",
727
+ "name": "hooks",
728
+ "type": "address"
729
+ }
730
+ ],
731
+ "internalType": "struct PoolKey",
732
+ "name": "key",
733
+ "type": "tuple"
734
+ },
735
+ {
736
+ "internalType": "uint256",
737
+ "name": "amount0",
738
+ "type": "uint256"
739
+ },
740
+ {
741
+ "internalType": "uint256",
742
+ "name": "amount1",
743
+ "type": "uint256"
744
+ },
745
+ {
746
+ "internalType": "bytes",
747
+ "name": "hookData",
748
+ "type": "bytes"
749
+ }
750
+ ],
751
+ "name": "beforeDonate",
752
+ "outputs": [
753
+ {
754
+ "internalType": "bytes4",
755
+ "name": "",
756
+ "type": "bytes4"
757
+ }
758
+ ],
759
+ "stateMutability": "nonpayable",
760
+ "type": "function"
761
+ },
762
+ {
763
+ "inputs": [
764
+ {
765
+ "internalType": "address",
766
+ "name": "sender",
767
+ "type": "address"
768
+ },
769
+ {
770
+ "components": [
771
+ {
772
+ "internalType": "Currency",
773
+ "name": "currency0",
774
+ "type": "address"
775
+ },
776
+ {
777
+ "internalType": "Currency",
778
+ "name": "currency1",
779
+ "type": "address"
780
+ },
781
+ {
782
+ "internalType": "uint24",
783
+ "name": "fee",
784
+ "type": "uint24"
785
+ },
786
+ {
787
+ "internalType": "int24",
788
+ "name": "tickSpacing",
789
+ "type": "int24"
790
+ },
791
+ {
792
+ "internalType": "contract IHooks",
793
+ "name": "hooks",
794
+ "type": "address"
795
+ }
796
+ ],
797
+ "internalType": "struct PoolKey",
798
+ "name": "key",
799
+ "type": "tuple"
800
+ },
801
+ {
802
+ "internalType": "uint160",
803
+ "name": "sqrtPriceX96",
804
+ "type": "uint160"
805
+ }
806
+ ],
807
+ "name": "beforeInitialize",
808
+ "outputs": [
809
+ {
810
+ "internalType": "bytes4",
811
+ "name": "",
812
+ "type": "bytes4"
813
+ }
814
+ ],
815
+ "stateMutability": "nonpayable",
816
+ "type": "function"
817
+ },
818
+ {
819
+ "inputs": [
820
+ {
821
+ "internalType": "address",
822
+ "name": "sender",
823
+ "type": "address"
824
+ },
825
+ {
826
+ "components": [
827
+ {
828
+ "internalType": "Currency",
829
+ "name": "currency0",
830
+ "type": "address"
831
+ },
832
+ {
833
+ "internalType": "Currency",
834
+ "name": "currency1",
835
+ "type": "address"
836
+ },
837
+ {
838
+ "internalType": "uint24",
839
+ "name": "fee",
840
+ "type": "uint24"
841
+ },
842
+ {
843
+ "internalType": "int24",
844
+ "name": "tickSpacing",
845
+ "type": "int24"
846
+ },
847
+ {
848
+ "internalType": "contract IHooks",
849
+ "name": "hooks",
850
+ "type": "address"
851
+ }
852
+ ],
853
+ "internalType": "struct PoolKey",
854
+ "name": "key",
855
+ "type": "tuple"
856
+ },
857
+ {
858
+ "components": [
859
+ {
860
+ "internalType": "int24",
861
+ "name": "tickLower",
862
+ "type": "int24"
863
+ },
864
+ {
865
+ "internalType": "int24",
866
+ "name": "tickUpper",
867
+ "type": "int24"
868
+ },
869
+ {
870
+ "internalType": "int256",
871
+ "name": "liquidityDelta",
872
+ "type": "int256"
873
+ },
874
+ {
875
+ "internalType": "bytes32",
876
+ "name": "salt",
877
+ "type": "bytes32"
878
+ }
879
+ ],
880
+ "internalType": "struct ModifyLiquidityParams",
881
+ "name": "params",
882
+ "type": "tuple"
883
+ },
884
+ {
885
+ "internalType": "bytes",
886
+ "name": "hookData",
887
+ "type": "bytes"
888
+ }
889
+ ],
890
+ "name": "beforeRemoveLiquidity",
891
+ "outputs": [
892
+ {
893
+ "internalType": "bytes4",
894
+ "name": "",
895
+ "type": "bytes4"
896
+ }
897
+ ],
898
+ "stateMutability": "nonpayable",
899
+ "type": "function"
900
+ },
901
+ {
902
+ "inputs": [
903
+ {
904
+ "internalType": "address",
905
+ "name": "sender",
906
+ "type": "address"
907
+ },
908
+ {
909
+ "components": [
910
+ {
911
+ "internalType": "Currency",
912
+ "name": "currency0",
913
+ "type": "address"
914
+ },
915
+ {
916
+ "internalType": "Currency",
917
+ "name": "currency1",
918
+ "type": "address"
919
+ },
920
+ {
921
+ "internalType": "uint24",
922
+ "name": "fee",
923
+ "type": "uint24"
924
+ },
925
+ {
926
+ "internalType": "int24",
927
+ "name": "tickSpacing",
928
+ "type": "int24"
929
+ },
930
+ {
931
+ "internalType": "contract IHooks",
932
+ "name": "hooks",
933
+ "type": "address"
934
+ }
935
+ ],
936
+ "internalType": "struct PoolKey",
937
+ "name": "key",
938
+ "type": "tuple"
939
+ },
940
+ {
941
+ "components": [
942
+ {
943
+ "internalType": "bool",
944
+ "name": "zeroForOne",
945
+ "type": "bool"
946
+ },
947
+ {
948
+ "internalType": "int256",
949
+ "name": "amountSpecified",
950
+ "type": "int256"
951
+ },
952
+ {
953
+ "internalType": "uint160",
954
+ "name": "sqrtPriceLimitX96",
955
+ "type": "uint160"
956
+ }
957
+ ],
958
+ "internalType": "struct SwapParams",
959
+ "name": "params",
960
+ "type": "tuple"
961
+ },
962
+ {
963
+ "internalType": "bytes",
964
+ "name": "hookData",
965
+ "type": "bytes"
966
+ }
967
+ ],
968
+ "name": "beforeSwap",
969
+ "outputs": [
970
+ {
971
+ "internalType": "bytes4",
972
+ "name": "",
973
+ "type": "bytes4"
974
+ },
975
+ {
976
+ "internalType": "BeforeSwapDelta",
977
+ "name": "",
978
+ "type": "int256"
979
+ },
980
+ {
981
+ "internalType": "uint24",
982
+ "name": "",
983
+ "type": "uint24"
984
+ }
985
+ ],
986
+ "stateMutability": "nonpayable",
987
+ "type": "function"
988
+ },
989
+ {
990
+ "inputs": [],
991
+ "name": "blockedDirectionFee",
992
+ "outputs": [
993
+ {
994
+ "internalType": "uint24",
995
+ "name": "",
996
+ "type": "uint24"
997
+ }
998
+ ],
999
+ "stateMutability": "view",
1000
+ "type": "function"
1001
+ },
1002
+ {
1003
+ "inputs": [],
1004
+ "name": "getHookPermissions",
1005
+ "outputs": [
1006
+ {
1007
+ "components": [
1008
+ {
1009
+ "internalType": "bool",
1010
+ "name": "beforeInitialize",
1011
+ "type": "bool"
1012
+ },
1013
+ {
1014
+ "internalType": "bool",
1015
+ "name": "afterInitialize",
1016
+ "type": "bool"
1017
+ },
1018
+ {
1019
+ "internalType": "bool",
1020
+ "name": "beforeAddLiquidity",
1021
+ "type": "bool"
1022
+ },
1023
+ {
1024
+ "internalType": "bool",
1025
+ "name": "afterAddLiquidity",
1026
+ "type": "bool"
1027
+ },
1028
+ {
1029
+ "internalType": "bool",
1030
+ "name": "beforeRemoveLiquidity",
1031
+ "type": "bool"
1032
+ },
1033
+ {
1034
+ "internalType": "bool",
1035
+ "name": "afterRemoveLiquidity",
1036
+ "type": "bool"
1037
+ },
1038
+ {
1039
+ "internalType": "bool",
1040
+ "name": "beforeSwap",
1041
+ "type": "bool"
1042
+ },
1043
+ {
1044
+ "internalType": "bool",
1045
+ "name": "afterSwap",
1046
+ "type": "bool"
1047
+ },
1048
+ {
1049
+ "internalType": "bool",
1050
+ "name": "beforeDonate",
1051
+ "type": "bool"
1052
+ },
1053
+ {
1054
+ "internalType": "bool",
1055
+ "name": "afterDonate",
1056
+ "type": "bool"
1057
+ },
1058
+ {
1059
+ "internalType": "bool",
1060
+ "name": "beforeSwapReturnDelta",
1061
+ "type": "bool"
1062
+ },
1063
+ {
1064
+ "internalType": "bool",
1065
+ "name": "afterSwapReturnDelta",
1066
+ "type": "bool"
1067
+ },
1068
+ {
1069
+ "internalType": "bool",
1070
+ "name": "afterAddLiquidityReturnDelta",
1071
+ "type": "bool"
1072
+ },
1073
+ {
1074
+ "internalType": "bool",
1075
+ "name": "afterRemoveLiquidityReturnDelta",
1076
+ "type": "bool"
1077
+ }
1078
+ ],
1079
+ "internalType": "struct Hooks.Permissions",
1080
+ "name": "",
1081
+ "type": "tuple"
1082
+ }
1083
+ ],
1084
+ "stateMutability": "pure",
1085
+ "type": "function"
1086
+ },
1087
+ {
1088
+ "inputs": [],
1089
+ "name": "owner",
1090
+ "outputs": [
1091
+ {
1092
+ "internalType": "address",
1093
+ "name": "",
1094
+ "type": "address"
1095
+ }
1096
+ ],
1097
+ "stateMutability": "view",
1098
+ "type": "function"
1099
+ },
1100
+ {
1101
+ "inputs": [],
1102
+ "name": "poolManager",
1103
+ "outputs": [
1104
+ {
1105
+ "internalType": "contract IPoolManager",
1106
+ "name": "",
1107
+ "type": "address"
1108
+ }
1109
+ ],
1110
+ "stateMutability": "view",
1111
+ "type": "function"
1112
+ },
1113
+ {
1114
+ "inputs": [
1115
+ {
1116
+ "internalType": "uint24",
1117
+ "name": "newFee",
1118
+ "type": "uint24"
1119
+ }
1120
+ ],
1121
+ "name": "setAllowedFee",
1122
+ "outputs": [],
1123
+ "stateMutability": "nonpayable",
1124
+ "type": "function"
1125
+ },
1126
+ {
1127
+ "inputs": [
1128
+ {
1129
+ "internalType": "uint24",
1130
+ "name": "newFee",
1131
+ "type": "uint24"
1132
+ }
1133
+ ],
1134
+ "name": "setBlockedFee",
1135
+ "outputs": [],
1136
+ "stateMutability": "nonpayable",
1137
+ "type": "function"
1138
+ },
1139
+ {
1140
+ "inputs": [
1141
+ {
1142
+ "internalType": "address",
1143
+ "name": "newOwner",
1144
+ "type": "address"
1145
+ }
1146
+ ],
1147
+ "name": "transferOwnership",
1148
+ "outputs": [],
1149
+ "stateMutability": "nonpayable",
1150
+ "type": "function"
1151
+ }
1152
+ ];
1153
+ /**
1154
+ * OneWayBidHook_json Contract Class
1155
+ *
1156
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
1157
+ *
1158
+ * @example
1159
+ * ```typescript
1160
+ * import { createPublicClient, createWalletClient, http } from 'viem';
1161
+ * import { mainnet } from 'viem/chains';
1162
+ * import { OneWayBidHook_json } from 'OneWayBidHook_json';
1163
+ *
1164
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
1165
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
1166
+ *
1167
+ * const contract = new OneWayBidHook_json('0x...', { publicClient, walletClient });
1168
+ *
1169
+ * // Read functions
1170
+ * const result = await contract.balanceOf('0x...');
1171
+ *
1172
+ * // Write functions
1173
+ * const hash = await contract.transfer('0x...', 1000n);
1174
+ *
1175
+ * // Simulate transactions (dry-run)
1176
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
1177
+ * console.log('Gas estimate:', simulation.request.gas);
1178
+ *
1179
+ * // Watch events
1180
+ * const unwatch = contract.watch.Transfer((event) => {
1181
+ * console.log('Transfer event:', event);
1182
+ * });
1183
+ * ```
1184
+ */
1185
+ class OneWayBidHook_json {
1186
+ constructor(address, clients) {
1187
+ this.contractAddress = address;
1188
+ this.publicClient = clients.publicClient;
1189
+ this.contract = (0, viem_1.getContract)({
1190
+ address,
1191
+ abi: exports.OneWayBidHook_jsonAbi,
1192
+ client: {
1193
+ public: clients.publicClient,
1194
+ wallet: clients.walletClient,
1195
+ },
1196
+ });
1197
+ }
1198
+ /**
1199
+ * Get the contract address
1200
+ */
1201
+ get address() {
1202
+ return this.contractAddress;
1203
+ }
1204
+ /**
1205
+ * Get the underlying viem contract instance
1206
+ */
1207
+ getContract() {
1208
+ return this.contract;
1209
+ }
1210
+ /**
1211
+ * MAX_ALLOWED_FEE
1212
+ * view
1213
+ */
1214
+ async MAX_ALLOWED_FEE() {
1215
+ return this.contract.read.MAX_ALLOWED_FEE();
1216
+ }
1217
+ /**
1218
+ * MAX_BLOCKED_FEE
1219
+ * view
1220
+ */
1221
+ async MAX_BLOCKED_FEE() {
1222
+ return this.contract.read.MAX_BLOCKED_FEE();
1223
+ }
1224
+ /**
1225
+ * MIN_ALLOWED_FEE
1226
+ * view
1227
+ */
1228
+ async MIN_ALLOWED_FEE() {
1229
+ return this.contract.read.MIN_ALLOWED_FEE();
1230
+ }
1231
+ /**
1232
+ * MIN_BLOCKED_FEE
1233
+ * view
1234
+ */
1235
+ async MIN_BLOCKED_FEE() {
1236
+ return this.contract.read.MIN_BLOCKED_FEE();
1237
+ }
1238
+ /**
1239
+ * accumulatedToken
1240
+ * view
1241
+ */
1242
+ async accumulatedToken() {
1243
+ return this.contract.read.accumulatedToken();
1244
+ }
1245
+ /**
1246
+ * allowedDirectionFee
1247
+ * view
1248
+ */
1249
+ async allowedDirectionFee() {
1250
+ return this.contract.read.allowedDirectionFee();
1251
+ }
1252
+ /**
1253
+ * blockedDirectionFee
1254
+ * view
1255
+ */
1256
+ async blockedDirectionFee() {
1257
+ return this.contract.read.blockedDirectionFee();
1258
+ }
1259
+ /**
1260
+ * getHookPermissions
1261
+ * pure
1262
+ */
1263
+ async getHookPermissions() {
1264
+ return this.contract.read.getHookPermissions();
1265
+ }
1266
+ /**
1267
+ * owner
1268
+ * view
1269
+ */
1270
+ async owner() {
1271
+ return this.contract.read.owner();
1272
+ }
1273
+ /**
1274
+ * poolManager
1275
+ * view
1276
+ */
1277
+ async poolManager() {
1278
+ return this.contract.read.poolManager();
1279
+ }
1280
+ /**
1281
+ * afterAddLiquidity
1282
+ * nonpayable
1283
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1284
+ */
1285
+ async afterAddLiquidity(sender, key, params, delta, feesAccrued, hookData, options) {
1286
+ if (!this.contract.write) {
1287
+ throw new Error('Wallet client is required for write operations');
1288
+ }
1289
+ return this.contract.write.afterAddLiquidity([sender, key, params, delta, feesAccrued, hookData], options);
1290
+ }
1291
+ /**
1292
+ * afterDonate
1293
+ * nonpayable
1294
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1295
+ */
1296
+ async afterDonate(sender, key, amount0, amount1, hookData, options) {
1297
+ if (!this.contract.write) {
1298
+ throw new Error('Wallet client is required for write operations');
1299
+ }
1300
+ return this.contract.write.afterDonate([sender, key, amount0, amount1, hookData], options);
1301
+ }
1302
+ /**
1303
+ * afterInitialize
1304
+ * nonpayable
1305
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1306
+ */
1307
+ async afterInitialize(sender, key, sqrtPriceX96, tick, options) {
1308
+ if (!this.contract.write) {
1309
+ throw new Error('Wallet client is required for write operations');
1310
+ }
1311
+ return this.contract.write.afterInitialize([sender, key, sqrtPriceX96, tick], options);
1312
+ }
1313
+ /**
1314
+ * afterRemoveLiquidity
1315
+ * nonpayable
1316
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1317
+ */
1318
+ async afterRemoveLiquidity(sender, key, params, delta, feesAccrued, hookData, options) {
1319
+ if (!this.contract.write) {
1320
+ throw new Error('Wallet client is required for write operations');
1321
+ }
1322
+ return this.contract.write.afterRemoveLiquidity([sender, key, params, delta, feesAccrued, hookData], options);
1323
+ }
1324
+ /**
1325
+ * afterSwap
1326
+ * nonpayable
1327
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1328
+ */
1329
+ async afterSwap(sender, key, params, delta, hookData, options) {
1330
+ if (!this.contract.write) {
1331
+ throw new Error('Wallet client is required for write operations');
1332
+ }
1333
+ return this.contract.write.afterSwap([sender, key, params, delta, hookData], options);
1334
+ }
1335
+ /**
1336
+ * beforeAddLiquidity
1337
+ * nonpayable
1338
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1339
+ */
1340
+ async beforeAddLiquidity(sender, key, params, hookData, options) {
1341
+ if (!this.contract.write) {
1342
+ throw new Error('Wallet client is required for write operations');
1343
+ }
1344
+ return this.contract.write.beforeAddLiquidity([sender, key, params, hookData], options);
1345
+ }
1346
+ /**
1347
+ * beforeDonate
1348
+ * nonpayable
1349
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1350
+ */
1351
+ async beforeDonate(sender, key, amount0, amount1, hookData, options) {
1352
+ if (!this.contract.write) {
1353
+ throw new Error('Wallet client is required for write operations');
1354
+ }
1355
+ return this.contract.write.beforeDonate([sender, key, amount0, amount1, hookData], options);
1356
+ }
1357
+ /**
1358
+ * beforeInitialize
1359
+ * nonpayable
1360
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1361
+ */
1362
+ async beforeInitialize(sender, key, sqrtPriceX96, options) {
1363
+ if (!this.contract.write) {
1364
+ throw new Error('Wallet client is required for write operations');
1365
+ }
1366
+ return this.contract.write.beforeInitialize([sender, key, sqrtPriceX96], options);
1367
+ }
1368
+ /**
1369
+ * beforeRemoveLiquidity
1370
+ * nonpayable
1371
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1372
+ */
1373
+ async beforeRemoveLiquidity(sender, key, params, hookData, options) {
1374
+ if (!this.contract.write) {
1375
+ throw new Error('Wallet client is required for write operations');
1376
+ }
1377
+ return this.contract.write.beforeRemoveLiquidity([sender, key, params, hookData], options);
1378
+ }
1379
+ /**
1380
+ * beforeSwap
1381
+ * nonpayable
1382
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1383
+ */
1384
+ async beforeSwap(sender, key, params, hookData, options) {
1385
+ if (!this.contract.write) {
1386
+ throw new Error('Wallet client is required for write operations');
1387
+ }
1388
+ return this.contract.write.beforeSwap([sender, key, params, hookData], options);
1389
+ }
1390
+ /**
1391
+ * setAllowedFee
1392
+ * nonpayable
1393
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1394
+ */
1395
+ async setAllowedFee(newFee, options) {
1396
+ if (!this.contract.write) {
1397
+ throw new Error('Wallet client is required for write operations');
1398
+ }
1399
+ return this.contract.write.setAllowedFee([newFee], options);
1400
+ }
1401
+ /**
1402
+ * setBlockedFee
1403
+ * nonpayable
1404
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1405
+ */
1406
+ async setBlockedFee(newFee, options) {
1407
+ if (!this.contract.write) {
1408
+ throw new Error('Wallet client is required for write operations');
1409
+ }
1410
+ return this.contract.write.setBlockedFee([newFee], options);
1411
+ }
1412
+ /**
1413
+ * transferOwnership
1414
+ * nonpayable
1415
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1416
+ */
1417
+ async transferOwnership(newOwner, options) {
1418
+ if (!this.contract.write) {
1419
+ throw new Error('Wallet client is required for write operations');
1420
+ }
1421
+ return this.contract.write.transferOwnership([newOwner], options);
1422
+ }
1423
+ /**
1424
+ * Simulate contract write operations (dry-run without sending transaction)
1425
+ *
1426
+ * @example
1427
+ * const result = await contract.simulate.transfer('0x...', 1000n);
1428
+ * console.log('Gas estimate:', result.request.gas);
1429
+ * console.log('Would succeed:', result.result);
1430
+ */
1431
+ get simulate() {
1432
+ const contract = this.contract;
1433
+ if (!contract.simulate) {
1434
+ throw new Error('Public client is required for simulation');
1435
+ }
1436
+ return {
1437
+ /**
1438
+ * Simulate afterAddLiquidity
1439
+ * Returns gas estimate and result without sending transaction
1440
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1441
+ */
1442
+ async afterAddLiquidity(sender, key, params, delta, feesAccrued, hookData, options) {
1443
+ return contract.simulate.afterAddLiquidity([sender, key, params, delta, feesAccrued, hookData], options);
1444
+ },
1445
+ /**
1446
+ * Simulate afterDonate
1447
+ * Returns gas estimate and result without sending transaction
1448
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1449
+ */
1450
+ async afterDonate(sender, key, amount0, amount1, hookData, options) {
1451
+ return contract.simulate.afterDonate([sender, key, amount0, amount1, hookData], options);
1452
+ },
1453
+ /**
1454
+ * Simulate afterInitialize
1455
+ * Returns gas estimate and result without sending transaction
1456
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1457
+ */
1458
+ async afterInitialize(sender, key, sqrtPriceX96, tick, options) {
1459
+ return contract.simulate.afterInitialize([sender, key, sqrtPriceX96, tick], options);
1460
+ },
1461
+ /**
1462
+ * Simulate afterRemoveLiquidity
1463
+ * Returns gas estimate and result without sending transaction
1464
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1465
+ */
1466
+ async afterRemoveLiquidity(sender, key, params, delta, feesAccrued, hookData, options) {
1467
+ return contract.simulate.afterRemoveLiquidity([sender, key, params, delta, feesAccrued, hookData], options);
1468
+ },
1469
+ /**
1470
+ * Simulate afterSwap
1471
+ * Returns gas estimate and result without sending transaction
1472
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1473
+ */
1474
+ async afterSwap(sender, key, params, delta, hookData, options) {
1475
+ return contract.simulate.afterSwap([sender, key, params, delta, hookData], options);
1476
+ },
1477
+ /**
1478
+ * Simulate beforeAddLiquidity
1479
+ * Returns gas estimate and result without sending transaction
1480
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1481
+ */
1482
+ async beforeAddLiquidity(sender, key, params, hookData, options) {
1483
+ return contract.simulate.beforeAddLiquidity([sender, key, params, hookData], options);
1484
+ },
1485
+ /**
1486
+ * Simulate beforeDonate
1487
+ * Returns gas estimate and result without sending transaction
1488
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1489
+ */
1490
+ async beforeDonate(sender, key, amount0, amount1, hookData, options) {
1491
+ return contract.simulate.beforeDonate([sender, key, amount0, amount1, hookData], options);
1492
+ },
1493
+ /**
1494
+ * Simulate beforeInitialize
1495
+ * Returns gas estimate and result without sending transaction
1496
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1497
+ */
1498
+ async beforeInitialize(sender, key, sqrtPriceX96, options) {
1499
+ return contract.simulate.beforeInitialize([sender, key, sqrtPriceX96], options);
1500
+ },
1501
+ /**
1502
+ * Simulate beforeRemoveLiquidity
1503
+ * Returns gas estimate and result without sending transaction
1504
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1505
+ */
1506
+ async beforeRemoveLiquidity(sender, key, params, hookData, options) {
1507
+ return contract.simulate.beforeRemoveLiquidity([sender, key, params, hookData], options);
1508
+ },
1509
+ /**
1510
+ * Simulate beforeSwap
1511
+ * Returns gas estimate and result without sending transaction
1512
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1513
+ */
1514
+ async beforeSwap(sender, key, params, hookData, options) {
1515
+ return contract.simulate.beforeSwap([sender, key, params, hookData], options);
1516
+ },
1517
+ /**
1518
+ * Simulate setAllowedFee
1519
+ * Returns gas estimate and result without sending transaction
1520
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1521
+ */
1522
+ async setAllowedFee(newFee, options) {
1523
+ return contract.simulate.setAllowedFee([newFee], options);
1524
+ },
1525
+ /**
1526
+ * Simulate setBlockedFee
1527
+ * Returns gas estimate and result without sending transaction
1528
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1529
+ */
1530
+ async setBlockedFee(newFee, options) {
1531
+ return contract.simulate.setBlockedFee([newFee], options);
1532
+ },
1533
+ /**
1534
+ * Simulate transferOwnership
1535
+ * Returns gas estimate and result without sending transaction
1536
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
1537
+ */
1538
+ async transferOwnership(newOwner, options) {
1539
+ return contract.simulate.transferOwnership([newOwner], options);
1540
+ }
1541
+ };
1542
+ }
1543
+ /**
1544
+ * Watch contract events
1545
+ *
1546
+ * @example
1547
+ * // Watch all Transfer events
1548
+ * const unwatch = contract.watch.Transfer((event) => {
1549
+ * console.log('Transfer:', event);
1550
+ * });
1551
+ *
1552
+ * // Stop watching
1553
+ * unwatch();
1554
+ */
1555
+ get watch() {
1556
+ return {
1557
+ /**
1558
+ * Watch AllowedFeeUpdated events
1559
+ * @param callback Function to call when event is emitted
1560
+ * @param filter Optional filter for indexed parameters
1561
+ * @returns Unwatch function to stop listening
1562
+ */
1563
+ AllowedFeeUpdated: (callback) => {
1564
+ return this.publicClient.watchContractEvent({
1565
+ address: this.contractAddress,
1566
+ abi: exports.OneWayBidHook_jsonAbi,
1567
+ eventName: 'AllowedFeeUpdated',
1568
+ onLogs: (logs) => {
1569
+ logs.forEach((log) => {
1570
+ callback(log.args);
1571
+ });
1572
+ },
1573
+ });
1574
+ },
1575
+ /**
1576
+ * Watch BlockedFeeUpdated events
1577
+ * @param callback Function to call when event is emitted
1578
+ * @param filter Optional filter for indexed parameters
1579
+ * @returns Unwatch function to stop listening
1580
+ */
1581
+ BlockedFeeUpdated: (callback) => {
1582
+ return this.publicClient.watchContractEvent({
1583
+ address: this.contractAddress,
1584
+ abi: exports.OneWayBidHook_jsonAbi,
1585
+ eventName: 'BlockedFeeUpdated',
1586
+ onLogs: (logs) => {
1587
+ logs.forEach((log) => {
1588
+ callback(log.args);
1589
+ });
1590
+ },
1591
+ });
1592
+ },
1593
+ /**
1594
+ * Watch OwnerTransferred events
1595
+ * @param callback Function to call when event is emitted
1596
+ * @param filter Optional filter for indexed parameters
1597
+ * @returns Unwatch function to stop listening
1598
+ */
1599
+ OwnerTransferred: (callback, filter) => {
1600
+ return this.publicClient.watchContractEvent({
1601
+ address: this.contractAddress,
1602
+ abi: exports.OneWayBidHook_jsonAbi,
1603
+ eventName: 'OwnerTransferred',
1604
+ args: filter,
1605
+ onLogs: (logs) => {
1606
+ logs.forEach((log) => {
1607
+ callback(log.args);
1608
+ });
1609
+ },
1610
+ });
1611
+ }
1612
+ };
1613
+ }
1614
+ }
1615
+ exports.OneWayBidHook_json = OneWayBidHook_json;