timelock-sdk 0.0.16 → 0.0.17

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.
@@ -1,4907 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
22
-
23
- //#endregion
24
- let viem = require("viem");
25
- viem = __toESM(viem);
26
- let viem_chains = require("viem/chains");
27
- viem_chains = __toESM(viem_chains);
28
- let __uniswap_v3_sdk = require("@uniswap/v3-sdk");
29
- __uniswap_v3_sdk = __toESM(__uniswap_v3_sdk);
30
- let big_js = require("big.js");
31
- big_js = __toESM(big_js);
32
- let jsbi = require("jsbi");
33
- jsbi = __toESM(jsbi);
34
-
35
- //#region src/abis/erc20.ts
36
- const erc20Abi = [
37
- {
38
- type: "constructor",
39
- inputs: [{
40
- name: "name_",
41
- type: "string",
42
- internalType: "string"
43
- }, {
44
- name: "symbol_",
45
- type: "string",
46
- internalType: "string"
47
- }],
48
- stateMutability: "nonpayable"
49
- },
50
- {
51
- type: "function",
52
- name: "allowance",
53
- inputs: [{
54
- name: "owner",
55
- type: "address",
56
- internalType: "address"
57
- }, {
58
- name: "spender",
59
- type: "address",
60
- internalType: "address"
61
- }],
62
- outputs: [{
63
- name: "",
64
- type: "uint256",
65
- internalType: "uint256"
66
- }],
67
- stateMutability: "view"
68
- },
69
- {
70
- type: "function",
71
- name: "approve",
72
- inputs: [{
73
- name: "spender",
74
- type: "address",
75
- internalType: "address"
76
- }, {
77
- name: "amount",
78
- type: "uint256",
79
- internalType: "uint256"
80
- }],
81
- outputs: [{
82
- name: "",
83
- type: "bool",
84
- internalType: "bool"
85
- }],
86
- stateMutability: "nonpayable"
87
- },
88
- {
89
- type: "function",
90
- name: "balanceOf",
91
- inputs: [{
92
- name: "account",
93
- type: "address",
94
- internalType: "address"
95
- }],
96
- outputs: [{
97
- name: "",
98
- type: "uint256",
99
- internalType: "uint256"
100
- }],
101
- stateMutability: "view"
102
- },
103
- {
104
- type: "function",
105
- name: "decimals",
106
- inputs: [],
107
- outputs: [{
108
- name: "",
109
- type: "uint8",
110
- internalType: "uint8"
111
- }],
112
- stateMutability: "view"
113
- },
114
- {
115
- type: "function",
116
- name: "decreaseAllowance",
117
- inputs: [{
118
- name: "spender",
119
- type: "address",
120
- internalType: "address"
121
- }, {
122
- name: "subtractedValue",
123
- type: "uint256",
124
- internalType: "uint256"
125
- }],
126
- outputs: [{
127
- name: "",
128
- type: "bool",
129
- internalType: "bool"
130
- }],
131
- stateMutability: "nonpayable"
132
- },
133
- {
134
- type: "function",
135
- name: "increaseAllowance",
136
- inputs: [{
137
- name: "spender",
138
- type: "address",
139
- internalType: "address"
140
- }, {
141
- name: "addedValue",
142
- type: "uint256",
143
- internalType: "uint256"
144
- }],
145
- outputs: [{
146
- name: "",
147
- type: "bool",
148
- internalType: "bool"
149
- }],
150
- stateMutability: "nonpayable"
151
- },
152
- {
153
- type: "function",
154
- name: "name",
155
- inputs: [],
156
- outputs: [{
157
- name: "",
158
- type: "string",
159
- internalType: "string"
160
- }],
161
- stateMutability: "view"
162
- },
163
- {
164
- type: "function",
165
- name: "symbol",
166
- inputs: [],
167
- outputs: [{
168
- name: "",
169
- type: "string",
170
- internalType: "string"
171
- }],
172
- stateMutability: "view"
173
- },
174
- {
175
- type: "function",
176
- name: "totalSupply",
177
- inputs: [],
178
- outputs: [{
179
- name: "",
180
- type: "uint256",
181
- internalType: "uint256"
182
- }],
183
- stateMutability: "view"
184
- },
185
- {
186
- type: "function",
187
- name: "transfer",
188
- inputs: [{
189
- name: "to",
190
- type: "address",
191
- internalType: "address"
192
- }, {
193
- name: "amount",
194
- type: "uint256",
195
- internalType: "uint256"
196
- }],
197
- outputs: [{
198
- name: "",
199
- type: "bool",
200
- internalType: "bool"
201
- }],
202
- stateMutability: "nonpayable"
203
- },
204
- {
205
- type: "function",
206
- name: "transferFrom",
207
- inputs: [
208
- {
209
- name: "from",
210
- type: "address",
211
- internalType: "address"
212
- },
213
- {
214
- name: "to",
215
- type: "address",
216
- internalType: "address"
217
- },
218
- {
219
- name: "amount",
220
- type: "uint256",
221
- internalType: "uint256"
222
- }
223
- ],
224
- outputs: [{
225
- name: "",
226
- type: "bool",
227
- internalType: "bool"
228
- }],
229
- stateMutability: "nonpayable"
230
- },
231
- {
232
- type: "event",
233
- name: "Approval",
234
- inputs: [
235
- {
236
- name: "owner",
237
- type: "address",
238
- indexed: true,
239
- internalType: "address"
240
- },
241
- {
242
- name: "spender",
243
- type: "address",
244
- indexed: true,
245
- internalType: "address"
246
- },
247
- {
248
- name: "value",
249
- type: "uint256",
250
- indexed: false,
251
- internalType: "uint256"
252
- }
253
- ],
254
- anonymous: false
255
- },
256
- {
257
- type: "event",
258
- name: "Transfer",
259
- inputs: [
260
- {
261
- name: "from",
262
- type: "address",
263
- indexed: true,
264
- internalType: "address"
265
- },
266
- {
267
- name: "to",
268
- type: "address",
269
- indexed: true,
270
- internalType: "address"
271
- },
272
- {
273
- name: "value",
274
- type: "uint256",
275
- indexed: false,
276
- internalType: "uint256"
277
- }
278
- ],
279
- anonymous: false
280
- }
281
- ];
282
-
283
- //#endregion
284
- //#region src/abis/uniswapV3Pool.ts
285
- const uniswapV3PoolAbi = [
286
- {
287
- type: "function",
288
- name: "burn",
289
- inputs: [
290
- {
291
- name: "tickLower",
292
- type: "int24",
293
- internalType: "int24"
294
- },
295
- {
296
- name: "tickUpper",
297
- type: "int24",
298
- internalType: "int24"
299
- },
300
- {
301
- name: "amount",
302
- type: "uint128",
303
- internalType: "uint128"
304
- }
305
- ],
306
- outputs: [{
307
- name: "amount0",
308
- type: "uint256",
309
- internalType: "uint256"
310
- }, {
311
- name: "amount1",
312
- type: "uint256",
313
- internalType: "uint256"
314
- }],
315
- stateMutability: "nonpayable"
316
- },
317
- {
318
- type: "function",
319
- name: "collect",
320
- inputs: [
321
- {
322
- name: "recipient",
323
- type: "address",
324
- internalType: "address"
325
- },
326
- {
327
- name: "tickLower",
328
- type: "int24",
329
- internalType: "int24"
330
- },
331
- {
332
- name: "tickUpper",
333
- type: "int24",
334
- internalType: "int24"
335
- },
336
- {
337
- name: "amount0Requested",
338
- type: "uint128",
339
- internalType: "uint128"
340
- },
341
- {
342
- name: "amount1Requested",
343
- type: "uint128",
344
- internalType: "uint128"
345
- }
346
- ],
347
- outputs: [{
348
- name: "amount0",
349
- type: "uint128",
350
- internalType: "uint128"
351
- }, {
352
- name: "amount1",
353
- type: "uint128",
354
- internalType: "uint128"
355
- }],
356
- stateMutability: "nonpayable"
357
- },
358
- {
359
- type: "function",
360
- name: "collectProtocol",
361
- inputs: [
362
- {
363
- name: "recipient",
364
- type: "address",
365
- internalType: "address"
366
- },
367
- {
368
- name: "amount0Requested",
369
- type: "uint128",
370
- internalType: "uint128"
371
- },
372
- {
373
- name: "amount1Requested",
374
- type: "uint128",
375
- internalType: "uint128"
376
- }
377
- ],
378
- outputs: [{
379
- name: "amount0",
380
- type: "uint128",
381
- internalType: "uint128"
382
- }, {
383
- name: "amount1",
384
- type: "uint128",
385
- internalType: "uint128"
386
- }],
387
- stateMutability: "nonpayable"
388
- },
389
- {
390
- type: "function",
391
- name: "factory",
392
- inputs: [],
393
- outputs: [{
394
- name: "",
395
- type: "address",
396
- internalType: "address"
397
- }],
398
- stateMutability: "view"
399
- },
400
- {
401
- type: "function",
402
- name: "fee",
403
- inputs: [],
404
- outputs: [{
405
- name: "",
406
- type: "uint24",
407
- internalType: "uint24"
408
- }],
409
- stateMutability: "view"
410
- },
411
- {
412
- type: "function",
413
- name: "feeGrowthGlobal0X128",
414
- inputs: [],
415
- outputs: [{
416
- name: "",
417
- type: "uint256",
418
- internalType: "uint256"
419
- }],
420
- stateMutability: "view"
421
- },
422
- {
423
- type: "function",
424
- name: "feeGrowthGlobal1X128",
425
- inputs: [],
426
- outputs: [{
427
- name: "",
428
- type: "uint256",
429
- internalType: "uint256"
430
- }],
431
- stateMutability: "view"
432
- },
433
- {
434
- type: "function",
435
- name: "flash",
436
- inputs: [
437
- {
438
- name: "recipient",
439
- type: "address",
440
- internalType: "address"
441
- },
442
- {
443
- name: "amount0",
444
- type: "uint256",
445
- internalType: "uint256"
446
- },
447
- {
448
- name: "amount1",
449
- type: "uint256",
450
- internalType: "uint256"
451
- },
452
- {
453
- name: "data",
454
- type: "bytes",
455
- internalType: "bytes"
456
- }
457
- ],
458
- outputs: [],
459
- stateMutability: "nonpayable"
460
- },
461
- {
462
- type: "function",
463
- name: "increaseObservationCardinalityNext",
464
- inputs: [{
465
- name: "observationCardinalityNext",
466
- type: "uint16",
467
- internalType: "uint16"
468
- }],
469
- outputs: [],
470
- stateMutability: "nonpayable"
471
- },
472
- {
473
- type: "function",
474
- name: "initialize",
475
- inputs: [{
476
- name: "sqrtPriceX96",
477
- type: "uint160",
478
- internalType: "uint160"
479
- }],
480
- outputs: [],
481
- stateMutability: "nonpayable"
482
- },
483
- {
484
- type: "function",
485
- name: "liquidity",
486
- inputs: [],
487
- outputs: [{
488
- name: "",
489
- type: "uint128",
490
- internalType: "uint128"
491
- }],
492
- stateMutability: "view"
493
- },
494
- {
495
- type: "function",
496
- name: "maxLiquidityPerTick",
497
- inputs: [],
498
- outputs: [{
499
- name: "",
500
- type: "uint128",
501
- internalType: "uint128"
502
- }],
503
- stateMutability: "view"
504
- },
505
- {
506
- type: "function",
507
- name: "mint",
508
- inputs: [
509
- {
510
- name: "recipient",
511
- type: "address",
512
- internalType: "address"
513
- },
514
- {
515
- name: "tickLower",
516
- type: "int24",
517
- internalType: "int24"
518
- },
519
- {
520
- name: "tickUpper",
521
- type: "int24",
522
- internalType: "int24"
523
- },
524
- {
525
- name: "amount",
526
- type: "uint128",
527
- internalType: "uint128"
528
- },
529
- {
530
- name: "data",
531
- type: "bytes",
532
- internalType: "bytes"
533
- }
534
- ],
535
- outputs: [{
536
- name: "amount0",
537
- type: "uint256",
538
- internalType: "uint256"
539
- }, {
540
- name: "amount1",
541
- type: "uint256",
542
- internalType: "uint256"
543
- }],
544
- stateMutability: "nonpayable"
545
- },
546
- {
547
- type: "function",
548
- name: "observations",
549
- inputs: [{
550
- name: "index",
551
- type: "uint256",
552
- internalType: "uint256"
553
- }],
554
- outputs: [
555
- {
556
- name: "blockTimestamp",
557
- type: "uint32",
558
- internalType: "uint32"
559
- },
560
- {
561
- name: "tickCumulative",
562
- type: "int56",
563
- internalType: "int56"
564
- },
565
- {
566
- name: "secondsPerLiquidityCumulativeX128",
567
- type: "uint160",
568
- internalType: "uint160"
569
- },
570
- {
571
- name: "initialized",
572
- type: "bool",
573
- internalType: "bool"
574
- }
575
- ],
576
- stateMutability: "view"
577
- },
578
- {
579
- type: "function",
580
- name: "observe",
581
- inputs: [{
582
- name: "secondsAgos",
583
- type: "uint32[]",
584
- internalType: "uint32[]"
585
- }],
586
- outputs: [{
587
- name: "tickCumulatives",
588
- type: "int56[]",
589
- internalType: "int56[]"
590
- }, {
591
- name: "secondsPerLiquidityCumulativeX128s",
592
- type: "uint160[]",
593
- internalType: "uint160[]"
594
- }],
595
- stateMutability: "view"
596
- },
597
- {
598
- type: "function",
599
- name: "positions",
600
- inputs: [{
601
- name: "key",
602
- type: "bytes32",
603
- internalType: "bytes32"
604
- }],
605
- outputs: [
606
- {
607
- name: "liquidity",
608
- type: "uint128",
609
- internalType: "uint128"
610
- },
611
- {
612
- name: "feeGrowthInside0LastX128",
613
- type: "uint256",
614
- internalType: "uint256"
615
- },
616
- {
617
- name: "feeGrowthInside1LastX128",
618
- type: "uint256",
619
- internalType: "uint256"
620
- },
621
- {
622
- name: "tokensOwed0",
623
- type: "uint128",
624
- internalType: "uint128"
625
- },
626
- {
627
- name: "tokensOwed1",
628
- type: "uint128",
629
- internalType: "uint128"
630
- }
631
- ],
632
- stateMutability: "view"
633
- },
634
- {
635
- type: "function",
636
- name: "protocolFees",
637
- inputs: [],
638
- outputs: [{
639
- name: "token0",
640
- type: "uint128",
641
- internalType: "uint128"
642
- }, {
643
- name: "token1",
644
- type: "uint128",
645
- internalType: "uint128"
646
- }],
647
- stateMutability: "view"
648
- },
649
- {
650
- type: "function",
651
- name: "setFeeProtocol",
652
- inputs: [{
653
- name: "feeProtocol0",
654
- type: "uint8",
655
- internalType: "uint8"
656
- }, {
657
- name: "feeProtocol1",
658
- type: "uint8",
659
- internalType: "uint8"
660
- }],
661
- outputs: [],
662
- stateMutability: "nonpayable"
663
- },
664
- {
665
- type: "function",
666
- name: "slot0",
667
- inputs: [],
668
- outputs: [
669
- {
670
- name: "sqrtPriceX96",
671
- type: "uint160",
672
- internalType: "uint160"
673
- },
674
- {
675
- name: "tick",
676
- type: "int24",
677
- internalType: "int24"
678
- },
679
- {
680
- name: "observationIndex",
681
- type: "uint16",
682
- internalType: "uint16"
683
- },
684
- {
685
- name: "observationCardinality",
686
- type: "uint16",
687
- internalType: "uint16"
688
- },
689
- {
690
- name: "observationCardinalityNext",
691
- type: "uint16",
692
- internalType: "uint16"
693
- },
694
- {
695
- name: "feeProtocol",
696
- type: "uint8",
697
- internalType: "uint8"
698
- },
699
- {
700
- name: "unlocked",
701
- type: "bool",
702
- internalType: "bool"
703
- }
704
- ],
705
- stateMutability: "view"
706
- },
707
- {
708
- type: "function",
709
- name: "snapshotCumulativesInside",
710
- inputs: [{
711
- name: "tickLower",
712
- type: "int24",
713
- internalType: "int24"
714
- }, {
715
- name: "tickUpper",
716
- type: "int24",
717
- internalType: "int24"
718
- }],
719
- outputs: [
720
- {
721
- name: "tickCumulativeInside",
722
- type: "int56",
723
- internalType: "int56"
724
- },
725
- {
726
- name: "secondsPerLiquidityInsideX128",
727
- type: "uint160",
728
- internalType: "uint160"
729
- },
730
- {
731
- name: "secondsInside",
732
- type: "uint32",
733
- internalType: "uint32"
734
- }
735
- ],
736
- stateMutability: "view"
737
- },
738
- {
739
- type: "function",
740
- name: "swap",
741
- inputs: [
742
- {
743
- name: "recipient",
744
- type: "address",
745
- internalType: "address"
746
- },
747
- {
748
- name: "zeroForOne",
749
- type: "bool",
750
- internalType: "bool"
751
- },
752
- {
753
- name: "amountSpecified",
754
- type: "int256",
755
- internalType: "int256"
756
- },
757
- {
758
- name: "sqrtPriceLimitX96",
759
- type: "uint160",
760
- internalType: "uint160"
761
- },
762
- {
763
- name: "data",
764
- type: "bytes",
765
- internalType: "bytes"
766
- }
767
- ],
768
- outputs: [{
769
- name: "amount0",
770
- type: "int256",
771
- internalType: "int256"
772
- }, {
773
- name: "amount1",
774
- type: "int256",
775
- internalType: "int256"
776
- }],
777
- stateMutability: "nonpayable"
778
- },
779
- {
780
- type: "function",
781
- name: "tickBitmap",
782
- inputs: [{
783
- name: "wordPosition",
784
- type: "int16",
785
- internalType: "int16"
786
- }],
787
- outputs: [{
788
- name: "",
789
- type: "uint256",
790
- internalType: "uint256"
791
- }],
792
- stateMutability: "view"
793
- },
794
- {
795
- type: "function",
796
- name: "tickSpacing",
797
- inputs: [],
798
- outputs: [{
799
- name: "",
800
- type: "int24",
801
- internalType: "int24"
802
- }],
803
- stateMutability: "view"
804
- },
805
- {
806
- type: "function",
807
- name: "ticks",
808
- inputs: [{
809
- name: "tick",
810
- type: "int24",
811
- internalType: "int24"
812
- }],
813
- outputs: [
814
- {
815
- name: "liquidityGross",
816
- type: "uint128",
817
- internalType: "uint128"
818
- },
819
- {
820
- name: "liquidityNet",
821
- type: "int128",
822
- internalType: "int128"
823
- },
824
- {
825
- name: "feeGrowthOutside0X128",
826
- type: "uint256",
827
- internalType: "uint256"
828
- },
829
- {
830
- name: "feeGrowthOutside1X128",
831
- type: "uint256",
832
- internalType: "uint256"
833
- },
834
- {
835
- name: "tickCumulativeOutside",
836
- type: "int56",
837
- internalType: "int56"
838
- },
839
- {
840
- name: "secondsPerLiquidityOutsideX128",
841
- type: "uint160",
842
- internalType: "uint160"
843
- },
844
- {
845
- name: "secondsOutside",
846
- type: "uint32",
847
- internalType: "uint32"
848
- },
849
- {
850
- name: "initialized",
851
- type: "bool",
852
- internalType: "bool"
853
- }
854
- ],
855
- stateMutability: "view"
856
- },
857
- {
858
- type: "function",
859
- name: "token0",
860
- inputs: [],
861
- outputs: [{
862
- name: "",
863
- type: "address",
864
- internalType: "address"
865
- }],
866
- stateMutability: "view"
867
- },
868
- {
869
- type: "function",
870
- name: "token1",
871
- inputs: [],
872
- outputs: [{
873
- name: "",
874
- type: "address",
875
- internalType: "address"
876
- }],
877
- stateMutability: "view"
878
- },
879
- {
880
- type: "event",
881
- name: "Burn",
882
- inputs: [
883
- {
884
- name: "owner",
885
- type: "address",
886
- indexed: true,
887
- internalType: "address"
888
- },
889
- {
890
- name: "tickLower",
891
- type: "int24",
892
- indexed: true,
893
- internalType: "int24"
894
- },
895
- {
896
- name: "tickUpper",
897
- type: "int24",
898
- indexed: true,
899
- internalType: "int24"
900
- },
901
- {
902
- name: "amount",
903
- type: "uint128",
904
- indexed: false,
905
- internalType: "uint128"
906
- },
907
- {
908
- name: "amount0",
909
- type: "uint256",
910
- indexed: false,
911
- internalType: "uint256"
912
- },
913
- {
914
- name: "amount1",
915
- type: "uint256",
916
- indexed: false,
917
- internalType: "uint256"
918
- }
919
- ],
920
- anonymous: false
921
- },
922
- {
923
- type: "event",
924
- name: "Collect",
925
- inputs: [
926
- {
927
- name: "owner",
928
- type: "address",
929
- indexed: true,
930
- internalType: "address"
931
- },
932
- {
933
- name: "recipient",
934
- type: "address",
935
- indexed: false,
936
- internalType: "address"
937
- },
938
- {
939
- name: "tickLower",
940
- type: "int24",
941
- indexed: true,
942
- internalType: "int24"
943
- },
944
- {
945
- name: "tickUpper",
946
- type: "int24",
947
- indexed: true,
948
- internalType: "int24"
949
- },
950
- {
951
- name: "amount0",
952
- type: "uint128",
953
- indexed: false,
954
- internalType: "uint128"
955
- },
956
- {
957
- name: "amount1",
958
- type: "uint128",
959
- indexed: false,
960
- internalType: "uint128"
961
- }
962
- ],
963
- anonymous: false
964
- },
965
- {
966
- type: "event",
967
- name: "CollectProtocol",
968
- inputs: [
969
- {
970
- name: "sender",
971
- type: "address",
972
- indexed: true,
973
- internalType: "address"
974
- },
975
- {
976
- name: "recipient",
977
- type: "address",
978
- indexed: true,
979
- internalType: "address"
980
- },
981
- {
982
- name: "amount0",
983
- type: "uint128",
984
- indexed: false,
985
- internalType: "uint128"
986
- },
987
- {
988
- name: "amount1",
989
- type: "uint128",
990
- indexed: false,
991
- internalType: "uint128"
992
- }
993
- ],
994
- anonymous: false
995
- },
996
- {
997
- type: "event",
998
- name: "Flash",
999
- inputs: [
1000
- {
1001
- name: "sender",
1002
- type: "address",
1003
- indexed: true,
1004
- internalType: "address"
1005
- },
1006
- {
1007
- name: "recipient",
1008
- type: "address",
1009
- indexed: true,
1010
- internalType: "address"
1011
- },
1012
- {
1013
- name: "amount0",
1014
- type: "uint256",
1015
- indexed: false,
1016
- internalType: "uint256"
1017
- },
1018
- {
1019
- name: "amount1",
1020
- type: "uint256",
1021
- indexed: false,
1022
- internalType: "uint256"
1023
- },
1024
- {
1025
- name: "paid0",
1026
- type: "uint256",
1027
- indexed: false,
1028
- internalType: "uint256"
1029
- },
1030
- {
1031
- name: "paid1",
1032
- type: "uint256",
1033
- indexed: false,
1034
- internalType: "uint256"
1035
- }
1036
- ],
1037
- anonymous: false
1038
- },
1039
- {
1040
- type: "event",
1041
- name: "IncreaseObservationCardinalityNext",
1042
- inputs: [{
1043
- name: "observationCardinalityNextOld",
1044
- type: "uint16",
1045
- indexed: false,
1046
- internalType: "uint16"
1047
- }, {
1048
- name: "observationCardinalityNextNew",
1049
- type: "uint16",
1050
- indexed: false,
1051
- internalType: "uint16"
1052
- }],
1053
- anonymous: false
1054
- },
1055
- {
1056
- type: "event",
1057
- name: "Initialize",
1058
- inputs: [{
1059
- name: "sqrtPriceX96",
1060
- type: "uint160",
1061
- indexed: false,
1062
- internalType: "uint160"
1063
- }, {
1064
- name: "tick",
1065
- type: "int24",
1066
- indexed: false,
1067
- internalType: "int24"
1068
- }],
1069
- anonymous: false
1070
- },
1071
- {
1072
- type: "event",
1073
- name: "Mint",
1074
- inputs: [
1075
- {
1076
- name: "sender",
1077
- type: "address",
1078
- indexed: false,
1079
- internalType: "address"
1080
- },
1081
- {
1082
- name: "owner",
1083
- type: "address",
1084
- indexed: true,
1085
- internalType: "address"
1086
- },
1087
- {
1088
- name: "tickLower",
1089
- type: "int24",
1090
- indexed: true,
1091
- internalType: "int24"
1092
- },
1093
- {
1094
- name: "tickUpper",
1095
- type: "int24",
1096
- indexed: true,
1097
- internalType: "int24"
1098
- },
1099
- {
1100
- name: "amount",
1101
- type: "uint128",
1102
- indexed: false,
1103
- internalType: "uint128"
1104
- },
1105
- {
1106
- name: "amount0",
1107
- type: "uint256",
1108
- indexed: false,
1109
- internalType: "uint256"
1110
- },
1111
- {
1112
- name: "amount1",
1113
- type: "uint256",
1114
- indexed: false,
1115
- internalType: "uint256"
1116
- }
1117
- ],
1118
- anonymous: false
1119
- },
1120
- {
1121
- type: "event",
1122
- name: "SetFeeProtocol",
1123
- inputs: [
1124
- {
1125
- name: "feeProtocol0Old",
1126
- type: "uint8",
1127
- indexed: false,
1128
- internalType: "uint8"
1129
- },
1130
- {
1131
- name: "feeProtocol1Old",
1132
- type: "uint8",
1133
- indexed: false,
1134
- internalType: "uint8"
1135
- },
1136
- {
1137
- name: "feeProtocol0New",
1138
- type: "uint8",
1139
- indexed: false,
1140
- internalType: "uint8"
1141
- },
1142
- {
1143
- name: "feeProtocol1New",
1144
- type: "uint8",
1145
- indexed: false,
1146
- internalType: "uint8"
1147
- }
1148
- ],
1149
- anonymous: false
1150
- },
1151
- {
1152
- type: "event",
1153
- name: "Swap",
1154
- inputs: [
1155
- {
1156
- name: "sender",
1157
- type: "address",
1158
- indexed: true,
1159
- internalType: "address"
1160
- },
1161
- {
1162
- name: "recipient",
1163
- type: "address",
1164
- indexed: true,
1165
- internalType: "address"
1166
- },
1167
- {
1168
- name: "amount0",
1169
- type: "int256",
1170
- indexed: false,
1171
- internalType: "int256"
1172
- },
1173
- {
1174
- name: "amount1",
1175
- type: "int256",
1176
- indexed: false,
1177
- internalType: "int256"
1178
- },
1179
- {
1180
- name: "sqrtPriceX96",
1181
- type: "uint160",
1182
- indexed: false,
1183
- internalType: "uint160"
1184
- },
1185
- {
1186
- name: "liquidity",
1187
- type: "uint128",
1188
- indexed: false,
1189
- internalType: "uint128"
1190
- },
1191
- {
1192
- name: "tick",
1193
- type: "int24",
1194
- indexed: false,
1195
- internalType: "int24"
1196
- }
1197
- ],
1198
- anonymous: false
1199
- },
1200
- {
1201
- type: "error",
1202
- name: "AI",
1203
- inputs: []
1204
- },
1205
- {
1206
- type: "error",
1207
- name: "AS",
1208
- inputs: []
1209
- },
1210
- {
1211
- type: "error",
1212
- name: "F0",
1213
- inputs: []
1214
- },
1215
- {
1216
- type: "error",
1217
- name: "F1",
1218
- inputs: []
1219
- },
1220
- {
1221
- type: "error",
1222
- name: "IIA",
1223
- inputs: []
1224
- },
1225
- {
1226
- type: "error",
1227
- name: "L",
1228
- inputs: []
1229
- },
1230
- {
1231
- type: "error",
1232
- name: "LOK",
1233
- inputs: []
1234
- },
1235
- {
1236
- type: "error",
1237
- name: "M0",
1238
- inputs: []
1239
- },
1240
- {
1241
- type: "error",
1242
- name: "M1",
1243
- inputs: []
1244
- },
1245
- {
1246
- type: "error",
1247
- name: "TLM",
1248
- inputs: []
1249
- },
1250
- {
1251
- type: "error",
1252
- name: "TLU",
1253
- inputs: []
1254
- },
1255
- {
1256
- type: "error",
1257
- name: "TUM",
1258
- inputs: []
1259
- }
1260
- ];
1261
-
1262
- //#endregion
1263
- //#region src/abis/uniswapMathLens.ts
1264
- const uniswapMathLensAbi = [
1265
- {
1266
- type: "function",
1267
- name: "batchGetAmount0ForLiquidity",
1268
- inputs: [
1269
- {
1270
- name: "sqrtRatioAX96",
1271
- type: "uint160[]",
1272
- internalType: "uint160[]"
1273
- },
1274
- {
1275
- name: "sqrtRatioBX96",
1276
- type: "uint160[]",
1277
- internalType: "uint160[]"
1278
- },
1279
- {
1280
- name: "liquidity",
1281
- type: "uint128[]",
1282
- internalType: "uint128[]"
1283
- }
1284
- ],
1285
- outputs: [{
1286
- name: "amounts0",
1287
- type: "uint256[]",
1288
- internalType: "uint256[]"
1289
- }],
1290
- stateMutability: "pure"
1291
- },
1292
- {
1293
- type: "function",
1294
- name: "batchGetAmount0ForLiquidityTicks",
1295
- inputs: [
1296
- {
1297
- name: "tickA",
1298
- type: "int24[]",
1299
- internalType: "int24[]"
1300
- },
1301
- {
1302
- name: "tickB",
1303
- type: "int24[]",
1304
- internalType: "int24[]"
1305
- },
1306
- {
1307
- name: "liquidity",
1308
- type: "uint128[]",
1309
- internalType: "uint128[]"
1310
- }
1311
- ],
1312
- outputs: [{
1313
- name: "amounts0",
1314
- type: "uint256[]",
1315
- internalType: "uint256[]"
1316
- }],
1317
- stateMutability: "pure"
1318
- },
1319
- {
1320
- type: "function",
1321
- name: "batchGetAmount1ForLiquidity",
1322
- inputs: [
1323
- {
1324
- name: "sqrtRatioAX96",
1325
- type: "uint160[]",
1326
- internalType: "uint160[]"
1327
- },
1328
- {
1329
- name: "sqrtRatioBX96",
1330
- type: "uint160[]",
1331
- internalType: "uint160[]"
1332
- },
1333
- {
1334
- name: "liquidity",
1335
- type: "uint128[]",
1336
- internalType: "uint128[]"
1337
- }
1338
- ],
1339
- outputs: [{
1340
- name: "amounts1",
1341
- type: "uint256[]",
1342
- internalType: "uint256[]"
1343
- }],
1344
- stateMutability: "pure"
1345
- },
1346
- {
1347
- type: "function",
1348
- name: "batchGetAmount1ForLiquidityTicks",
1349
- inputs: [
1350
- {
1351
- name: "tickA",
1352
- type: "int24[]",
1353
- internalType: "int24[]"
1354
- },
1355
- {
1356
- name: "tickB",
1357
- type: "int24[]",
1358
- internalType: "int24[]"
1359
- },
1360
- {
1361
- name: "liquidity",
1362
- type: "uint128[]",
1363
- internalType: "uint128[]"
1364
- }
1365
- ],
1366
- outputs: [{
1367
- name: "amounts1",
1368
- type: "uint256[]",
1369
- internalType: "uint256[]"
1370
- }],
1371
- stateMutability: "pure"
1372
- },
1373
- {
1374
- type: "function",
1375
- name: "batchGetAmountsForLiquidity",
1376
- inputs: [
1377
- {
1378
- name: "sqrtRatioX96",
1379
- type: "uint160[]",
1380
- internalType: "uint160[]"
1381
- },
1382
- {
1383
- name: "sqrtRatioAX96",
1384
- type: "uint160[]",
1385
- internalType: "uint160[]"
1386
- },
1387
- {
1388
- name: "sqrtRatioBX96",
1389
- type: "uint160[]",
1390
- internalType: "uint160[]"
1391
- },
1392
- {
1393
- name: "liquidity",
1394
- type: "uint128[]",
1395
- internalType: "uint128[]"
1396
- }
1397
- ],
1398
- outputs: [{
1399
- name: "amounts0",
1400
- type: "uint256[]",
1401
- internalType: "uint256[]"
1402
- }, {
1403
- name: "amounts1",
1404
- type: "uint256[]",
1405
- internalType: "uint256[]"
1406
- }],
1407
- stateMutability: "pure"
1408
- },
1409
- {
1410
- type: "function",
1411
- name: "batchGetAmountsForLiquidityTicks",
1412
- inputs: [
1413
- {
1414
- name: "tick",
1415
- type: "int24[]",
1416
- internalType: "int24[]"
1417
- },
1418
- {
1419
- name: "tickA",
1420
- type: "int24[]",
1421
- internalType: "int24[]"
1422
- },
1423
- {
1424
- name: "tickB",
1425
- type: "int24[]",
1426
- internalType: "int24[]"
1427
- },
1428
- {
1429
- name: "liquidity",
1430
- type: "uint128[]",
1431
- internalType: "uint128[]"
1432
- }
1433
- ],
1434
- outputs: [{
1435
- name: "amounts0",
1436
- type: "uint256[]",
1437
- internalType: "uint256[]"
1438
- }, {
1439
- name: "amounts1",
1440
- type: "uint256[]",
1441
- internalType: "uint256[]"
1442
- }],
1443
- stateMutability: "pure"
1444
- },
1445
- {
1446
- type: "function",
1447
- name: "batchGetLiquidityForAmount0",
1448
- inputs: [
1449
- {
1450
- name: "sqrtRatioAX96",
1451
- type: "uint160[]",
1452
- internalType: "uint160[]"
1453
- },
1454
- {
1455
- name: "sqrtRatioBX96",
1456
- type: "uint160[]",
1457
- internalType: "uint160[]"
1458
- },
1459
- {
1460
- name: "amount0",
1461
- type: "uint256[]",
1462
- internalType: "uint256[]"
1463
- }
1464
- ],
1465
- outputs: [{
1466
- name: "liquidities",
1467
- type: "uint128[]",
1468
- internalType: "uint128[]"
1469
- }],
1470
- stateMutability: "pure"
1471
- },
1472
- {
1473
- type: "function",
1474
- name: "batchGetLiquidityForAmount0Ticks",
1475
- inputs: [
1476
- {
1477
- name: "tickA",
1478
- type: "int24[]",
1479
- internalType: "int24[]"
1480
- },
1481
- {
1482
- name: "tickB",
1483
- type: "int24[]",
1484
- internalType: "int24[]"
1485
- },
1486
- {
1487
- name: "amount0",
1488
- type: "uint256[]",
1489
- internalType: "uint256[]"
1490
- }
1491
- ],
1492
- outputs: [{
1493
- name: "liquidities",
1494
- type: "uint128[]",
1495
- internalType: "uint128[]"
1496
- }],
1497
- stateMutability: "pure"
1498
- },
1499
- {
1500
- type: "function",
1501
- name: "batchGetLiquidityForAmount1",
1502
- inputs: [
1503
- {
1504
- name: "sqrtRatioAX96",
1505
- type: "uint160[]",
1506
- internalType: "uint160[]"
1507
- },
1508
- {
1509
- name: "sqrtRatioBX96",
1510
- type: "uint160[]",
1511
- internalType: "uint160[]"
1512
- },
1513
- {
1514
- name: "amount1",
1515
- type: "uint256[]",
1516
- internalType: "uint256[]"
1517
- }
1518
- ],
1519
- outputs: [{
1520
- name: "liquidities",
1521
- type: "uint128[]",
1522
- internalType: "uint128[]"
1523
- }],
1524
- stateMutability: "pure"
1525
- },
1526
- {
1527
- type: "function",
1528
- name: "batchGetLiquidityForAmount1Ticks",
1529
- inputs: [
1530
- {
1531
- name: "tickA",
1532
- type: "int24[]",
1533
- internalType: "int24[]"
1534
- },
1535
- {
1536
- name: "tickB",
1537
- type: "int24[]",
1538
- internalType: "int24[]"
1539
- },
1540
- {
1541
- name: "amount1",
1542
- type: "uint256[]",
1543
- internalType: "uint256[]"
1544
- }
1545
- ],
1546
- outputs: [{
1547
- name: "liquidities",
1548
- type: "uint128[]",
1549
- internalType: "uint128[]"
1550
- }],
1551
- stateMutability: "pure"
1552
- },
1553
- {
1554
- type: "function",
1555
- name: "batchGetLiquidityForAmounts",
1556
- inputs: [
1557
- {
1558
- name: "sqrtRatioX96",
1559
- type: "uint160[]",
1560
- internalType: "uint160[]"
1561
- },
1562
- {
1563
- name: "sqrtRatioAX96",
1564
- type: "uint160[]",
1565
- internalType: "uint160[]"
1566
- },
1567
- {
1568
- name: "sqrtRatioBX96",
1569
- type: "uint160[]",
1570
- internalType: "uint160[]"
1571
- },
1572
- {
1573
- name: "amount0",
1574
- type: "uint256[]",
1575
- internalType: "uint256[]"
1576
- },
1577
- {
1578
- name: "amount1",
1579
- type: "uint256[]",
1580
- internalType: "uint256[]"
1581
- }
1582
- ],
1583
- outputs: [{
1584
- name: "liquidities",
1585
- type: "uint128[]",
1586
- internalType: "uint128[]"
1587
- }],
1588
- stateMutability: "pure"
1589
- },
1590
- {
1591
- type: "function",
1592
- name: "batchGetLiquidityForAmountsTicks",
1593
- inputs: [
1594
- {
1595
- name: "tick",
1596
- type: "int24[]",
1597
- internalType: "int24[]"
1598
- },
1599
- {
1600
- name: "tickA",
1601
- type: "int24[]",
1602
- internalType: "int24[]"
1603
- },
1604
- {
1605
- name: "tickB",
1606
- type: "int24[]",
1607
- internalType: "int24[]"
1608
- },
1609
- {
1610
- name: "amount0",
1611
- type: "uint256[]",
1612
- internalType: "uint256[]"
1613
- },
1614
- {
1615
- name: "amount1",
1616
- type: "uint256[]",
1617
- internalType: "uint256[]"
1618
- }
1619
- ],
1620
- outputs: [{
1621
- name: "liquidities",
1622
- type: "uint128[]",
1623
- internalType: "uint128[]"
1624
- }],
1625
- stateMutability: "pure"
1626
- },
1627
- {
1628
- type: "function",
1629
- name: "batchGetPriceAtTick",
1630
- inputs: [{
1631
- name: "ticks",
1632
- type: "int24[]",
1633
- internalType: "int24[]"
1634
- }],
1635
- outputs: [{
1636
- name: "prices",
1637
- type: "uint256[]",
1638
- internalType: "uint256[]"
1639
- }],
1640
- stateMutability: "pure"
1641
- },
1642
- {
1643
- type: "function",
1644
- name: "getAmount0ForLiquidity",
1645
- inputs: [
1646
- {
1647
- name: "sqrtRatioAX96",
1648
- type: "uint160",
1649
- internalType: "uint160"
1650
- },
1651
- {
1652
- name: "sqrtRatioBX96",
1653
- type: "uint160",
1654
- internalType: "uint160"
1655
- },
1656
- {
1657
- name: "liquidity",
1658
- type: "uint128",
1659
- internalType: "uint128"
1660
- }
1661
- ],
1662
- outputs: [{
1663
- name: "amount0",
1664
- type: "uint256",
1665
- internalType: "uint256"
1666
- }],
1667
- stateMutability: "pure"
1668
- },
1669
- {
1670
- type: "function",
1671
- name: "getAmount0ForLiquidityTicks",
1672
- inputs: [
1673
- {
1674
- name: "tickA",
1675
- type: "int24",
1676
- internalType: "int24"
1677
- },
1678
- {
1679
- name: "tickB",
1680
- type: "int24",
1681
- internalType: "int24"
1682
- },
1683
- {
1684
- name: "liquidity",
1685
- type: "uint128",
1686
- internalType: "uint128"
1687
- }
1688
- ],
1689
- outputs: [{
1690
- name: "amount0",
1691
- type: "uint256",
1692
- internalType: "uint256"
1693
- }],
1694
- stateMutability: "pure"
1695
- },
1696
- {
1697
- type: "function",
1698
- name: "getAmount1ForLiquidity",
1699
- inputs: [
1700
- {
1701
- name: "sqrtRatioAX96",
1702
- type: "uint160",
1703
- internalType: "uint160"
1704
- },
1705
- {
1706
- name: "sqrtRatioBX96",
1707
- type: "uint160",
1708
- internalType: "uint160"
1709
- },
1710
- {
1711
- name: "liquidity",
1712
- type: "uint128",
1713
- internalType: "uint128"
1714
- }
1715
- ],
1716
- outputs: [{
1717
- name: "amount1",
1718
- type: "uint256",
1719
- internalType: "uint256"
1720
- }],
1721
- stateMutability: "pure"
1722
- },
1723
- {
1724
- type: "function",
1725
- name: "getAmount1ForLiquidityTicks",
1726
- inputs: [
1727
- {
1728
- name: "tickA",
1729
- type: "int24",
1730
- internalType: "int24"
1731
- },
1732
- {
1733
- name: "tickB",
1734
- type: "int24",
1735
- internalType: "int24"
1736
- },
1737
- {
1738
- name: "liquidity",
1739
- type: "uint128",
1740
- internalType: "uint128"
1741
- }
1742
- ],
1743
- outputs: [{
1744
- name: "amount1",
1745
- type: "uint256",
1746
- internalType: "uint256"
1747
- }],
1748
- stateMutability: "pure"
1749
- },
1750
- {
1751
- type: "function",
1752
- name: "getAmountsForLiquidity",
1753
- inputs: [
1754
- {
1755
- name: "sqrtRatioX96",
1756
- type: "uint160",
1757
- internalType: "uint160"
1758
- },
1759
- {
1760
- name: "sqrtRatioAX96",
1761
- type: "uint160",
1762
- internalType: "uint160"
1763
- },
1764
- {
1765
- name: "sqrtRatioBX96",
1766
- type: "uint160",
1767
- internalType: "uint160"
1768
- },
1769
- {
1770
- name: "liquidity",
1771
- type: "uint128",
1772
- internalType: "uint128"
1773
- }
1774
- ],
1775
- outputs: [{
1776
- name: "amount0",
1777
- type: "uint256",
1778
- internalType: "uint256"
1779
- }, {
1780
- name: "amount1",
1781
- type: "uint256",
1782
- internalType: "uint256"
1783
- }],
1784
- stateMutability: "pure"
1785
- },
1786
- {
1787
- type: "function",
1788
- name: "getAmountsForLiquidityTicks",
1789
- inputs: [
1790
- {
1791
- name: "tick",
1792
- type: "int24",
1793
- internalType: "int24"
1794
- },
1795
- {
1796
- name: "tickA",
1797
- type: "int24",
1798
- internalType: "int24"
1799
- },
1800
- {
1801
- name: "tickB",
1802
- type: "int24",
1803
- internalType: "int24"
1804
- },
1805
- {
1806
- name: "liquidity",
1807
- type: "uint128",
1808
- internalType: "uint128"
1809
- }
1810
- ],
1811
- outputs: [{
1812
- name: "amount0",
1813
- type: "uint256",
1814
- internalType: "uint256"
1815
- }, {
1816
- name: "amount1",
1817
- type: "uint256",
1818
- internalType: "uint256"
1819
- }],
1820
- stateMutability: "pure"
1821
- },
1822
- {
1823
- type: "function",
1824
- name: "getLiquidityForAmount0",
1825
- inputs: [
1826
- {
1827
- name: "sqrtRatioAX96",
1828
- type: "uint160",
1829
- internalType: "uint160"
1830
- },
1831
- {
1832
- name: "sqrtRatioBX96",
1833
- type: "uint160",
1834
- internalType: "uint160"
1835
- },
1836
- {
1837
- name: "amount0",
1838
- type: "uint256",
1839
- internalType: "uint256"
1840
- }
1841
- ],
1842
- outputs: [{
1843
- name: "liquidity",
1844
- type: "uint128",
1845
- internalType: "uint128"
1846
- }],
1847
- stateMutability: "pure"
1848
- },
1849
- {
1850
- type: "function",
1851
- name: "getLiquidityForAmount0Ticks",
1852
- inputs: [
1853
- {
1854
- name: "tickA",
1855
- type: "int24",
1856
- internalType: "int24"
1857
- },
1858
- {
1859
- name: "tickB",
1860
- type: "int24",
1861
- internalType: "int24"
1862
- },
1863
- {
1864
- name: "amount0",
1865
- type: "uint256",
1866
- internalType: "uint256"
1867
- }
1868
- ],
1869
- outputs: [{
1870
- name: "liquidity",
1871
- type: "uint128",
1872
- internalType: "uint128"
1873
- }],
1874
- stateMutability: "pure"
1875
- },
1876
- {
1877
- type: "function",
1878
- name: "getLiquidityForAmount1",
1879
- inputs: [
1880
- {
1881
- name: "sqrtRatioAX96",
1882
- type: "uint160",
1883
- internalType: "uint160"
1884
- },
1885
- {
1886
- name: "sqrtRatioBX96",
1887
- type: "uint160",
1888
- internalType: "uint160"
1889
- },
1890
- {
1891
- name: "amount1",
1892
- type: "uint256",
1893
- internalType: "uint256"
1894
- }
1895
- ],
1896
- outputs: [{
1897
- name: "liquidity",
1898
- type: "uint128",
1899
- internalType: "uint128"
1900
- }],
1901
- stateMutability: "pure"
1902
- },
1903
- {
1904
- type: "function",
1905
- name: "getLiquidityForAmount1Ticks",
1906
- inputs: [
1907
- {
1908
- name: "tickA",
1909
- type: "int24",
1910
- internalType: "int24"
1911
- },
1912
- {
1913
- name: "tickB",
1914
- type: "int24",
1915
- internalType: "int24"
1916
- },
1917
- {
1918
- name: "amount1",
1919
- type: "uint256",
1920
- internalType: "uint256"
1921
- }
1922
- ],
1923
- outputs: [{
1924
- name: "liquidity",
1925
- type: "uint128",
1926
- internalType: "uint128"
1927
- }],
1928
- stateMutability: "pure"
1929
- },
1930
- {
1931
- type: "function",
1932
- name: "getLiquidityForAmounts",
1933
- inputs: [
1934
- {
1935
- name: "sqrtRatioX96",
1936
- type: "uint160",
1937
- internalType: "uint160"
1938
- },
1939
- {
1940
- name: "sqrtRatioAX96",
1941
- type: "uint160",
1942
- internalType: "uint160"
1943
- },
1944
- {
1945
- name: "sqrtRatioBX96",
1946
- type: "uint160",
1947
- internalType: "uint160"
1948
- },
1949
- {
1950
- name: "amount0",
1951
- type: "uint256",
1952
- internalType: "uint256"
1953
- },
1954
- {
1955
- name: "amount1",
1956
- type: "uint256",
1957
- internalType: "uint256"
1958
- }
1959
- ],
1960
- outputs: [{
1961
- name: "liquidity",
1962
- type: "uint128",
1963
- internalType: "uint128"
1964
- }],
1965
- stateMutability: "pure"
1966
- },
1967
- {
1968
- type: "function",
1969
- name: "getLiquidityForAmountsTicks",
1970
- inputs: [
1971
- {
1972
- name: "tick",
1973
- type: "int24",
1974
- internalType: "int24"
1975
- },
1976
- {
1977
- name: "tickA",
1978
- type: "int24",
1979
- internalType: "int24"
1980
- },
1981
- {
1982
- name: "tickB",
1983
- type: "int24",
1984
- internalType: "int24"
1985
- },
1986
- {
1987
- name: "amount0",
1988
- type: "uint256",
1989
- internalType: "uint256"
1990
- },
1991
- {
1992
- name: "amount1",
1993
- type: "uint256",
1994
- internalType: "uint256"
1995
- }
1996
- ],
1997
- outputs: [{
1998
- name: "liquidity",
1999
- type: "uint128",
2000
- internalType: "uint128"
2001
- }],
2002
- stateMutability: "pure"
2003
- },
2004
- {
2005
- type: "function",
2006
- name: "getPriceAtTick",
2007
- inputs: [{
2008
- name: "tick",
2009
- type: "int24",
2010
- internalType: "int24"
2011
- }],
2012
- outputs: [{
2013
- name: "",
2014
- type: "uint256",
2015
- internalType: "uint256"
2016
- }],
2017
- stateMutability: "pure"
2018
- }
2019
- ];
2020
-
2021
- //#endregion
2022
- //#region src/abis/lens.ts
2023
- const lensAbi = [
2024
- {
2025
- type: "function",
2026
- name: "batchGetRefTick",
2027
- inputs: [{
2028
- name: "vault",
2029
- type: "address",
2030
- internalType: "contract TimelockSingleOwnerVault"
2031
- }, {
2032
- name: "tickLower",
2033
- type: "int24[]",
2034
- internalType: "int24[]"
2035
- }],
2036
- outputs: [{
2037
- name: "refTicks",
2038
- type: "int24[]",
2039
- internalType: "int24[]"
2040
- }],
2041
- stateMutability: "view"
2042
- },
2043
- {
2044
- type: "function",
2045
- name: "getAllBlocks",
2046
- inputs: [{
2047
- name: "vault",
2048
- type: "address",
2049
- internalType: "contract TimelockVaultCore"
2050
- }],
2051
- outputs: [{
2052
- name: "blocks",
2053
- type: "tuple[]",
2054
- internalType: "struct TimelockLens.LiquidityBlockData[]",
2055
- components: [
2056
- {
2057
- name: "tickLower",
2058
- type: "int24",
2059
- internalType: "int24"
2060
- },
2061
- {
2062
- name: "tickUpper",
2063
- type: "int24",
2064
- internalType: "int24"
2065
- },
2066
- {
2067
- name: "prevTickLower",
2068
- type: "int24",
2069
- internalType: "int24"
2070
- },
2071
- {
2072
- name: "totalLiquidity",
2073
- type: "uint128",
2074
- internalType: "uint128"
2075
- },
2076
- {
2077
- name: "borrowedLiquidity",
2078
- type: "uint128",
2079
- internalType: "uint128"
2080
- },
2081
- {
2082
- name: "totalAmount0",
2083
- type: "uint256",
2084
- internalType: "uint256"
2085
- },
2086
- {
2087
- name: "totalAmount1",
2088
- type: "uint256",
2089
- internalType: "uint256"
2090
- },
2091
- {
2092
- name: "borrowedAmount0",
2093
- type: "uint256",
2094
- internalType: "uint256"
2095
- },
2096
- {
2097
- name: "borrowedAmount1",
2098
- type: "uint256",
2099
- internalType: "uint256"
2100
- }
2101
- ]
2102
- }],
2103
- stateMutability: "view"
2104
- },
2105
- {
2106
- type: "function",
2107
- name: "getExpiredOptions",
2108
- inputs: [
2109
- {
2110
- name: "market",
2111
- type: "address",
2112
- internalType: "contract TimelockOptionsMarket"
2113
- },
2114
- {
2115
- name: "startId",
2116
- type: "uint256",
2117
- internalType: "uint256"
2118
- },
2119
- {
2120
- name: "limit",
2121
- type: "uint256",
2122
- internalType: "uint256"
2123
- }
2124
- ],
2125
- outputs: [
2126
- {
2127
- name: "expiredOptions",
2128
- type: "tuple[]",
2129
- internalType: "struct TimelockLens.OptionData[]",
2130
- components: [
2131
- {
2132
- name: "optionId",
2133
- type: "uint256",
2134
- internalType: "uint256"
2135
- },
2136
- {
2137
- name: "owner",
2138
- type: "address",
2139
- internalType: "address"
2140
- },
2141
- {
2142
- name: "optionType",
2143
- type: "uint8",
2144
- internalType: "uint8"
2145
- },
2146
- {
2147
- name: "leftTick",
2148
- type: "int24",
2149
- internalType: "int24"
2150
- },
2151
- {
2152
- name: "strikeTick",
2153
- type: "int24",
2154
- internalType: "int24"
2155
- },
2156
- {
2157
- name: "entryTick",
2158
- type: "int24",
2159
- internalType: "int24"
2160
- },
2161
- {
2162
- name: "strikePrice",
2163
- type: "uint256",
2164
- internalType: "uint256"
2165
- },
2166
- {
2167
- name: "entryPrice",
2168
- type: "uint256",
2169
- internalType: "uint256"
2170
- },
2171
- {
2172
- name: "optionAssetBorrowed",
2173
- type: "uint256",
2174
- internalType: "uint256"
2175
- },
2176
- {
2177
- name: "payoutAssetBorrowed",
2178
- type: "uint256",
2179
- internalType: "uint256"
2180
- },
2181
- {
2182
- name: "optionAssetToRepay",
2183
- type: "uint256",
2184
- internalType: "uint256"
2185
- },
2186
- {
2187
- name: "payoutAssetToRepay",
2188
- type: "uint256",
2189
- internalType: "uint256"
2190
- },
2191
- {
2192
- name: "positionSize",
2193
- type: "uint256",
2194
- internalType: "uint256"
2195
- },
2196
- {
2197
- name: "netOptionAssetToRepay",
2198
- type: "uint256",
2199
- internalType: "uint256"
2200
- },
2201
- {
2202
- name: "premiumPaid",
2203
- type: "uint128",
2204
- internalType: "uint128"
2205
- },
2206
- {
2207
- name: "expiresAt",
2208
- type: "uint64",
2209
- internalType: "uint64"
2210
- },
2211
- {
2212
- name: "createdAt",
2213
- type: "uint64",
2214
- internalType: "uint64"
2215
- },
2216
- {
2217
- name: "liquidities",
2218
- type: "uint128[]",
2219
- internalType: "uint128[]"
2220
- }
2221
- ]
2222
- },
2223
- {
2224
- name: "nextStartId",
2225
- type: "uint256",
2226
- internalType: "uint256"
2227
- },
2228
- {
2229
- name: "hasMore",
2230
- type: "bool",
2231
- internalType: "bool"
2232
- }
2233
- ],
2234
- stateMutability: "view"
2235
- },
2236
- {
2237
- type: "function",
2238
- name: "getLiquidityAtTick",
2239
- inputs: [{
2240
- name: "vault",
2241
- type: "address",
2242
- internalType: "contract TimelockSingleOwnerVault"
2243
- }, {
2244
- name: "tickLower",
2245
- type: "int24",
2246
- internalType: "int24"
2247
- }],
2248
- outputs: [{
2249
- name: "totalLiquidity",
2250
- type: "uint128",
2251
- internalType: "uint128"
2252
- }, {
2253
- name: "borrowedLiquidity",
2254
- type: "uint128",
2255
- internalType: "uint128"
2256
- }],
2257
- stateMutability: "view"
2258
- },
2259
- {
2260
- type: "function",
2261
- name: "getMarketData",
2262
- inputs: [{
2263
- name: "market",
2264
- type: "address",
2265
- internalType: "contract TimelockOptionsMarket"
2266
- }],
2267
- outputs: [{
2268
- name: "marketData",
2269
- type: "tuple",
2270
- internalType: "struct TimelockLens.TimelockMarketData",
2271
- components: [
2272
- {
2273
- name: "optionAssetIsToken0",
2274
- type: "bool",
2275
- internalType: "bool"
2276
- },
2277
- {
2278
- name: "vault",
2279
- type: "address",
2280
- internalType: "contract ITimelockVault"
2281
- },
2282
- {
2283
- name: "pool",
2284
- type: "address",
2285
- internalType: "contract IUniswapV3Pool"
2286
- },
2287
- {
2288
- name: "optionAsset",
2289
- type: "address",
2290
- internalType: "address"
2291
- },
2292
- {
2293
- name: "payoutAsset",
2294
- type: "address",
2295
- internalType: "address"
2296
- },
2297
- {
2298
- name: "optionAssetDecimals",
2299
- type: "uint8",
2300
- internalType: "uint8"
2301
- },
2302
- {
2303
- name: "payoutAssetDecimals",
2304
- type: "uint8",
2305
- internalType: "uint8"
2306
- },
2307
- {
2308
- name: "optionAssetSymbol",
2309
- type: "string",
2310
- internalType: "string"
2311
- },
2312
- {
2313
- name: "payoutAssetSymbol",
2314
- type: "string",
2315
- internalType: "string"
2316
- },
2317
- {
2318
- name: "optionAssetName",
2319
- type: "string",
2320
- internalType: "string"
2321
- },
2322
- {
2323
- name: "payoutAssetName",
2324
- type: "string",
2325
- internalType: "string"
2326
- },
2327
- {
2328
- name: "optionsCount",
2329
- type: "uint256",
2330
- internalType: "uint256"
2331
- }
2332
- ]
2333
- }],
2334
- stateMutability: "view"
2335
- },
2336
- {
2337
- type: "function",
2338
- name: "getMaxPositionSize",
2339
- inputs: [
2340
- {
2341
- name: "market",
2342
- type: "address",
2343
- internalType: "contract TimelockOptionsMarket"
2344
- },
2345
- {
2346
- name: "strikeTick",
2347
- type: "int24",
2348
- internalType: "int24"
2349
- },
2350
- {
2351
- name: "maxBorrowableRange",
2352
- type: "int24",
2353
- internalType: "int24"
2354
- }
2355
- ],
2356
- outputs: [{
2357
- name: "maxCallSize",
2358
- type: "uint256",
2359
- internalType: "uint256"
2360
- }, {
2361
- name: "maxPutSize",
2362
- type: "uint256",
2363
- internalType: "uint256"
2364
- }],
2365
- stateMutability: "view"
2366
- },
2367
- {
2368
- type: "function",
2369
- name: "getMaxPositionSizeAtCurrentTick",
2370
- inputs: [{
2371
- name: "market",
2372
- type: "address",
2373
- internalType: "contract TimelockOptionsMarket"
2374
- }, {
2375
- name: "maxBorrowableRange",
2376
- type: "int24",
2377
- internalType: "int24"
2378
- }],
2379
- outputs: [{
2380
- name: "maxCallSize",
2381
- type: "uint256",
2382
- internalType: "uint256"
2383
- }, {
2384
- name: "maxPutSize",
2385
- type: "uint256",
2386
- internalType: "uint256"
2387
- }],
2388
- stateMutability: "view"
2389
- },
2390
- {
2391
- type: "function",
2392
- name: "getOptionData",
2393
- inputs: [{
2394
- name: "market",
2395
- type: "address",
2396
- internalType: "contract TimelockOptionsMarket"
2397
- }, {
2398
- name: "optionId",
2399
- type: "uint256",
2400
- internalType: "uint256"
2401
- }],
2402
- outputs: [{
2403
- name: "",
2404
- type: "tuple",
2405
- internalType: "struct TimelockLens.OptionData",
2406
- components: [
2407
- {
2408
- name: "optionId",
2409
- type: "uint256",
2410
- internalType: "uint256"
2411
- },
2412
- {
2413
- name: "owner",
2414
- type: "address",
2415
- internalType: "address"
2416
- },
2417
- {
2418
- name: "optionType",
2419
- type: "uint8",
2420
- internalType: "uint8"
2421
- },
2422
- {
2423
- name: "leftTick",
2424
- type: "int24",
2425
- internalType: "int24"
2426
- },
2427
- {
2428
- name: "strikeTick",
2429
- type: "int24",
2430
- internalType: "int24"
2431
- },
2432
- {
2433
- name: "entryTick",
2434
- type: "int24",
2435
- internalType: "int24"
2436
- },
2437
- {
2438
- name: "strikePrice",
2439
- type: "uint256",
2440
- internalType: "uint256"
2441
- },
2442
- {
2443
- name: "entryPrice",
2444
- type: "uint256",
2445
- internalType: "uint256"
2446
- },
2447
- {
2448
- name: "optionAssetBorrowed",
2449
- type: "uint256",
2450
- internalType: "uint256"
2451
- },
2452
- {
2453
- name: "payoutAssetBorrowed",
2454
- type: "uint256",
2455
- internalType: "uint256"
2456
- },
2457
- {
2458
- name: "optionAssetToRepay",
2459
- type: "uint256",
2460
- internalType: "uint256"
2461
- },
2462
- {
2463
- name: "payoutAssetToRepay",
2464
- type: "uint256",
2465
- internalType: "uint256"
2466
- },
2467
- {
2468
- name: "positionSize",
2469
- type: "uint256",
2470
- internalType: "uint256"
2471
- },
2472
- {
2473
- name: "netOptionAssetToRepay",
2474
- type: "uint256",
2475
- internalType: "uint256"
2476
- },
2477
- {
2478
- name: "premiumPaid",
2479
- type: "uint128",
2480
- internalType: "uint128"
2481
- },
2482
- {
2483
- name: "expiresAt",
2484
- type: "uint64",
2485
- internalType: "uint64"
2486
- },
2487
- {
2488
- name: "createdAt",
2489
- type: "uint64",
2490
- internalType: "uint64"
2491
- },
2492
- {
2493
- name: "liquidities",
2494
- type: "uint128[]",
2495
- internalType: "uint128[]"
2496
- }
2497
- ]
2498
- }],
2499
- stateMutability: "view"
2500
- },
2501
- {
2502
- type: "function",
2503
- name: "getOptionsData",
2504
- inputs: [{
2505
- name: "market",
2506
- type: "address",
2507
- internalType: "contract TimelockOptionsMarket"
2508
- }, {
2509
- name: "optionIds",
2510
- type: "uint256[]",
2511
- internalType: "uint256[]"
2512
- }],
2513
- outputs: [{
2514
- name: "optionsData",
2515
- type: "tuple[]",
2516
- internalType: "struct TimelockLens.OptionData[]",
2517
- components: [
2518
- {
2519
- name: "optionId",
2520
- type: "uint256",
2521
- internalType: "uint256"
2522
- },
2523
- {
2524
- name: "owner",
2525
- type: "address",
2526
- internalType: "address"
2527
- },
2528
- {
2529
- name: "optionType",
2530
- type: "uint8",
2531
- internalType: "uint8"
2532
- },
2533
- {
2534
- name: "leftTick",
2535
- type: "int24",
2536
- internalType: "int24"
2537
- },
2538
- {
2539
- name: "strikeTick",
2540
- type: "int24",
2541
- internalType: "int24"
2542
- },
2543
- {
2544
- name: "entryTick",
2545
- type: "int24",
2546
- internalType: "int24"
2547
- },
2548
- {
2549
- name: "strikePrice",
2550
- type: "uint256",
2551
- internalType: "uint256"
2552
- },
2553
- {
2554
- name: "entryPrice",
2555
- type: "uint256",
2556
- internalType: "uint256"
2557
- },
2558
- {
2559
- name: "optionAssetBorrowed",
2560
- type: "uint256",
2561
- internalType: "uint256"
2562
- },
2563
- {
2564
- name: "payoutAssetBorrowed",
2565
- type: "uint256",
2566
- internalType: "uint256"
2567
- },
2568
- {
2569
- name: "optionAssetToRepay",
2570
- type: "uint256",
2571
- internalType: "uint256"
2572
- },
2573
- {
2574
- name: "payoutAssetToRepay",
2575
- type: "uint256",
2576
- internalType: "uint256"
2577
- },
2578
- {
2579
- name: "positionSize",
2580
- type: "uint256",
2581
- internalType: "uint256"
2582
- },
2583
- {
2584
- name: "netOptionAssetToRepay",
2585
- type: "uint256",
2586
- internalType: "uint256"
2587
- },
2588
- {
2589
- name: "premiumPaid",
2590
- type: "uint128",
2591
- internalType: "uint128"
2592
- },
2593
- {
2594
- name: "expiresAt",
2595
- type: "uint64",
2596
- internalType: "uint64"
2597
- },
2598
- {
2599
- name: "createdAt",
2600
- type: "uint64",
2601
- internalType: "uint64"
2602
- },
2603
- {
2604
- name: "liquidities",
2605
- type: "uint128[]",
2606
- internalType: "uint128[]"
2607
- }
2608
- ]
2609
- }],
2610
- stateMutability: "view"
2611
- },
2612
- {
2613
- type: "function",
2614
- name: "getPoolData",
2615
- inputs: [{
2616
- name: "pool",
2617
- type: "address",
2618
- internalType: "contract IUniswapV3Pool"
2619
- }],
2620
- outputs: [{
2621
- name: "poolData",
2622
- type: "tuple",
2623
- internalType: "struct TimelockLens.UniswapPoolData",
2624
- components: [
2625
- {
2626
- name: "token0",
2627
- type: "address",
2628
- internalType: "address"
2629
- },
2630
- {
2631
- name: "token1",
2632
- type: "address",
2633
- internalType: "address"
2634
- },
2635
- {
2636
- name: "token0Decimals",
2637
- type: "uint8",
2638
- internalType: "uint8"
2639
- },
2640
- {
2641
- name: "token1Decimals",
2642
- type: "uint8",
2643
- internalType: "uint8"
2644
- },
2645
- {
2646
- name: "token0Symbol",
2647
- type: "string",
2648
- internalType: "string"
2649
- },
2650
- {
2651
- name: "token1Symbol",
2652
- type: "string",
2653
- internalType: "string"
2654
- },
2655
- {
2656
- name: "token0Name",
2657
- type: "string",
2658
- internalType: "string"
2659
- },
2660
- {
2661
- name: "token1Name",
2662
- type: "string",
2663
- internalType: "string"
2664
- },
2665
- {
2666
- name: "tickSpacing",
2667
- type: "int24",
2668
- internalType: "int24"
2669
- },
2670
- {
2671
- name: "fee",
2672
- type: "uint24",
2673
- internalType: "uint24"
2674
- }
2675
- ]
2676
- }],
2677
- stateMutability: "view"
2678
- },
2679
- {
2680
- type: "function",
2681
- name: "getRefTick",
2682
- inputs: [{
2683
- name: "vault",
2684
- type: "address",
2685
- internalType: "contract TimelockSingleOwnerVault"
2686
- }, {
2687
- name: "tickLower",
2688
- type: "int24",
2689
- internalType: "int24"
2690
- }],
2691
- outputs: [{
2692
- name: "refTick",
2693
- type: "int24",
2694
- internalType: "int24"
2695
- }],
2696
- stateMutability: "view"
2697
- },
2698
- {
2699
- type: "function",
2700
- name: "getUserOptions",
2701
- inputs: [
2702
- {
2703
- name: "market",
2704
- type: "address",
2705
- internalType: "contract TimelockOptionsMarket"
2706
- },
2707
- {
2708
- name: "user",
2709
- type: "address",
2710
- internalType: "address"
2711
- },
2712
- {
2713
- name: "startId",
2714
- type: "uint256",
2715
- internalType: "uint256"
2716
- },
2717
- {
2718
- name: "limit",
2719
- type: "uint256",
2720
- internalType: "uint256"
2721
- }
2722
- ],
2723
- outputs: [
2724
- {
2725
- name: "userOptions",
2726
- type: "tuple[]",
2727
- internalType: "struct TimelockLens.OptionData[]",
2728
- components: [
2729
- {
2730
- name: "optionId",
2731
- type: "uint256",
2732
- internalType: "uint256"
2733
- },
2734
- {
2735
- name: "owner",
2736
- type: "address",
2737
- internalType: "address"
2738
- },
2739
- {
2740
- name: "optionType",
2741
- type: "uint8",
2742
- internalType: "uint8"
2743
- },
2744
- {
2745
- name: "leftTick",
2746
- type: "int24",
2747
- internalType: "int24"
2748
- },
2749
- {
2750
- name: "strikeTick",
2751
- type: "int24",
2752
- internalType: "int24"
2753
- },
2754
- {
2755
- name: "entryTick",
2756
- type: "int24",
2757
- internalType: "int24"
2758
- },
2759
- {
2760
- name: "strikePrice",
2761
- type: "uint256",
2762
- internalType: "uint256"
2763
- },
2764
- {
2765
- name: "entryPrice",
2766
- type: "uint256",
2767
- internalType: "uint256"
2768
- },
2769
- {
2770
- name: "optionAssetBorrowed",
2771
- type: "uint256",
2772
- internalType: "uint256"
2773
- },
2774
- {
2775
- name: "payoutAssetBorrowed",
2776
- type: "uint256",
2777
- internalType: "uint256"
2778
- },
2779
- {
2780
- name: "optionAssetToRepay",
2781
- type: "uint256",
2782
- internalType: "uint256"
2783
- },
2784
- {
2785
- name: "payoutAssetToRepay",
2786
- type: "uint256",
2787
- internalType: "uint256"
2788
- },
2789
- {
2790
- name: "positionSize",
2791
- type: "uint256",
2792
- internalType: "uint256"
2793
- },
2794
- {
2795
- name: "netOptionAssetToRepay",
2796
- type: "uint256",
2797
- internalType: "uint256"
2798
- },
2799
- {
2800
- name: "premiumPaid",
2801
- type: "uint128",
2802
- internalType: "uint128"
2803
- },
2804
- {
2805
- name: "expiresAt",
2806
- type: "uint64",
2807
- internalType: "uint64"
2808
- },
2809
- {
2810
- name: "createdAt",
2811
- type: "uint64",
2812
- internalType: "uint64"
2813
- },
2814
- {
2815
- name: "liquidities",
2816
- type: "uint128[]",
2817
- internalType: "uint128[]"
2818
- }
2819
- ]
2820
- },
2821
- {
2822
- name: "nextStartId",
2823
- type: "uint256",
2824
- internalType: "uint256"
2825
- },
2826
- {
2827
- name: "hasMore",
2828
- type: "bool",
2829
- internalType: "bool"
2830
- }
2831
- ],
2832
- stateMutability: "view"
2833
- },
2834
- {
2835
- type: "function",
2836
- name: "getVaultTVL",
2837
- inputs: [{
2838
- name: "vault",
2839
- type: "address",
2840
- internalType: "contract TimelockVaultCore"
2841
- }],
2842
- outputs: [
2843
- {
2844
- name: "totalAmount0",
2845
- type: "uint256",
2846
- internalType: "uint256"
2847
- },
2848
- {
2849
- name: "totalAmount1",
2850
- type: "uint256",
2851
- internalType: "uint256"
2852
- },
2853
- {
2854
- name: "borrowedAmount0",
2855
- type: "uint256",
2856
- internalType: "uint256"
2857
- },
2858
- {
2859
- name: "borrowedAmount1",
2860
- type: "uint256",
2861
- internalType: "uint256"
2862
- },
2863
- {
2864
- name: "tvl0",
2865
- type: "uint256",
2866
- internalType: "uint256"
2867
- },
2868
- {
2869
- name: "tvl1",
2870
- type: "uint256",
2871
- internalType: "uint256"
2872
- }
2873
- ],
2874
- stateMutability: "view"
2875
- }
2876
- ];
2877
-
2878
- //#endregion
2879
- //#region src/abis/singleOwnerVault.ts
2880
- const singleOwnerVaultAbi = [
2881
- {
2882
- type: "constructor",
2883
- inputs: [{
2884
- name: "_pool",
2885
- type: "address",
2886
- internalType: "contract IUniswapV3Pool"
2887
- }, {
2888
- name: "_owner",
2889
- type: "address",
2890
- internalType: "address"
2891
- }],
2892
- stateMutability: "nonpayable"
2893
- },
2894
- {
2895
- type: "function",
2896
- name: "BORROW",
2897
- inputs: [],
2898
- outputs: [{
2899
- name: "",
2900
- type: "uint8",
2901
- internalType: "uint8"
2902
- }],
2903
- stateMutability: "view"
2904
- },
2905
- {
2906
- type: "function",
2907
- name: "BURN",
2908
- inputs: [],
2909
- outputs: [{
2910
- name: "",
2911
- type: "uint8",
2912
- internalType: "uint8"
2913
- }],
2914
- stateMutability: "view"
2915
- },
2916
- {
2917
- type: "function",
2918
- name: "MINT",
2919
- inputs: [],
2920
- outputs: [{
2921
- name: "",
2922
- type: "uint8",
2923
- internalType: "uint8"
2924
- }],
2925
- stateMutability: "view"
2926
- },
2927
- {
2928
- type: "function",
2929
- name: "MIN_DUST_THRESHOLD",
2930
- inputs: [],
2931
- outputs: [{
2932
- name: "",
2933
- type: "uint256",
2934
- internalType: "uint256"
2935
- }],
2936
- stateMutability: "view"
2937
- },
2938
- {
2939
- type: "function",
2940
- name: "REPAY",
2941
- inputs: [],
2942
- outputs: [{
2943
- name: "",
2944
- type: "uint8",
2945
- internalType: "uint8"
2946
- }],
2947
- stateMutability: "view"
2948
- },
2949
- {
2950
- type: "function",
2951
- name: "blocks",
2952
- inputs: [{
2953
- name: "",
2954
- type: "int24",
2955
- internalType: "int24"
2956
- }],
2957
- outputs: [
2958
- {
2959
- name: "tickLower",
2960
- type: "int24",
2961
- internalType: "int24"
2962
- },
2963
- {
2964
- name: "tickUpper",
2965
- type: "int24",
2966
- internalType: "int24"
2967
- },
2968
- {
2969
- name: "prevTickLower",
2970
- type: "int24",
2971
- internalType: "int24"
2972
- },
2973
- {
2974
- name: "totalLiquidity",
2975
- type: "uint128",
2976
- internalType: "uint128"
2977
- },
2978
- {
2979
- name: "borrowedLiquidity",
2980
- type: "uint128",
2981
- internalType: "uint128"
2982
- }
2983
- ],
2984
- stateMutability: "view"
2985
- },
2986
- {
2987
- type: "function",
2988
- name: "blocksCount",
2989
- inputs: [],
2990
- outputs: [{
2991
- name: "",
2992
- type: "uint256",
2993
- internalType: "uint256"
2994
- }],
2995
- stateMutability: "view"
2996
- },
2997
- {
2998
- type: "function",
2999
- name: "borrow",
3000
- inputs: [
3001
- {
3002
- name: "tickLower",
3003
- type: "int24",
3004
- internalType: "int24"
3005
- },
3006
- {
3007
- name: "tickUpper",
3008
- type: "int24",
3009
- internalType: "int24"
3010
- },
3011
- {
3012
- name: "liquidity",
3013
- type: "uint128",
3014
- internalType: "uint128"
3015
- },
3016
- {
3017
- name: "refTick",
3018
- type: "int24",
3019
- internalType: "int24"
3020
- }
3021
- ],
3022
- outputs: [{
3023
- name: "amount0",
3024
- type: "uint256",
3025
- internalType: "uint256"
3026
- }, {
3027
- name: "amount1",
3028
- type: "uint256",
3029
- internalType: "uint256"
3030
- }],
3031
- stateMutability: "nonpayable"
3032
- },
3033
- {
3034
- type: "function",
3035
- name: "borrowerWhitelist",
3036
- inputs: [{
3037
- name: "",
3038
- type: "address",
3039
- internalType: "address"
3040
- }],
3041
- outputs: [{
3042
- name: "",
3043
- type: "bool",
3044
- internalType: "bool"
3045
- }],
3046
- stateMutability: "view"
3047
- },
3048
- {
3049
- type: "function",
3050
- name: "burn",
3051
- inputs: [
3052
- {
3053
- name: "tickLower",
3054
- type: "int24",
3055
- internalType: "int24"
3056
- },
3057
- {
3058
- name: "tickUpper",
3059
- type: "int24",
3060
- internalType: "int24"
3061
- },
3062
- {
3063
- name: "liquidity",
3064
- type: "uint128",
3065
- internalType: "uint128"
3066
- },
3067
- {
3068
- name: "refTick",
3069
- type: "int24",
3070
- internalType: "int24"
3071
- }
3072
- ],
3073
- outputs: [{
3074
- name: "amount0",
3075
- type: "uint256",
3076
- internalType: "uint256"
3077
- }, {
3078
- name: "amount1",
3079
- type: "uint256",
3080
- internalType: "uint256"
3081
- }],
3082
- stateMutability: "nonpayable"
3083
- },
3084
- {
3085
- type: "function",
3086
- name: "collectFees",
3087
- inputs: [{
3088
- name: "tickLower",
3089
- type: "int24",
3090
- internalType: "int24"
3091
- }, {
3092
- name: "tickUpper",
3093
- type: "int24",
3094
- internalType: "int24"
3095
- }],
3096
- outputs: [{
3097
- name: "totalAmount0",
3098
- type: "uint256",
3099
- internalType: "uint256"
3100
- }, {
3101
- name: "totalAmount1",
3102
- type: "uint256",
3103
- internalType: "uint256"
3104
- }],
3105
- stateMutability: "nonpayable"
3106
- },
3107
- {
3108
- type: "function",
3109
- name: "getBlock",
3110
- inputs: [{
3111
- name: "tickLower",
3112
- type: "int24",
3113
- internalType: "int24"
3114
- }, {
3115
- name: "refTick",
3116
- type: "int24",
3117
- internalType: "int24"
3118
- }],
3119
- outputs: [{
3120
- name: "",
3121
- type: "tuple",
3122
- internalType: "struct TimelockVaultCore.LiquidityBlock",
3123
- components: [
3124
- {
3125
- name: "tickLower",
3126
- type: "int24",
3127
- internalType: "int24"
3128
- },
3129
- {
3130
- name: "tickUpper",
3131
- type: "int24",
3132
- internalType: "int24"
3133
- },
3134
- {
3135
- name: "prevTickLower",
3136
- type: "int24",
3137
- internalType: "int24"
3138
- },
3139
- {
3140
- name: "totalLiquidity",
3141
- type: "uint128",
3142
- internalType: "uint128"
3143
- },
3144
- {
3145
- name: "borrowedLiquidity",
3146
- type: "uint128",
3147
- internalType: "uint128"
3148
- }
3149
- ]
3150
- }],
3151
- stateMutability: "view"
3152
- },
3153
- {
3154
- type: "function",
3155
- name: "highestTick",
3156
- inputs: [],
3157
- outputs: [{
3158
- name: "",
3159
- type: "int24",
3160
- internalType: "int24"
3161
- }],
3162
- stateMutability: "view"
3163
- },
3164
- {
3165
- type: "function",
3166
- name: "lowestTick",
3167
- inputs: [],
3168
- outputs: [{
3169
- name: "",
3170
- type: "int24",
3171
- internalType: "int24"
3172
- }],
3173
- stateMutability: "view"
3174
- },
3175
- {
3176
- type: "function",
3177
- name: "mint",
3178
- inputs: [
3179
- {
3180
- name: "tickLower",
3181
- type: "int24",
3182
- internalType: "int24"
3183
- },
3184
- {
3185
- name: "tickUpper",
3186
- type: "int24",
3187
- internalType: "int24"
3188
- },
3189
- {
3190
- name: "liquidity",
3191
- type: "uint128",
3192
- internalType: "uint128"
3193
- },
3194
- {
3195
- name: "refTick",
3196
- type: "int24",
3197
- internalType: "int24"
3198
- }
3199
- ],
3200
- outputs: [{
3201
- name: "amount0",
3202
- type: "uint256",
3203
- internalType: "uint256"
3204
- }, {
3205
- name: "amount1",
3206
- type: "uint256",
3207
- internalType: "uint256"
3208
- }],
3209
- stateMutability: "nonpayable"
3210
- },
3211
- {
3212
- type: "function",
3213
- name: "multicall",
3214
- inputs: [{
3215
- name: "data",
3216
- type: "bytes[]",
3217
- internalType: "bytes[]"
3218
- }],
3219
- outputs: [{
3220
- name: "results",
3221
- type: "bytes[]",
3222
- internalType: "bytes[]"
3223
- }],
3224
- stateMutability: "nonpayable"
3225
- },
3226
- {
3227
- type: "function",
3228
- name: "owner",
3229
- inputs: [],
3230
- outputs: [{
3231
- name: "",
3232
- type: "address",
3233
- internalType: "address"
3234
- }],
3235
- stateMutability: "view"
3236
- },
3237
- {
3238
- type: "function",
3239
- name: "pool",
3240
- inputs: [],
3241
- outputs: [{
3242
- name: "",
3243
- type: "address",
3244
- internalType: "contract IUniswapV3Pool"
3245
- }],
3246
- stateMutability: "view"
3247
- },
3248
- {
3249
- type: "function",
3250
- name: "pool_",
3251
- inputs: [],
3252
- outputs: [{
3253
- name: "",
3254
- type: "address",
3255
- internalType: "contract IUniswapV3Pool"
3256
- }],
3257
- stateMutability: "view"
3258
- },
3259
- {
3260
- type: "function",
3261
- name: "renounceOwnership",
3262
- inputs: [],
3263
- outputs: [],
3264
- stateMutability: "nonpayable"
3265
- },
3266
- {
3267
- type: "function",
3268
- name: "repay",
3269
- inputs: [
3270
- {
3271
- name: "tickLower",
3272
- type: "int24",
3273
- internalType: "int24"
3274
- },
3275
- {
3276
- name: "tickUpper",
3277
- type: "int24",
3278
- internalType: "int24"
3279
- },
3280
- {
3281
- name: "liquidity",
3282
- type: "uint128",
3283
- internalType: "uint128"
3284
- },
3285
- {
3286
- name: "refTick",
3287
- type: "int24",
3288
- internalType: "int24"
3289
- }
3290
- ],
3291
- outputs: [{
3292
- name: "amount0",
3293
- type: "uint256",
3294
- internalType: "uint256"
3295
- }, {
3296
- name: "amount1",
3297
- type: "uint256",
3298
- internalType: "uint256"
3299
- }],
3300
- stateMutability: "nonpayable"
3301
- },
3302
- {
3303
- type: "function",
3304
- name: "tickSpacing",
3305
- inputs: [],
3306
- outputs: [{
3307
- name: "",
3308
- type: "int24",
3309
- internalType: "int24"
3310
- }],
3311
- stateMutability: "view"
3312
- },
3313
- {
3314
- type: "function",
3315
- name: "token0",
3316
- inputs: [],
3317
- outputs: [{
3318
- name: "",
3319
- type: "address",
3320
- internalType: "contract IERC20"
3321
- }],
3322
- stateMutability: "view"
3323
- },
3324
- {
3325
- type: "function",
3326
- name: "token1",
3327
- inputs: [],
3328
- outputs: [{
3329
- name: "",
3330
- type: "address",
3331
- internalType: "contract IERC20"
3332
- }],
3333
- stateMutability: "view"
3334
- },
3335
- {
3336
- type: "function",
3337
- name: "transferOwnership",
3338
- inputs: [{
3339
- name: "newOwner",
3340
- type: "address",
3341
- internalType: "address"
3342
- }],
3343
- outputs: [],
3344
- stateMutability: "nonpayable"
3345
- },
3346
- {
3347
- type: "function",
3348
- name: "uniswapV3MintCallback",
3349
- inputs: [
3350
- {
3351
- name: "amount0",
3352
- type: "uint256",
3353
- internalType: "uint256"
3354
- },
3355
- {
3356
- name: "amount1",
3357
- type: "uint256",
3358
- internalType: "uint256"
3359
- },
3360
- {
3361
- name: "data",
3362
- type: "bytes",
3363
- internalType: "bytes"
3364
- }
3365
- ],
3366
- outputs: [],
3367
- stateMutability: "nonpayable"
3368
- },
3369
- {
3370
- type: "function",
3371
- name: "whitelistBorrower",
3372
- inputs: [{
3373
- name: "borrower",
3374
- type: "address",
3375
- internalType: "address"
3376
- }, {
3377
- name: "status",
3378
- type: "bool",
3379
- internalType: "bool"
3380
- }],
3381
- outputs: [],
3382
- stateMutability: "nonpayable"
3383
- },
3384
- {
3385
- type: "function",
3386
- name: "withdrawTokens",
3387
- inputs: [{
3388
- name: "tokens",
3389
- type: "address[]",
3390
- internalType: "contract IERC20[]"
3391
- }],
3392
- outputs: [],
3393
- stateMutability: "nonpayable"
3394
- },
3395
- {
3396
- type: "event",
3397
- name: "Borrow",
3398
- inputs: [
3399
- {
3400
- name: "user",
3401
- type: "address",
3402
- indexed: false,
3403
- internalType: "address"
3404
- },
3405
- {
3406
- name: "tickLower",
3407
- type: "int24",
3408
- indexed: false,
3409
- internalType: "int24"
3410
- },
3411
- {
3412
- name: "tickUpper",
3413
- type: "int24",
3414
- indexed: false,
3415
- internalType: "int24"
3416
- },
3417
- {
3418
- name: "liquidity",
3419
- type: "uint128",
3420
- indexed: false,
3421
- internalType: "uint128"
3422
- }
3423
- ],
3424
- anonymous: false
3425
- },
3426
- {
3427
- type: "event",
3428
- name: "Burn",
3429
- inputs: [
3430
- {
3431
- name: "user",
3432
- type: "address",
3433
- indexed: false,
3434
- internalType: "address"
3435
- },
3436
- {
3437
- name: "tickLower",
3438
- type: "int24",
3439
- indexed: false,
3440
- internalType: "int24"
3441
- },
3442
- {
3443
- name: "tickUpper",
3444
- type: "int24",
3445
- indexed: false,
3446
- internalType: "int24"
3447
- },
3448
- {
3449
- name: "liquidity",
3450
- type: "uint128",
3451
- indexed: false,
3452
- internalType: "uint128"
3453
- }
3454
- ],
3455
- anonymous: false
3456
- },
3457
- {
3458
- type: "event",
3459
- name: "FeesCollected",
3460
- inputs: [
3461
- {
3462
- name: "feeRecipient",
3463
- type: "address",
3464
- indexed: false,
3465
- internalType: "address"
3466
- },
3467
- {
3468
- name: "amount0",
3469
- type: "uint256",
3470
- indexed: false,
3471
- internalType: "uint256"
3472
- },
3473
- {
3474
- name: "amount1",
3475
- type: "uint256",
3476
- indexed: false,
3477
- internalType: "uint256"
3478
- }
3479
- ],
3480
- anonymous: false
3481
- },
3482
- {
3483
- type: "event",
3484
- name: "Mint",
3485
- inputs: [
3486
- {
3487
- name: "user",
3488
- type: "address",
3489
- indexed: false,
3490
- internalType: "address"
3491
- },
3492
- {
3493
- name: "tickLower",
3494
- type: "int24",
3495
- indexed: false,
3496
- internalType: "int24"
3497
- },
3498
- {
3499
- name: "tickUpper",
3500
- type: "int24",
3501
- indexed: false,
3502
- internalType: "int24"
3503
- },
3504
- {
3505
- name: "liquidity",
3506
- type: "uint128",
3507
- indexed: false,
3508
- internalType: "uint128"
3509
- }
3510
- ],
3511
- anonymous: false
3512
- },
3513
- {
3514
- type: "event",
3515
- name: "OwnershipTransferred",
3516
- inputs: [{
3517
- name: "previousOwner",
3518
- type: "address",
3519
- indexed: true,
3520
- internalType: "address"
3521
- }, {
3522
- name: "newOwner",
3523
- type: "address",
3524
- indexed: true,
3525
- internalType: "address"
3526
- }],
3527
- anonymous: false
3528
- },
3529
- {
3530
- type: "event",
3531
- name: "Repay",
3532
- inputs: [
3533
- {
3534
- name: "user",
3535
- type: "address",
3536
- indexed: false,
3537
- internalType: "address"
3538
- },
3539
- {
3540
- name: "tickLower",
3541
- type: "int24",
3542
- indexed: false,
3543
- internalType: "int24"
3544
- },
3545
- {
3546
- name: "tickUpper",
3547
- type: "int24",
3548
- indexed: false,
3549
- internalType: "int24"
3550
- },
3551
- {
3552
- name: "liquidity",
3553
- type: "uint128",
3554
- indexed: false,
3555
- internalType: "uint128"
3556
- }
3557
- ],
3558
- anonymous: false
3559
- },
3560
- {
3561
- type: "error",
3562
- name: "AddressEmptyCode",
3563
- inputs: [{
3564
- name: "target",
3565
- type: "address",
3566
- internalType: "address"
3567
- }]
3568
- },
3569
- {
3570
- type: "error",
3571
- name: "AmountsMismatch",
3572
- inputs: [
3573
- {
3574
- name: "amount0",
3575
- type: "uint256",
3576
- internalType: "uint256"
3577
- },
3578
- {
3579
- name: "expectedAmount0",
3580
- type: "uint256",
3581
- internalType: "uint256"
3582
- },
3583
- {
3584
- name: "amount1",
3585
- type: "uint256",
3586
- internalType: "uint256"
3587
- },
3588
- {
3589
- name: "expectedAmount1",
3590
- type: "uint256",
3591
- internalType: "uint256"
3592
- }
3593
- ]
3594
- },
3595
- {
3596
- type: "error",
3597
- name: "BorrowerNotWhitelisted",
3598
- inputs: [{
3599
- name: "borrower",
3600
- type: "address",
3601
- internalType: "address"
3602
- }]
3603
- },
3604
- {
3605
- type: "error",
3606
- name: "FailedCall",
3607
- inputs: []
3608
- },
3609
- {
3610
- type: "error",
3611
- name: "InvalidActionType",
3612
- inputs: [{
3613
- name: "actionType",
3614
- type: "uint8",
3615
- internalType: "uint8"
3616
- }]
3617
- },
3618
- {
3619
- type: "error",
3620
- name: "InvalidRefTick",
3621
- inputs: [{
3622
- name: "tickLower",
3623
- type: "int24",
3624
- internalType: "int24"
3625
- }]
3626
- },
3627
- {
3628
- type: "error",
3629
- name: "InvalidTickRange",
3630
- inputs: [{
3631
- name: "tickLower",
3632
- type: "int24",
3633
- internalType: "int24"
3634
- }, {
3635
- name: "tickUpper",
3636
- type: "int24",
3637
- internalType: "int24"
3638
- }]
3639
- },
3640
- {
3641
- type: "error",
3642
- name: "OwnableInvalidOwner",
3643
- inputs: [{
3644
- name: "owner",
3645
- type: "address",
3646
- internalType: "address"
3647
- }]
3648
- },
3649
- {
3650
- type: "error",
3651
- name: "OwnableUnauthorizedAccount",
3652
- inputs: [{
3653
- name: "account",
3654
- type: "address",
3655
- internalType: "address"
3656
- }]
3657
- },
3658
- {
3659
- type: "error",
3660
- name: "ReentrancyGuardReentrantCall",
3661
- inputs: []
3662
- },
3663
- {
3664
- type: "error",
3665
- name: "SafeERC20FailedOperation",
3666
- inputs: [{
3667
- name: "token",
3668
- type: "address",
3669
- internalType: "address"
3670
- }]
3671
- }
3672
- ];
3673
-
3674
- //#endregion
3675
- //#region src/abis/optionsMarket.ts
3676
- const optionsMarketAbi = [
3677
- {
3678
- type: "constructor",
3679
- inputs: [
3680
- {
3681
- name: "_vault",
3682
- type: "address",
3683
- internalType: "contract ITimelockVault"
3684
- },
3685
- {
3686
- name: "_optionPricing",
3687
- type: "address",
3688
- internalType: "contract IOptionPricing"
3689
- },
3690
- {
3691
- name: "_optionAssetIsToken0",
3692
- type: "bool",
3693
- internalType: "bool"
3694
- },
3695
- {
3696
- name: "_swapRouter",
3697
- type: "address",
3698
- internalType: "contract ISwapRouter"
3699
- },
3700
- {
3701
- name: "_quoter",
3702
- type: "address",
3703
- internalType: "contract IQuoter"
3704
- },
3705
- {
3706
- name: "_owner",
3707
- type: "address",
3708
- internalType: "address"
3709
- }
3710
- ],
3711
- stateMutability: "nonpayable"
3712
- },
3713
- {
3714
- type: "function",
3715
- name: "BASIS_POINTS",
3716
- inputs: [],
3717
- outputs: [{
3718
- name: "",
3719
- type: "uint256",
3720
- internalType: "uint256"
3721
- }],
3722
- stateMutability: "view"
3723
- },
3724
- {
3725
- type: "function",
3726
- name: "DUST_THRESHOLD",
3727
- inputs: [],
3728
- outputs: [{
3729
- name: "",
3730
- type: "uint256",
3731
- internalType: "uint256"
3732
- }],
3733
- stateMutability: "view"
3734
- },
3735
- {
3736
- type: "function",
3737
- name: "MAX_STEPS",
3738
- inputs: [],
3739
- outputs: [{
3740
- name: "",
3741
- type: "uint256",
3742
- internalType: "uint256"
3743
- }],
3744
- stateMutability: "view"
3745
- },
3746
- {
3747
- type: "function",
3748
- name: "OPTION_FEE_PERCENT",
3749
- inputs: [],
3750
- outputs: [{
3751
- name: "",
3752
- type: "uint256",
3753
- internalType: "uint256"
3754
- }],
3755
- stateMutability: "view"
3756
- },
3757
- {
3758
- type: "function",
3759
- name: "calculatePremium",
3760
- inputs: [
3761
- {
3762
- name: "optionType",
3763
- type: "uint8",
3764
- internalType: "uint8"
3765
- },
3766
- {
3767
- name: "optionAmount",
3768
- type: "uint256",
3769
- internalType: "uint256"
3770
- },
3771
- {
3772
- name: "strikeTick",
3773
- type: "int24",
3774
- internalType: "int24"
3775
- },
3776
- {
3777
- name: "duration",
3778
- type: "uint64",
3779
- internalType: "uint64"
3780
- }
3781
- ],
3782
- outputs: [{
3783
- name: "",
3784
- type: "uint256",
3785
- internalType: "uint256"
3786
- }],
3787
- stateMutability: "view"
3788
- },
3789
- {
3790
- type: "function",
3791
- name: "exerciseOption",
3792
- inputs: [
3793
- {
3794
- name: "optionId",
3795
- type: "uint256",
3796
- internalType: "uint256"
3797
- },
3798
- {
3799
- name: "liquidities",
3800
- type: "uint128[]",
3801
- internalType: "uint128[]"
3802
- },
3803
- {
3804
- name: "minPayout",
3805
- type: "uint256",
3806
- internalType: "uint256"
3807
- },
3808
- {
3809
- name: "refTick",
3810
- type: "int24",
3811
- internalType: "int24"
3812
- }
3813
- ],
3814
- outputs: [{
3815
- name: "payout",
3816
- type: "uint256",
3817
- internalType: "uint256"
3818
- }],
3819
- stateMutability: "nonpayable"
3820
- },
3821
- {
3822
- type: "function",
3823
- name: "getOption",
3824
- inputs: [{
3825
- name: "optionId",
3826
- type: "uint256",
3827
- internalType: "uint256"
3828
- }],
3829
- outputs: [{
3830
- name: "",
3831
- type: "tuple",
3832
- internalType: "struct TimelockOptionsMarket.OptionData",
3833
- components: [
3834
- {
3835
- name: "owner",
3836
- type: "address",
3837
- internalType: "address"
3838
- },
3839
- {
3840
- name: "optionType",
3841
- type: "uint8",
3842
- internalType: "uint8"
3843
- },
3844
- {
3845
- name: "strikeTick",
3846
- type: "int24",
3847
- internalType: "int24"
3848
- },
3849
- {
3850
- name: "entryTick",
3851
- type: "int24",
3852
- internalType: "int24"
3853
- },
3854
- {
3855
- name: "expiresAt",
3856
- type: "uint64",
3857
- internalType: "uint64"
3858
- },
3859
- {
3860
- name: "createdAt",
3861
- type: "uint64",
3862
- internalType: "uint64"
3863
- },
3864
- {
3865
- name: "premiumPaid",
3866
- type: "uint128",
3867
- internalType: "uint128"
3868
- },
3869
- {
3870
- name: "liquidities",
3871
- type: "uint128[]",
3872
- internalType: "uint128[]"
3873
- }
3874
- ]
3875
- }],
3876
- stateMutability: "view"
3877
- },
3878
- {
3879
- type: "function",
3880
- name: "liquiditiesToAmounts",
3881
- inputs: [
3882
- {
3883
- name: "leftTick",
3884
- type: "int24",
3885
- internalType: "int24"
3886
- },
3887
- {
3888
- name: "liquidities",
3889
- type: "uint128[]",
3890
- internalType: "uint128[]"
3891
- },
3892
- {
3893
- name: "optionType",
3894
- type: "uint8",
3895
- internalType: "uint8"
3896
- }
3897
- ],
3898
- outputs: [
3899
- {
3900
- name: "optionAssetToRepay",
3901
- type: "uint256",
3902
- internalType: "uint256"
3903
- },
3904
- {
3905
- name: "payoutAssetToRepay",
3906
- type: "uint256",
3907
- internalType: "uint256"
3908
- },
3909
- {
3910
- name: "optionAssetBorrowed",
3911
- type: "uint256",
3912
- internalType: "uint256"
3913
- },
3914
- {
3915
- name: "payoutAssetBorrowed",
3916
- type: "uint256",
3917
- internalType: "uint256"
3918
- }
3919
- ],
3920
- stateMutability: "view"
3921
- },
3922
- {
3923
- type: "function",
3924
- name: "maxDuration",
3925
- inputs: [],
3926
- outputs: [{
3927
- name: "",
3928
- type: "uint64",
3929
- internalType: "uint64"
3930
- }],
3931
- stateMutability: "view"
3932
- },
3933
- {
3934
- type: "function",
3935
- name: "maxOptionAmount",
3936
- inputs: [],
3937
- outputs: [{
3938
- name: "",
3939
- type: "uint256",
3940
- internalType: "uint256"
3941
- }],
3942
- stateMutability: "view"
3943
- },
3944
- {
3945
- type: "function",
3946
- name: "minDuration",
3947
- inputs: [],
3948
- outputs: [{
3949
- name: "",
3950
- type: "uint64",
3951
- internalType: "uint64"
3952
- }],
3953
- stateMutability: "view"
3954
- },
3955
- {
3956
- type: "function",
3957
- name: "minOptionAmount",
3958
- inputs: [],
3959
- outputs: [{
3960
- name: "",
3961
- type: "uint256",
3962
- internalType: "uint256"
3963
- }],
3964
- stateMutability: "view"
3965
- },
3966
- {
3967
- type: "function",
3968
- name: "mintOption",
3969
- inputs: [
3970
- {
3971
- name: "optionType",
3972
- type: "uint8",
3973
- internalType: "uint8"
3974
- },
3975
- {
3976
- name: "amount",
3977
- type: "uint256",
3978
- internalType: "uint256"
3979
- },
3980
- {
3981
- name: "strikeTick",
3982
- type: "int24",
3983
- internalType: "int24"
3984
- },
3985
- {
3986
- name: "duration",
3987
- type: "uint64",
3988
- internalType: "uint64"
3989
- },
3990
- {
3991
- name: "maxPremium",
3992
- type: "uint256",
3993
- internalType: "uint256"
3994
- },
3995
- {
3996
- name: "refTick",
3997
- type: "int24",
3998
- internalType: "int24"
3999
- }
4000
- ],
4001
- outputs: [
4002
- {
4003
- name: "optionId",
4004
- type: "uint256",
4005
- internalType: "uint256"
4006
- },
4007
- {
4008
- name: "finalAmount",
4009
- type: "uint256",
4010
- internalType: "uint256"
4011
- },
4012
- {
4013
- name: "totalPremium",
4014
- type: "uint256",
4015
- internalType: "uint256"
4016
- }
4017
- ],
4018
- stateMutability: "nonpayable"
4019
- },
4020
- {
4021
- type: "function",
4022
- name: "nextOptionId",
4023
- inputs: [],
4024
- outputs: [{
4025
- name: "",
4026
- type: "uint256",
4027
- internalType: "uint256"
4028
- }],
4029
- stateMutability: "view"
4030
- },
4031
- {
4032
- type: "function",
4033
- name: "optionAsset",
4034
- inputs: [],
4035
- outputs: [{
4036
- name: "",
4037
- type: "address",
4038
- internalType: "contract IERC20"
4039
- }],
4040
- stateMutability: "view"
4041
- },
4042
- {
4043
- type: "function",
4044
- name: "optionAssetIsToken0",
4045
- inputs: [],
4046
- outputs: [{
4047
- name: "",
4048
- type: "bool",
4049
- internalType: "bool"
4050
- }],
4051
- stateMutability: "view"
4052
- },
4053
- {
4054
- type: "function",
4055
- name: "optionPricing",
4056
- inputs: [],
4057
- outputs: [{
4058
- name: "",
4059
- type: "address",
4060
- internalType: "contract IOptionPricing"
4061
- }],
4062
- stateMutability: "view"
4063
- },
4064
- {
4065
- type: "function",
4066
- name: "owner",
4067
- inputs: [],
4068
- outputs: [{
4069
- name: "",
4070
- type: "address",
4071
- internalType: "address"
4072
- }],
4073
- stateMutability: "view"
4074
- },
4075
- {
4076
- type: "function",
4077
- name: "payoutAsset",
4078
- inputs: [],
4079
- outputs: [{
4080
- name: "",
4081
- type: "address",
4082
- internalType: "contract IERC20"
4083
- }],
4084
- stateMutability: "view"
4085
- },
4086
- {
4087
- type: "function",
4088
- name: "pool",
4089
- inputs: [],
4090
- outputs: [{
4091
- name: "",
4092
- type: "address",
4093
- internalType: "contract IUniswapV3Pool"
4094
- }],
4095
- stateMutability: "view"
4096
- },
4097
- {
4098
- type: "function",
4099
- name: "protocolFees",
4100
- inputs: [],
4101
- outputs: [{
4102
- name: "",
4103
- type: "uint256",
4104
- internalType: "uint256"
4105
- }],
4106
- stateMutability: "view"
4107
- },
4108
- {
4109
- type: "function",
4110
- name: "quoter",
4111
- inputs: [],
4112
- outputs: [{
4113
- name: "",
4114
- type: "address",
4115
- internalType: "contract IQuoter"
4116
- }],
4117
- stateMutability: "view"
4118
- },
4119
- {
4120
- type: "function",
4121
- name: "renounceOwnership",
4122
- inputs: [],
4123
- outputs: [],
4124
- stateMutability: "nonpayable"
4125
- },
4126
- {
4127
- type: "function",
4128
- name: "swapRouter",
4129
- inputs: [],
4130
- outputs: [{
4131
- name: "",
4132
- type: "address",
4133
- internalType: "contract ISwapRouter"
4134
- }],
4135
- stateMutability: "view"
4136
- },
4137
- {
4138
- type: "function",
4139
- name: "tickSpacing",
4140
- inputs: [],
4141
- outputs: [{
4142
- name: "",
4143
- type: "int24",
4144
- internalType: "int24"
4145
- }],
4146
- stateMutability: "view"
4147
- },
4148
- {
4149
- type: "function",
4150
- name: "token0",
4151
- inputs: [],
4152
- outputs: [{
4153
- name: "",
4154
- type: "address",
4155
- internalType: "contract IERC20"
4156
- }],
4157
- stateMutability: "view"
4158
- },
4159
- {
4160
- type: "function",
4161
- name: "token1",
4162
- inputs: [],
4163
- outputs: [{
4164
- name: "",
4165
- type: "address",
4166
- internalType: "contract IERC20"
4167
- }],
4168
- stateMutability: "view"
4169
- },
4170
- {
4171
- type: "function",
4172
- name: "transferOwnership",
4173
- inputs: [{
4174
- name: "newOwner",
4175
- type: "address",
4176
- internalType: "address"
4177
- }],
4178
- outputs: [],
4179
- stateMutability: "nonpayable"
4180
- },
4181
- {
4182
- type: "function",
4183
- name: "updateDurationBounds",
4184
- inputs: [{
4185
- name: "_minDuration",
4186
- type: "uint64",
4187
- internalType: "uint64"
4188
- }, {
4189
- name: "_maxDuration",
4190
- type: "uint64",
4191
- internalType: "uint64"
4192
- }],
4193
- outputs: [],
4194
- stateMutability: "nonpayable"
4195
- },
4196
- {
4197
- type: "function",
4198
- name: "updateOptionAmountBounds",
4199
- inputs: [{
4200
- name: "_minOptionAmount",
4201
- type: "uint256",
4202
- internalType: "uint256"
4203
- }, {
4204
- name: "_maxOptionAmount",
4205
- type: "uint256",
4206
- internalType: "uint256"
4207
- }],
4208
- outputs: [],
4209
- stateMutability: "nonpayable"
4210
- },
4211
- {
4212
- type: "function",
4213
- name: "vault",
4214
- inputs: [],
4215
- outputs: [{
4216
- name: "",
4217
- type: "address",
4218
- internalType: "contract ITimelockVault"
4219
- }],
4220
- stateMutability: "view"
4221
- },
4222
- {
4223
- type: "function",
4224
- name: "withdrawTokens",
4225
- inputs: [{
4226
- name: "tokens",
4227
- type: "address[]",
4228
- internalType: "contract IERC20[]"
4229
- }],
4230
- outputs: [],
4231
- stateMutability: "nonpayable"
4232
- },
4233
- {
4234
- type: "event",
4235
- name: "ExerciseOption",
4236
- inputs: [
4237
- {
4238
- name: "optionId",
4239
- type: "uint256",
4240
- indexed: true,
4241
- internalType: "uint256"
4242
- },
4243
- {
4244
- name: "owner",
4245
- type: "address",
4246
- indexed: true,
4247
- internalType: "address"
4248
- },
4249
- {
4250
- name: "liquidities",
4251
- type: "uint128[]",
4252
- indexed: false,
4253
- internalType: "uint128[]"
4254
- },
4255
- {
4256
- name: "payout",
4257
- type: "uint256",
4258
- indexed: false,
4259
- internalType: "uint256"
4260
- }
4261
- ],
4262
- anonymous: false
4263
- },
4264
- {
4265
- type: "event",
4266
- name: "FeesWithdrawn",
4267
- inputs: [{
4268
- name: "fees0",
4269
- type: "uint256",
4270
- indexed: false,
4271
- internalType: "uint256"
4272
- }, {
4273
- name: "fees1",
4274
- type: "uint256",
4275
- indexed: false,
4276
- internalType: "uint256"
4277
- }],
4278
- anonymous: false
4279
- },
4280
- {
4281
- type: "event",
4282
- name: "MintOption",
4283
- inputs: [
4284
- {
4285
- name: "optionId",
4286
- type: "uint256",
4287
- indexed: true,
4288
- internalType: "uint256"
4289
- },
4290
- {
4291
- name: "buyer",
4292
- type: "address",
4293
- indexed: true,
4294
- internalType: "address"
4295
- },
4296
- {
4297
- name: "optionType",
4298
- type: "uint8",
4299
- indexed: false,
4300
- internalType: "uint8"
4301
- },
4302
- {
4303
- name: "strikeTick",
4304
- type: "int24",
4305
- indexed: false,
4306
- internalType: "int24"
4307
- },
4308
- {
4309
- name: "currentTick",
4310
- type: "int24",
4311
- indexed: false,
4312
- internalType: "int24"
4313
- },
4314
- {
4315
- name: "expiresAt",
4316
- type: "uint64",
4317
- indexed: false,
4318
- internalType: "uint64"
4319
- },
4320
- {
4321
- name: "timestamp",
4322
- type: "uint64",
4323
- indexed: false,
4324
- internalType: "uint64"
4325
- },
4326
- {
4327
- name: "totalPremium",
4328
- type: "uint128",
4329
- indexed: false,
4330
- internalType: "uint128"
4331
- },
4332
- {
4333
- name: "liquidities",
4334
- type: "uint128[]",
4335
- indexed: false,
4336
- internalType: "uint128[]"
4337
- }
4338
- ],
4339
- anonymous: false
4340
- },
4341
- {
4342
- type: "event",
4343
- name: "OwnershipTransferred",
4344
- inputs: [{
4345
- name: "previousOwner",
4346
- type: "address",
4347
- indexed: true,
4348
- internalType: "address"
4349
- }, {
4350
- name: "newOwner",
4351
- type: "address",
4352
- indexed: true,
4353
- internalType: "address"
4354
- }],
4355
- anonymous: false
4356
- },
4357
- {
4358
- type: "error",
4359
- name: "AmountOutOfBounds",
4360
- inputs: []
4361
- },
4362
- {
4363
- type: "error",
4364
- name: "DurationOutOfBounds",
4365
- inputs: []
4366
- },
4367
- {
4368
- type: "error",
4369
- name: "InsufficientLiquidity",
4370
- inputs: []
4371
- },
4372
- {
4373
- type: "error",
4374
- name: "InvalidArrayLength",
4375
- inputs: []
4376
- },
4377
- {
4378
- type: "error",
4379
- name: "InvalidOptionType",
4380
- inputs: []
4381
- },
4382
- {
4383
- type: "error",
4384
- name: "InvalidTickRange",
4385
- inputs: [{
4386
- name: "tickLower",
4387
- type: "int24",
4388
- internalType: "int24"
4389
- }, {
4390
- name: "tickUpper",
4391
- type: "int24",
4392
- internalType: "int24"
4393
- }]
4394
- },
4395
- {
4396
- type: "error",
4397
- name: "NotEnoughPayout",
4398
- inputs: []
4399
- },
4400
- {
4401
- type: "error",
4402
- name: "NotOptionOwner",
4403
- inputs: []
4404
- },
4405
- {
4406
- type: "error",
4407
- name: "OptionExpired",
4408
- inputs: []
4409
- },
4410
- {
4411
- type: "error",
4412
- name: "OptionNotFound",
4413
- inputs: []
4414
- },
4415
- {
4416
- type: "error",
4417
- name: "OwnableInvalidOwner",
4418
- inputs: [{
4419
- name: "owner",
4420
- type: "address",
4421
- internalType: "address"
4422
- }]
4423
- },
4424
- {
4425
- type: "error",
4426
- name: "OwnableUnauthorizedAccount",
4427
- inputs: [{
4428
- name: "account",
4429
- type: "address",
4430
- internalType: "address"
4431
- }]
4432
- },
4433
- {
4434
- type: "error",
4435
- name: "PremiumTooHigh",
4436
- inputs: []
4437
- },
4438
- {
4439
- type: "error",
4440
- name: "ReentrancyGuardReentrantCall",
4441
- inputs: []
4442
- },
4443
- {
4444
- type: "error",
4445
- name: "SafeERC20FailedOperation",
4446
- inputs: [{
4447
- name: "token",
4448
- type: "address",
4449
- internalType: "address"
4450
- }]
4451
- }
4452
- ];
4453
-
4454
- //#endregion
4455
- //#region src/lib/contracts.ts
4456
- const getErc20 = (address, client) => (0, viem.getContract)({
4457
- abi: erc20Abi,
4458
- address,
4459
- client
4460
- });
4461
- const getTimelockVault = (address, client) => {
4462
- return (0, viem.getContract)({
4463
- abi: singleOwnerVaultAbi,
4464
- address,
4465
- client
4466
- });
4467
- };
4468
- const getTimelockMarket = (address, client) => {
4469
- return (0, viem.getContract)({
4470
- abi: optionsMarketAbi,
4471
- address,
4472
- client
4473
- });
4474
- };
4475
- const getUniswapPool = (address, client) => {
4476
- return (0, viem.getContract)({
4477
- abi: uniswapV3PoolAbi,
4478
- address,
4479
- client
4480
- });
4481
- };
4482
- const getUniswapMathLens = (client) => (0, viem.getContract)({
4483
- abi: uniswapMathLensAbi,
4484
- address: uniswapMathLenses[client.chain.id],
4485
- client
4486
- });
4487
- const getTimelockLens = (client) => (0, viem.getContract)({
4488
- abi: lensAbi,
4489
- address: timelockLenses[client.chain.id],
4490
- client
4491
- });
4492
- const timelockLenses = { [viem_chains.monadTestnet.id]: "0x97558b2ccb55F88118989BC19FCEa7AFa13F71b9" };
4493
- const uniswapMathLenses = { [viem_chains.monadTestnet.id]: "0x4C8375D1F6D5F452e92e211C1D3E7a44F78dFc95" };
4494
-
4495
- //#endregion
4496
- //#region src/lib/liquidityUtils.ts
4497
- const PRICE_PRECISION = BigInt(0xde0b6b3a7640000);
4498
- const getPriceAtTick = (tick) => {
4499
- const sqrtRatioX96 = BigInt(__uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tick).toString());
4500
- return sqrtRatioX96 * sqrtRatioX96 * PRICE_PRECISION / BigInt(2 ** 192);
4501
- };
4502
- const getTickAtPrice = (price) => {
4503
- const priceX192 = price * BigInt(2 ** 192) / PRICE_PRECISION;
4504
- const sqrtPriceX96 = jsbi.default.BigInt(new big_js.default(priceX192.toString()).sqrt().toFixed(0));
4505
- return __uniswap_v3_sdk.TickMath.getTickAtSqrtRatio(sqrtPriceX96);
4506
- };
4507
- const roundTickDown = (tick, spacing) => {
4508
- const rem = tick % spacing;
4509
- if (rem >= 0) return tick - rem;
4510
- return tick - rem - spacing;
4511
- };
4512
- const roundTickUp = (tick, spacing) => {
4513
- const rem = tick % spacing;
4514
- if (rem === 0) return tick;
4515
- if (rem > 0) return tick - rem + spacing;
4516
- return tick - rem;
4517
- };
4518
- const token0ToToken1 = (amount0, tick) => {
4519
- return amount0 * getPriceAtTick(tick) / PRICE_PRECISION;
4520
- };
4521
- const token1ToToken0 = (amount1, tick) => {
4522
- const price = getPriceAtTick(tick);
4523
- return amount1 * PRICE_PRECISION / price;
4524
- };
4525
- const liquiditiesToAmount0 = (liquidities, startTick, tickSpacing) => {
4526
- let amount0 = BigInt(0);
4527
- for (let i = 0; i < liquidities.length; i++) {
4528
- const liquidity = liquidities[i];
4529
- if (liquidity === BigInt(0)) continue;
4530
- const tickLower = startTick + tickSpacing * i;
4531
- const tickUpper = tickLower + tickSpacing;
4532
- const sqrtRatioAX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tickLower);
4533
- const sqrtRatioBX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tickUpper);
4534
- const liquidityJSBI = jsbi.default.BigInt(liquidity.toString());
4535
- const amount0Delta = __uniswap_v3_sdk.SqrtPriceMath.getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, liquidityJSBI, false);
4536
- amount0 += BigInt(amount0Delta.toString());
4537
- }
4538
- return amount0;
4539
- };
4540
- const liquiditiesToAmount1 = (liquidities, startTick, tickSpacing) => {
4541
- let amount1 = BigInt(0);
4542
- for (let i = 0; i < liquidities.length; i++) {
4543
- const liquidity = liquidities[i];
4544
- if (liquidity === BigInt(0)) continue;
4545
- const tickLower = startTick + tickSpacing * i;
4546
- const tickUpper = tickLower + tickSpacing;
4547
- const sqrtRatioAX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tickLower);
4548
- const sqrtRatioBX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tickUpper);
4549
- const liquidityJSBI = jsbi.default.BigInt(liquidity.toString());
4550
- const amount1Delta = __uniswap_v3_sdk.SqrtPriceMath.getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, liquidityJSBI, false);
4551
- amount1 += BigInt(amount1Delta.toString());
4552
- }
4553
- return amount1;
4554
- };
4555
- const liquiditiesToAmounts = (liquidities, startTick, currentTick, tickSpacing) => {
4556
- let amount0 = 0n;
4557
- let amount1 = 0n;
4558
- const sqrtRatioX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(currentTick);
4559
- for (let i = 0; i < liquidities.length; i++) {
4560
- const liquidity = liquidities[i];
4561
- if (liquidity === BigInt(0)) continue;
4562
- const tickLower = startTick + tickSpacing * i;
4563
- const tickUpper = tickLower + tickSpacing;
4564
- const sqrtRatioAX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tickLower);
4565
- const sqrtRatioBX96 = __uniswap_v3_sdk.TickMath.getSqrtRatioAtTick(tickUpper);
4566
- const liquidityJSBI = jsbi.default.BigInt(liquidity.toString());
4567
- if (currentTick < tickLower) {
4568
- const delta0 = __uniswap_v3_sdk.SqrtPriceMath.getAmount0Delta(sqrtRatioAX96, sqrtRatioBX96, liquidityJSBI, false);
4569
- amount0 += BigInt(delta0.toString());
4570
- } else if (currentTick >= tickUpper) {
4571
- const delta1 = __uniswap_v3_sdk.SqrtPriceMath.getAmount1Delta(sqrtRatioAX96, sqrtRatioBX96, liquidityJSBI, false);
4572
- amount1 += BigInt(delta1.toString());
4573
- } else {
4574
- const delta0 = __uniswap_v3_sdk.SqrtPriceMath.getAmount0Delta(sqrtRatioX96, sqrtRatioBX96, liquidityJSBI, false);
4575
- const delta1 = __uniswap_v3_sdk.SqrtPriceMath.getAmount1Delta(sqrtRatioAX96, sqrtRatioX96, liquidityJSBI, false);
4576
- amount0 += BigInt(delta0.toString());
4577
- amount1 += BigInt(delta1.toString());
4578
- }
4579
- }
4580
- return [amount0, amount1];
4581
- };
4582
-
4583
- //#endregion
4584
- //#region src/lib/numberUtils.ts
4585
- const zero = {
4586
- scaled: 0n,
4587
- unscaled: (0, big_js.default)(0),
4588
- decimals: 18,
4589
- formatted: "0"
4590
- };
4591
- const wrapAmount = (scaled, decimals) => {
4592
- const unscaled = unscaleAmount(scaled, decimals);
4593
- return {
4594
- scaled,
4595
- unscaled,
4596
- decimals,
4597
- formatted: formatAmount(unscaled)
4598
- };
4599
- };
4600
- const wrapAmountUnscaled = (unscaled, decimals) => {
4601
- unscaled = (0, big_js.default)(unscaled);
4602
- const scaled = scaleAmount(unscaled, decimals);
4603
- const formatted = formatAmount(unscaled);
4604
- return {
4605
- scaled,
4606
- unscaled,
4607
- decimals,
4608
- formatted
4609
- };
4610
- };
4611
- const wrapPrice = (scaled, decimals0, decimals1) => {
4612
- const unscaled = unscalePrice(scaled, decimals0, decimals1);
4613
- const formatted = formatAmount(unscaled);
4614
- return {
4615
- scaled,
4616
- unscaled,
4617
- decimals: 36 + decimals1 - decimals0,
4618
- formatted
4619
- };
4620
- };
4621
- const wrapPriceUnscaled = (unscaled, decimals0, decimals1) => {
4622
- unscaled = (0, big_js.default)(unscaled);
4623
- const scaled = scalePrice(unscaled, decimals0, decimals1);
4624
- const formatted = formatAmount(unscaled);
4625
- return {
4626
- scaled,
4627
- unscaled,
4628
- decimals: 36 + decimals1 - decimals0,
4629
- formatted
4630
- };
4631
- };
4632
- const unscaleAmount = (scaled, decimals) => {
4633
- return new big_js.default(scaled.toString()).div(new big_js.default(10).pow(decimals));
4634
- };
4635
- const scaleAmount = (unscaled, decimals) => {
4636
- return BigInt((0, big_js.default)(unscaled).mul(new big_js.default(10).pow(decimals)).round().toFixed(0));
4637
- };
4638
- const unscalePrice = (scaled, decimals0, decimals1, precision = 18) => {
4639
- return new big_js.default(scaled.toString()).mul(new big_js.default(10).pow(decimals0)).div(new big_js.default(10).pow(decimals1)).div(new big_js.default(10).pow(precision));
4640
- };
4641
- const scalePrice = (unscaled, decimals0, decimals1, precision = 18) => {
4642
- return BigInt((0, big_js.default)(unscaled).mul(new big_js.default(10).pow(precision)).mul(new big_js.default(10).pow(decimals1)).div(new big_js.default(10).pow(decimals0)).round().toFixed(0));
4643
- };
4644
- const formatAmount = (value) => {
4645
- if (value === void 0) return "-";
4646
- return formatCondensed((0, big_js.default)(value).toFixed(100));
4647
- };
4648
- const formatVagueAmount = (value) => {
4649
- value = Number(value);
4650
- if (value >= 0xe8d4a51000) return `${(value / 0xe8d4a51000).toFixed(2)}T`;
4651
- else if (value >= 1e9) return `${(value / 1e9).toFixed(2)}B`;
4652
- else if (value >= 1e6) return `${(value / 1e6).toFixed(2)}M`;
4653
- else if (value >= 1e3) return `${(value / 1e3).toFixed(2)}K`;
4654
- else if (value < 1) return value.toPrecision(2);
4655
- else return value.toFixed(2);
4656
- };
4657
- const formatCondensed = (input, decimals = 2) => {
4658
- const [whole, decimal] = (typeof input === "number" ? input.toFixed(20) : input).replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "").split(".");
4659
- const formattedWhole = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
4660
- if (!decimal) return formattedWhole;
4661
- const leadingZeroMatch = decimal.match(/^(0{3,})/);
4662
- if (leadingZeroMatch) {
4663
- const zeroCount = leadingZeroMatch[1].length;
4664
- return `${formattedWhole}.0${toSubscript(zeroCount.toString())}${decimal.slice(zeroCount).slice(0, decimals)}`;
4665
- } else {
4666
- const nonZeroStart = decimal.search(/[1-9]/);
4667
- if (nonZeroStart === -1) return formattedWhole;
4668
- const twoDigits = decimal.slice(nonZeroStart).slice(0, decimals);
4669
- return `${formattedWhole}.${decimal.slice(0, nonZeroStart)}${twoDigits}`;
4670
- }
4671
- };
4672
- const toSubscript = (input) => {
4673
- return input.replace(/[0-9]/g, (m) => "₀₁₂₃₄₅₆₇₈₉"[+m]);
4674
- };
4675
- const formatUSD = (value) => {
4676
- return "$" + formatAmount(value);
4677
- };
4678
-
4679
- //#endregion
4680
- Object.defineProperty(exports, 'PRICE_PRECISION', {
4681
- enumerable: true,
4682
- get: function () {
4683
- return PRICE_PRECISION;
4684
- }
4685
- });
4686
- Object.defineProperty(exports, '__toESM', {
4687
- enumerable: true,
4688
- get: function () {
4689
- return __toESM;
4690
- }
4691
- });
4692
- Object.defineProperty(exports, 'erc20Abi', {
4693
- enumerable: true,
4694
- get: function () {
4695
- return erc20Abi;
4696
- }
4697
- });
4698
- Object.defineProperty(exports, 'formatAmount', {
4699
- enumerable: true,
4700
- get: function () {
4701
- return formatAmount;
4702
- }
4703
- });
4704
- Object.defineProperty(exports, 'formatCondensed', {
4705
- enumerable: true,
4706
- get: function () {
4707
- return formatCondensed;
4708
- }
4709
- });
4710
- Object.defineProperty(exports, 'formatUSD', {
4711
- enumerable: true,
4712
- get: function () {
4713
- return formatUSD;
4714
- }
4715
- });
4716
- Object.defineProperty(exports, 'formatVagueAmount', {
4717
- enumerable: true,
4718
- get: function () {
4719
- return formatVagueAmount;
4720
- }
4721
- });
4722
- Object.defineProperty(exports, 'getErc20', {
4723
- enumerable: true,
4724
- get: function () {
4725
- return getErc20;
4726
- }
4727
- });
4728
- Object.defineProperty(exports, 'getPriceAtTick', {
4729
- enumerable: true,
4730
- get: function () {
4731
- return getPriceAtTick;
4732
- }
4733
- });
4734
- Object.defineProperty(exports, 'getTickAtPrice', {
4735
- enumerable: true,
4736
- get: function () {
4737
- return getTickAtPrice;
4738
- }
4739
- });
4740
- Object.defineProperty(exports, 'getTimelockLens', {
4741
- enumerable: true,
4742
- get: function () {
4743
- return getTimelockLens;
4744
- }
4745
- });
4746
- Object.defineProperty(exports, 'getTimelockMarket', {
4747
- enumerable: true,
4748
- get: function () {
4749
- return getTimelockMarket;
4750
- }
4751
- });
4752
- Object.defineProperty(exports, 'getTimelockVault', {
4753
- enumerable: true,
4754
- get: function () {
4755
- return getTimelockVault;
4756
- }
4757
- });
4758
- Object.defineProperty(exports, 'getUniswapMathLens', {
4759
- enumerable: true,
4760
- get: function () {
4761
- return getUniswapMathLens;
4762
- }
4763
- });
4764
- Object.defineProperty(exports, 'getUniswapPool', {
4765
- enumerable: true,
4766
- get: function () {
4767
- return getUniswapPool;
4768
- }
4769
- });
4770
- Object.defineProperty(exports, 'lensAbi', {
4771
- enumerable: true,
4772
- get: function () {
4773
- return lensAbi;
4774
- }
4775
- });
4776
- Object.defineProperty(exports, 'liquiditiesToAmount0', {
4777
- enumerable: true,
4778
- get: function () {
4779
- return liquiditiesToAmount0;
4780
- }
4781
- });
4782
- Object.defineProperty(exports, 'liquiditiesToAmount1', {
4783
- enumerable: true,
4784
- get: function () {
4785
- return liquiditiesToAmount1;
4786
- }
4787
- });
4788
- Object.defineProperty(exports, 'liquiditiesToAmounts', {
4789
- enumerable: true,
4790
- get: function () {
4791
- return liquiditiesToAmounts;
4792
- }
4793
- });
4794
- Object.defineProperty(exports, 'optionsMarketAbi', {
4795
- enumerable: true,
4796
- get: function () {
4797
- return optionsMarketAbi;
4798
- }
4799
- });
4800
- Object.defineProperty(exports, 'roundTickDown', {
4801
- enumerable: true,
4802
- get: function () {
4803
- return roundTickDown;
4804
- }
4805
- });
4806
- Object.defineProperty(exports, 'roundTickUp', {
4807
- enumerable: true,
4808
- get: function () {
4809
- return roundTickUp;
4810
- }
4811
- });
4812
- Object.defineProperty(exports, 'scaleAmount', {
4813
- enumerable: true,
4814
- get: function () {
4815
- return scaleAmount;
4816
- }
4817
- });
4818
- Object.defineProperty(exports, 'scalePrice', {
4819
- enumerable: true,
4820
- get: function () {
4821
- return scalePrice;
4822
- }
4823
- });
4824
- Object.defineProperty(exports, 'singleOwnerVaultAbi', {
4825
- enumerable: true,
4826
- get: function () {
4827
- return singleOwnerVaultAbi;
4828
- }
4829
- });
4830
- Object.defineProperty(exports, 'timelockLenses', {
4831
- enumerable: true,
4832
- get: function () {
4833
- return timelockLenses;
4834
- }
4835
- });
4836
- Object.defineProperty(exports, 'token0ToToken1', {
4837
- enumerable: true,
4838
- get: function () {
4839
- return token0ToToken1;
4840
- }
4841
- });
4842
- Object.defineProperty(exports, 'token1ToToken0', {
4843
- enumerable: true,
4844
- get: function () {
4845
- return token1ToToken0;
4846
- }
4847
- });
4848
- Object.defineProperty(exports, 'uniswapMathLensAbi', {
4849
- enumerable: true,
4850
- get: function () {
4851
- return uniswapMathLensAbi;
4852
- }
4853
- });
4854
- Object.defineProperty(exports, 'uniswapMathLenses', {
4855
- enumerable: true,
4856
- get: function () {
4857
- return uniswapMathLenses;
4858
- }
4859
- });
4860
- Object.defineProperty(exports, 'uniswapV3PoolAbi', {
4861
- enumerable: true,
4862
- get: function () {
4863
- return uniswapV3PoolAbi;
4864
- }
4865
- });
4866
- Object.defineProperty(exports, 'unscaleAmount', {
4867
- enumerable: true,
4868
- get: function () {
4869
- return unscaleAmount;
4870
- }
4871
- });
4872
- Object.defineProperty(exports, 'unscalePrice', {
4873
- enumerable: true,
4874
- get: function () {
4875
- return unscalePrice;
4876
- }
4877
- });
4878
- Object.defineProperty(exports, 'wrapAmount', {
4879
- enumerable: true,
4880
- get: function () {
4881
- return wrapAmount;
4882
- }
4883
- });
4884
- Object.defineProperty(exports, 'wrapAmountUnscaled', {
4885
- enumerable: true,
4886
- get: function () {
4887
- return wrapAmountUnscaled;
4888
- }
4889
- });
4890
- Object.defineProperty(exports, 'wrapPrice', {
4891
- enumerable: true,
4892
- get: function () {
4893
- return wrapPrice;
4894
- }
4895
- });
4896
- Object.defineProperty(exports, 'wrapPriceUnscaled', {
4897
- enumerable: true,
4898
- get: function () {
4899
- return wrapPriceUnscaled;
4900
- }
4901
- });
4902
- Object.defineProperty(exports, 'zero', {
4903
- enumerable: true,
4904
- get: function () {
4905
- return zero;
4906
- }
4907
- });