@longdotxyz/shared 0.0.13 → 0.0.14
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.
- package/dist/contracts/index.d.ts +117 -117
- package/dist/contracts/quote.contract.d.ts +117 -117
- package/dist/contracts/quote.contract.js +31 -31
- package/dist/contracts/quote.contract.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +51 -22
|
@@ -401,8 +401,8 @@ export declare const rootContract: {
|
|
|
401
401
|
v4ExactOutputSingle: {
|
|
402
402
|
method: "POST";
|
|
403
403
|
body: import("zod").ZodObject<{
|
|
404
|
-
|
|
405
|
-
|
|
404
|
+
chain_id: import("zod").ZodNumber;
|
|
405
|
+
pool_key: import("zod").ZodObject<{
|
|
406
406
|
currency0: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
407
407
|
currency1: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
408
408
|
fee: import("zod").ZodNumber;
|
|
@@ -421,56 +421,56 @@ export declare const rootContract: {
|
|
|
421
421
|
tickSpacing: number;
|
|
422
422
|
hooks: string;
|
|
423
423
|
}>;
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
424
|
+
zero_for_one: import("zod").ZodBoolean;
|
|
425
|
+
exact_amount: import("zod").ZodEffects<import("zod").ZodAny, bigint, any>;
|
|
426
|
+
hook_data: import("zod").ZodOptional<import("zod").ZodString>;
|
|
427
427
|
}, "strip", import("zod").ZodTypeAny, {
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
chain_id: number;
|
|
429
|
+
pool_key: {
|
|
430
430
|
currency0: `0x${string}`;
|
|
431
431
|
currency1: `0x${string}`;
|
|
432
432
|
fee: number;
|
|
433
433
|
tickSpacing: number;
|
|
434
434
|
hooks: `0x${string}`;
|
|
435
435
|
};
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
436
|
+
zero_for_one: boolean;
|
|
437
|
+
exact_amount: bigint;
|
|
438
|
+
hook_data?: string | undefined;
|
|
439
439
|
}, {
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
chain_id: number;
|
|
441
|
+
pool_key: {
|
|
442
442
|
currency0: string;
|
|
443
443
|
currency1: string;
|
|
444
444
|
fee: number;
|
|
445
445
|
tickSpacing: number;
|
|
446
446
|
hooks: string;
|
|
447
447
|
};
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
448
|
+
zero_for_one: boolean;
|
|
449
|
+
exact_amount?: any;
|
|
450
|
+
hook_data?: string | undefined;
|
|
451
451
|
}>;
|
|
452
452
|
path: "/quotes/v4/exact-output-single";
|
|
453
453
|
responses: {
|
|
454
454
|
200: import("zod").ZodObject<{
|
|
455
455
|
result: import("zod").ZodObject<{
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
amount_in: import("zod").ZodString;
|
|
457
|
+
gas_estimate: import("zod").ZodString;
|
|
458
458
|
}, "strip", import("zod").ZodTypeAny, {
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
amount_in: string;
|
|
460
|
+
gas_estimate: string;
|
|
461
461
|
}, {
|
|
462
|
-
|
|
463
|
-
|
|
462
|
+
amount_in: string;
|
|
463
|
+
gas_estimate: string;
|
|
464
464
|
}>;
|
|
465
465
|
}, "strip", import("zod").ZodTypeAny, {
|
|
466
466
|
result: {
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
amount_in: string;
|
|
468
|
+
gas_estimate: string;
|
|
469
469
|
};
|
|
470
470
|
}, {
|
|
471
471
|
result: {
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
amount_in: string;
|
|
473
|
+
gas_estimate: string;
|
|
474
474
|
};
|
|
475
475
|
}>;
|
|
476
476
|
};
|
|
@@ -478,8 +478,8 @@ export declare const rootContract: {
|
|
|
478
478
|
v4ExactInputSingle: {
|
|
479
479
|
method: "POST";
|
|
480
480
|
body: import("zod").ZodObject<{
|
|
481
|
-
|
|
482
|
-
|
|
481
|
+
chain_id: import("zod").ZodNumber;
|
|
482
|
+
pool_key: import("zod").ZodObject<{
|
|
483
483
|
currency0: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
484
484
|
currency1: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
485
485
|
fee: import("zod").ZodNumber;
|
|
@@ -498,56 +498,56 @@ export declare const rootContract: {
|
|
|
498
498
|
tickSpacing: number;
|
|
499
499
|
hooks: string;
|
|
500
500
|
}>;
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
501
|
+
zero_for_one: import("zod").ZodBoolean;
|
|
502
|
+
exact_amount: import("zod").ZodEffects<import("zod").ZodAny, bigint, any>;
|
|
503
|
+
hook_data: import("zod").ZodOptional<import("zod").ZodString>;
|
|
504
504
|
}, "strip", import("zod").ZodTypeAny, {
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
chain_id: number;
|
|
506
|
+
pool_key: {
|
|
507
507
|
currency0: `0x${string}`;
|
|
508
508
|
currency1: `0x${string}`;
|
|
509
509
|
fee: number;
|
|
510
510
|
tickSpacing: number;
|
|
511
511
|
hooks: `0x${string}`;
|
|
512
512
|
};
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
zero_for_one: boolean;
|
|
514
|
+
exact_amount: bigint;
|
|
515
|
+
hook_data?: string | undefined;
|
|
516
516
|
}, {
|
|
517
|
-
|
|
518
|
-
|
|
517
|
+
chain_id: number;
|
|
518
|
+
pool_key: {
|
|
519
519
|
currency0: string;
|
|
520
520
|
currency1: string;
|
|
521
521
|
fee: number;
|
|
522
522
|
tickSpacing: number;
|
|
523
523
|
hooks: string;
|
|
524
524
|
};
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
zero_for_one: boolean;
|
|
526
|
+
exact_amount?: any;
|
|
527
|
+
hook_data?: string | undefined;
|
|
528
528
|
}>;
|
|
529
529
|
path: "/quotes/v4/exact-input-single";
|
|
530
530
|
responses: {
|
|
531
531
|
200: import("zod").ZodObject<{
|
|
532
532
|
result: import("zod").ZodObject<{
|
|
533
|
-
|
|
534
|
-
|
|
533
|
+
amount_out: import("zod").ZodString;
|
|
534
|
+
gas_estimate: import("zod").ZodString;
|
|
535
535
|
}, "strip", import("zod").ZodTypeAny, {
|
|
536
|
-
|
|
537
|
-
|
|
536
|
+
gas_estimate: string;
|
|
537
|
+
amount_out: string;
|
|
538
538
|
}, {
|
|
539
|
-
|
|
540
|
-
|
|
539
|
+
gas_estimate: string;
|
|
540
|
+
amount_out: string;
|
|
541
541
|
}>;
|
|
542
542
|
}, "strip", import("zod").ZodTypeAny, {
|
|
543
543
|
result: {
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
gas_estimate: string;
|
|
545
|
+
amount_out: string;
|
|
546
546
|
};
|
|
547
547
|
}, {
|
|
548
548
|
result: {
|
|
549
|
-
|
|
550
|
-
|
|
549
|
+
gas_estimate: string;
|
|
550
|
+
amount_out: string;
|
|
551
551
|
};
|
|
552
552
|
}>;
|
|
553
553
|
};
|
|
@@ -555,56 +555,56 @@ export declare const rootContract: {
|
|
|
555
555
|
v3ExactOutputSingle: {
|
|
556
556
|
method: "POST";
|
|
557
557
|
body: import("zod").ZodObject<{
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
558
|
+
chain_id: import("zod").ZodNumber;
|
|
559
|
+
token_in: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
560
|
+
token_out: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
561
|
+
amount_out: import("zod").ZodEffects<import("zod").ZodAny, bigint, any>;
|
|
562
562
|
fee: import("zod").ZodNumber;
|
|
563
563
|
}, "strip", import("zod").ZodTypeAny, {
|
|
564
564
|
fee: number;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
565
|
+
chain_id: number;
|
|
566
|
+
amount_out: bigint;
|
|
567
|
+
token_in: `0x${string}`;
|
|
568
|
+
token_out: `0x${string}`;
|
|
569
569
|
}, {
|
|
570
570
|
fee: number;
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
571
|
+
chain_id: number;
|
|
572
|
+
token_in: string;
|
|
573
|
+
token_out: string;
|
|
574
|
+
amount_out?: any;
|
|
575
575
|
}>;
|
|
576
576
|
path: "/quotes/v3/exact-output-single";
|
|
577
577
|
responses: {
|
|
578
578
|
200: import("zod").ZodObject<{
|
|
579
579
|
result: import("zod").ZodObject<{
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
580
|
+
amount_in: import("zod").ZodString;
|
|
581
|
+
sqrt_price_x96_after: import("zod").ZodString;
|
|
582
|
+
initialized_ticks_crossed: import("zod").ZodNumber;
|
|
583
|
+
gas_estimate: import("zod").ZodString;
|
|
584
584
|
}, "strip", import("zod").ZodTypeAny, {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
585
|
+
amount_in: string;
|
|
586
|
+
gas_estimate: string;
|
|
587
|
+
sqrt_price_x96_after: string;
|
|
588
|
+
initialized_ticks_crossed: number;
|
|
589
589
|
}, {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
590
|
+
amount_in: string;
|
|
591
|
+
gas_estimate: string;
|
|
592
|
+
sqrt_price_x96_after: string;
|
|
593
|
+
initialized_ticks_crossed: number;
|
|
594
594
|
}>;
|
|
595
595
|
}, "strip", import("zod").ZodTypeAny, {
|
|
596
596
|
result: {
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
597
|
+
amount_in: string;
|
|
598
|
+
gas_estimate: string;
|
|
599
|
+
sqrt_price_x96_after: string;
|
|
600
|
+
initialized_ticks_crossed: number;
|
|
601
601
|
};
|
|
602
602
|
}, {
|
|
603
603
|
result: {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
604
|
+
amount_in: string;
|
|
605
|
+
gas_estimate: string;
|
|
606
|
+
sqrt_price_x96_after: string;
|
|
607
|
+
initialized_ticks_crossed: number;
|
|
608
608
|
};
|
|
609
609
|
}>;
|
|
610
610
|
};
|
|
@@ -612,59 +612,59 @@ export declare const rootContract: {
|
|
|
612
612
|
v3ExactInputSingle: {
|
|
613
613
|
method: "POST";
|
|
614
614
|
body: import("zod").ZodObject<{
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
chain_id: import("zod").ZodNumber;
|
|
616
|
+
token_in: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
617
|
+
token_out: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
618
|
+
amount_in: import("zod").ZodEffects<import("zod").ZodAny, bigint, any>;
|
|
619
619
|
fee: import("zod").ZodNumber;
|
|
620
|
-
|
|
620
|
+
sqrt_price_limit_x96: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodAny, bigint, any>>;
|
|
621
621
|
}, "strip", import("zod").ZodTypeAny, {
|
|
622
622
|
fee: number;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
623
|
+
chain_id: number;
|
|
624
|
+
amount_in: bigint;
|
|
625
|
+
token_in: `0x${string}`;
|
|
626
|
+
token_out: `0x${string}`;
|
|
627
|
+
sqrt_price_limit_x96?: bigint | undefined;
|
|
628
628
|
}, {
|
|
629
629
|
fee: number;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
630
|
+
chain_id: number;
|
|
631
|
+
token_in: string;
|
|
632
|
+
token_out: string;
|
|
633
|
+
amount_in?: any;
|
|
634
|
+
sqrt_price_limit_x96?: any;
|
|
635
635
|
}>;
|
|
636
636
|
path: "/quotes/v3/exact-input-single";
|
|
637
637
|
responses: {
|
|
638
638
|
200: import("zod").ZodObject<{
|
|
639
639
|
result: import("zod").ZodObject<{
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
640
|
+
amount_out: import("zod").ZodString;
|
|
641
|
+
sqrt_price_x96_after: import("zod").ZodString;
|
|
642
|
+
initialized_ticks_crossed: import("zod").ZodNumber;
|
|
643
|
+
gas_estimate: import("zod").ZodString;
|
|
644
644
|
}, "strip", import("zod").ZodTypeAny, {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
645
|
+
gas_estimate: string;
|
|
646
|
+
amount_out: string;
|
|
647
|
+
sqrt_price_x96_after: string;
|
|
648
|
+
initialized_ticks_crossed: number;
|
|
649
649
|
}, {
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
650
|
+
gas_estimate: string;
|
|
651
|
+
amount_out: string;
|
|
652
|
+
sqrt_price_x96_after: string;
|
|
653
|
+
initialized_ticks_crossed: number;
|
|
654
654
|
}>;
|
|
655
655
|
}, "strip", import("zod").ZodTypeAny, {
|
|
656
656
|
result: {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
657
|
+
gas_estimate: string;
|
|
658
|
+
amount_out: string;
|
|
659
|
+
sqrt_price_x96_after: string;
|
|
660
|
+
initialized_ticks_crossed: number;
|
|
661
661
|
};
|
|
662
662
|
}, {
|
|
663
663
|
result: {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
664
|
+
gas_estimate: string;
|
|
665
|
+
amount_out: string;
|
|
666
|
+
sqrt_price_x96_after: string;
|
|
667
|
+
initialized_ticks_crossed: number;
|
|
668
668
|
};
|
|
669
669
|
}>;
|
|
670
670
|
};
|
|
@@ -3,8 +3,8 @@ declare const quoteContract: {
|
|
|
3
3
|
v4ExactOutputSingle: {
|
|
4
4
|
method: "POST";
|
|
5
5
|
body: z.ZodObject<{
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
chain_id: z.ZodNumber;
|
|
7
|
+
pool_key: z.ZodObject<{
|
|
8
8
|
currency0: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
9
9
|
currency1: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
10
10
|
fee: z.ZodNumber;
|
|
@@ -23,56 +23,56 @@ declare const quoteContract: {
|
|
|
23
23
|
tickSpacing: number;
|
|
24
24
|
hooks: string;
|
|
25
25
|
}>;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
zero_for_one: z.ZodBoolean;
|
|
27
|
+
exact_amount: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
28
|
+
hook_data: z.ZodOptional<z.ZodString>;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
chain_id: number;
|
|
31
|
+
pool_key: {
|
|
32
32
|
currency0: `0x${string}`;
|
|
33
33
|
currency1: `0x${string}`;
|
|
34
34
|
fee: number;
|
|
35
35
|
tickSpacing: number;
|
|
36
36
|
hooks: `0x${string}`;
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
zero_for_one: boolean;
|
|
39
|
+
exact_amount: bigint;
|
|
40
|
+
hook_data?: string | undefined;
|
|
41
41
|
}, {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
chain_id: number;
|
|
43
|
+
pool_key: {
|
|
44
44
|
currency0: string;
|
|
45
45
|
currency1: string;
|
|
46
46
|
fee: number;
|
|
47
47
|
tickSpacing: number;
|
|
48
48
|
hooks: string;
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
zero_for_one: boolean;
|
|
51
|
+
exact_amount?: any;
|
|
52
|
+
hook_data?: string | undefined;
|
|
53
53
|
}>;
|
|
54
54
|
path: "/quotes/v4/exact-output-single";
|
|
55
55
|
responses: {
|
|
56
56
|
200: z.ZodObject<{
|
|
57
57
|
result: z.ZodObject<{
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
amount_in: z.ZodString;
|
|
59
|
+
gas_estimate: z.ZodString;
|
|
60
60
|
}, "strip", z.ZodTypeAny, {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
amount_in: string;
|
|
62
|
+
gas_estimate: string;
|
|
63
63
|
}, {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
amount_in: string;
|
|
65
|
+
gas_estimate: string;
|
|
66
66
|
}>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
68
|
result: {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
amount_in: string;
|
|
70
|
+
gas_estimate: string;
|
|
71
71
|
};
|
|
72
72
|
}, {
|
|
73
73
|
result: {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
amount_in: string;
|
|
75
|
+
gas_estimate: string;
|
|
76
76
|
};
|
|
77
77
|
}>;
|
|
78
78
|
};
|
|
@@ -80,8 +80,8 @@ declare const quoteContract: {
|
|
|
80
80
|
v4ExactInputSingle: {
|
|
81
81
|
method: "POST";
|
|
82
82
|
body: z.ZodObject<{
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
chain_id: z.ZodNumber;
|
|
84
|
+
pool_key: z.ZodObject<{
|
|
85
85
|
currency0: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
86
86
|
currency1: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
87
87
|
fee: z.ZodNumber;
|
|
@@ -100,56 +100,56 @@ declare const quoteContract: {
|
|
|
100
100
|
tickSpacing: number;
|
|
101
101
|
hooks: string;
|
|
102
102
|
}>;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
zero_for_one: z.ZodBoolean;
|
|
104
|
+
exact_amount: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
105
|
+
hook_data: z.ZodOptional<z.ZodString>;
|
|
106
106
|
}, "strip", z.ZodTypeAny, {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
chain_id: number;
|
|
108
|
+
pool_key: {
|
|
109
109
|
currency0: `0x${string}`;
|
|
110
110
|
currency1: `0x${string}`;
|
|
111
111
|
fee: number;
|
|
112
112
|
tickSpacing: number;
|
|
113
113
|
hooks: `0x${string}`;
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
zero_for_one: boolean;
|
|
116
|
+
exact_amount: bigint;
|
|
117
|
+
hook_data?: string | undefined;
|
|
118
118
|
}, {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
chain_id: number;
|
|
120
|
+
pool_key: {
|
|
121
121
|
currency0: string;
|
|
122
122
|
currency1: string;
|
|
123
123
|
fee: number;
|
|
124
124
|
tickSpacing: number;
|
|
125
125
|
hooks: string;
|
|
126
126
|
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
zero_for_one: boolean;
|
|
128
|
+
exact_amount?: any;
|
|
129
|
+
hook_data?: string | undefined;
|
|
130
130
|
}>;
|
|
131
131
|
path: "/quotes/v4/exact-input-single";
|
|
132
132
|
responses: {
|
|
133
133
|
200: z.ZodObject<{
|
|
134
134
|
result: z.ZodObject<{
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
amount_out: z.ZodString;
|
|
136
|
+
gas_estimate: z.ZodString;
|
|
137
137
|
}, "strip", z.ZodTypeAny, {
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
gas_estimate: string;
|
|
139
|
+
amount_out: string;
|
|
140
140
|
}, {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
gas_estimate: string;
|
|
142
|
+
amount_out: string;
|
|
143
143
|
}>;
|
|
144
144
|
}, "strip", z.ZodTypeAny, {
|
|
145
145
|
result: {
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
gas_estimate: string;
|
|
147
|
+
amount_out: string;
|
|
148
148
|
};
|
|
149
149
|
}, {
|
|
150
150
|
result: {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
gas_estimate: string;
|
|
152
|
+
amount_out: string;
|
|
153
153
|
};
|
|
154
154
|
}>;
|
|
155
155
|
};
|
|
@@ -157,56 +157,56 @@ declare const quoteContract: {
|
|
|
157
157
|
v3ExactOutputSingle: {
|
|
158
158
|
method: "POST";
|
|
159
159
|
body: z.ZodObject<{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
chain_id: z.ZodNumber;
|
|
161
|
+
token_in: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
162
|
+
token_out: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
163
|
+
amount_out: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
164
164
|
fee: z.ZodNumber;
|
|
165
165
|
}, "strip", z.ZodTypeAny, {
|
|
166
166
|
fee: number;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
chain_id: number;
|
|
168
|
+
amount_out: bigint;
|
|
169
|
+
token_in: `0x${string}`;
|
|
170
|
+
token_out: `0x${string}`;
|
|
171
171
|
}, {
|
|
172
172
|
fee: number;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
chain_id: number;
|
|
174
|
+
token_in: string;
|
|
175
|
+
token_out: string;
|
|
176
|
+
amount_out?: any;
|
|
177
177
|
}>;
|
|
178
178
|
path: "/quotes/v3/exact-output-single";
|
|
179
179
|
responses: {
|
|
180
180
|
200: z.ZodObject<{
|
|
181
181
|
result: z.ZodObject<{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
amount_in: z.ZodString;
|
|
183
|
+
sqrt_price_x96_after: z.ZodString;
|
|
184
|
+
initialized_ticks_crossed: z.ZodNumber;
|
|
185
|
+
gas_estimate: z.ZodString;
|
|
186
186
|
}, "strip", z.ZodTypeAny, {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
amount_in: string;
|
|
188
|
+
gas_estimate: string;
|
|
189
|
+
sqrt_price_x96_after: string;
|
|
190
|
+
initialized_ticks_crossed: number;
|
|
191
191
|
}, {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
amount_in: string;
|
|
193
|
+
gas_estimate: string;
|
|
194
|
+
sqrt_price_x96_after: string;
|
|
195
|
+
initialized_ticks_crossed: number;
|
|
196
196
|
}>;
|
|
197
197
|
}, "strip", z.ZodTypeAny, {
|
|
198
198
|
result: {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
amount_in: string;
|
|
200
|
+
gas_estimate: string;
|
|
201
|
+
sqrt_price_x96_after: string;
|
|
202
|
+
initialized_ticks_crossed: number;
|
|
203
203
|
};
|
|
204
204
|
}, {
|
|
205
205
|
result: {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
206
|
+
amount_in: string;
|
|
207
|
+
gas_estimate: string;
|
|
208
|
+
sqrt_price_x96_after: string;
|
|
209
|
+
initialized_ticks_crossed: number;
|
|
210
210
|
};
|
|
211
211
|
}>;
|
|
212
212
|
};
|
|
@@ -214,59 +214,59 @@ declare const quoteContract: {
|
|
|
214
214
|
v3ExactInputSingle: {
|
|
215
215
|
method: "POST";
|
|
216
216
|
body: z.ZodObject<{
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
chain_id: z.ZodNumber;
|
|
218
|
+
token_in: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
219
|
+
token_out: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
220
|
+
amount_in: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
221
221
|
fee: z.ZodNumber;
|
|
222
|
-
|
|
222
|
+
sqrt_price_limit_x96: z.ZodOptional<z.ZodEffects<z.ZodAny, bigint, any>>;
|
|
223
223
|
}, "strip", z.ZodTypeAny, {
|
|
224
224
|
fee: number;
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
chain_id: number;
|
|
226
|
+
amount_in: bigint;
|
|
227
|
+
token_in: `0x${string}`;
|
|
228
|
+
token_out: `0x${string}`;
|
|
229
|
+
sqrt_price_limit_x96?: bigint | undefined;
|
|
230
230
|
}, {
|
|
231
231
|
fee: number;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
chain_id: number;
|
|
233
|
+
token_in: string;
|
|
234
|
+
token_out: string;
|
|
235
|
+
amount_in?: any;
|
|
236
|
+
sqrt_price_limit_x96?: any;
|
|
237
237
|
}>;
|
|
238
238
|
path: "/quotes/v3/exact-input-single";
|
|
239
239
|
responses: {
|
|
240
240
|
200: z.ZodObject<{
|
|
241
241
|
result: z.ZodObject<{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
242
|
+
amount_out: z.ZodString;
|
|
243
|
+
sqrt_price_x96_after: z.ZodString;
|
|
244
|
+
initialized_ticks_crossed: z.ZodNumber;
|
|
245
|
+
gas_estimate: z.ZodString;
|
|
246
246
|
}, "strip", z.ZodTypeAny, {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
gas_estimate: string;
|
|
248
|
+
amount_out: string;
|
|
249
|
+
sqrt_price_x96_after: string;
|
|
250
|
+
initialized_ticks_crossed: number;
|
|
251
251
|
}, {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
252
|
+
gas_estimate: string;
|
|
253
|
+
amount_out: string;
|
|
254
|
+
sqrt_price_x96_after: string;
|
|
255
|
+
initialized_ticks_crossed: number;
|
|
256
256
|
}>;
|
|
257
257
|
}, "strip", z.ZodTypeAny, {
|
|
258
258
|
result: {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
259
|
+
gas_estimate: string;
|
|
260
|
+
amount_out: string;
|
|
261
|
+
sqrt_price_x96_after: string;
|
|
262
|
+
initialized_ticks_crossed: number;
|
|
263
263
|
};
|
|
264
264
|
}, {
|
|
265
265
|
result: {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
gas_estimate: string;
|
|
267
|
+
amount_out: string;
|
|
268
|
+
sqrt_price_x96_after: string;
|
|
269
|
+
initialized_ticks_crossed: number;
|
|
270
270
|
};
|
|
271
271
|
}>;
|
|
272
272
|
};
|
|
@@ -10,17 +10,17 @@ const quoteContract = contract.router({
|
|
|
10
10
|
method: "POST",
|
|
11
11
|
path: "/v4/exact-output-single",
|
|
12
12
|
body: zod_1.default.object({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
chain_id: zod_1.default.number(),
|
|
14
|
+
pool_key: types_1.poolKeySchema,
|
|
15
|
+
zero_for_one: zod_1.default.boolean(),
|
|
16
|
+
exact_amount: types_1.coerceBigInt,
|
|
17
|
+
hook_data: zod_1.default.optional(zod_1.default.string()),
|
|
18
18
|
}),
|
|
19
19
|
responses: {
|
|
20
20
|
200: zod_1.default.object({
|
|
21
21
|
result: zod_1.default.object({
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
amount_in: zod_1.default.string(),
|
|
23
|
+
gas_estimate: zod_1.default.string(),
|
|
24
24
|
}),
|
|
25
25
|
}),
|
|
26
26
|
},
|
|
@@ -29,17 +29,17 @@ const quoteContract = contract.router({
|
|
|
29
29
|
method: "POST",
|
|
30
30
|
path: "/v4/exact-input-single",
|
|
31
31
|
body: zod_1.default.object({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
chain_id: zod_1.default.number(),
|
|
33
|
+
pool_key: types_1.poolKeySchema,
|
|
34
|
+
zero_for_one: zod_1.default.boolean(),
|
|
35
|
+
exact_amount: types_1.coerceBigInt,
|
|
36
|
+
hook_data: zod_1.default.optional(zod_1.default.string()),
|
|
37
37
|
}),
|
|
38
38
|
responses: {
|
|
39
39
|
200: zod_1.default.object({
|
|
40
40
|
result: zod_1.default.object({
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
amount_out: zod_1.default.string(),
|
|
42
|
+
gas_estimate: zod_1.default.string(),
|
|
43
43
|
}),
|
|
44
44
|
}),
|
|
45
45
|
},
|
|
@@ -48,19 +48,19 @@ const quoteContract = contract.router({
|
|
|
48
48
|
method: "POST",
|
|
49
49
|
path: "/v3/exact-output-single",
|
|
50
50
|
body: zod_1.default.object({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
chain_id: zod_1.default.number(),
|
|
52
|
+
token_in: zod_1.default.string().pipe(types_1.hex),
|
|
53
|
+
token_out: zod_1.default.string().pipe(types_1.hex),
|
|
54
|
+
amount_out: types_1.coerceBigInt,
|
|
55
55
|
fee: zod_1.default.number(),
|
|
56
56
|
}),
|
|
57
57
|
responses: {
|
|
58
58
|
200: zod_1.default.object({
|
|
59
59
|
result: zod_1.default.object({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
amount_in: zod_1.default.string(),
|
|
61
|
+
sqrt_price_x96_after: zod_1.default.string(),
|
|
62
|
+
initialized_ticks_crossed: zod_1.default.number(),
|
|
63
|
+
gas_estimate: zod_1.default.string(),
|
|
64
64
|
}),
|
|
65
65
|
}),
|
|
66
66
|
},
|
|
@@ -69,20 +69,20 @@ const quoteContract = contract.router({
|
|
|
69
69
|
method: "POST",
|
|
70
70
|
path: "/v3/exact-input-single",
|
|
71
71
|
body: zod_1.default.object({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
chain_id: zod_1.default.number(),
|
|
73
|
+
token_in: zod_1.default.string().pipe(types_1.hex),
|
|
74
|
+
token_out: zod_1.default.string().pipe(types_1.hex),
|
|
75
|
+
amount_in: types_1.coerceBigInt,
|
|
76
76
|
fee: zod_1.default.number(),
|
|
77
|
-
|
|
77
|
+
sqrt_price_limit_x96: zod_1.default.optional(types_1.coerceBigInt),
|
|
78
78
|
}),
|
|
79
79
|
responses: {
|
|
80
80
|
200: zod_1.default.object({
|
|
81
81
|
result: zod_1.default.object({
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
amount_out: zod_1.default.string(),
|
|
83
|
+
sqrt_price_x96_after: zod_1.default.string(),
|
|
84
|
+
initialized_ticks_crossed: zod_1.default.number(),
|
|
85
|
+
gas_estimate: zod_1.default.string(),
|
|
86
86
|
}),
|
|
87
87
|
}),
|
|
88
88
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.contract.js","sourceRoot":"","sources":["../../src/contracts/quote.contract.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AAC7C,6BAAoB;AAEpB,oCAA4D;AAE5D,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AAEhC,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CACjC;IACI,mBAAmB,EAAE;QACjB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,aAAC,CAAC,MAAM,CAAC;YACX,
|
|
1
|
+
{"version":3,"file":"quote.contract.js","sourceRoot":"","sources":["../../src/contracts/quote.contract.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -132,55 +132,84 @@ if (createResponse.status === 200) {
|
|
|
132
132
|
|
|
133
133
|
```typescript
|
|
134
134
|
// V4 Exact Input Quote
|
|
135
|
-
const
|
|
135
|
+
const v4InputQuote = await apiClient.quotes.v4ExactInputSingle({
|
|
136
136
|
body: {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
chain_id: 8453,
|
|
138
|
+
pool_key: {
|
|
139
139
|
currency0: '0x0000000000000000000000000000000000000000', // ETH
|
|
140
140
|
currency1: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC
|
|
141
141
|
fee: 500,
|
|
142
|
-
|
|
142
|
+
tick_spacing: 10,
|
|
143
143
|
hooks: '0x0000000000000000000000000000000000000000'
|
|
144
144
|
},
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
zero_for_one: true,
|
|
146
|
+
exact_amount: '1000000000000000000', // 1 ETH
|
|
147
|
+
hook_data: '0x' // Optional hook data
|
|
147
148
|
}
|
|
148
149
|
});
|
|
149
150
|
|
|
150
|
-
if (
|
|
151
|
-
console.log(`Output amount: ${
|
|
152
|
-
console.log(`Gas estimate: ${
|
|
151
|
+
if (v4InputQuote.status === 200) {
|
|
152
|
+
console.log(`Output amount: ${v4InputQuote.body.result.amount_out}`);
|
|
153
|
+
console.log(`Gas estimate: ${v4InputQuote.body.result.gas_estimate}`);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// V4 Exact Output Quote
|
|
157
|
+
const v4OutputQuote = await apiClient.quotes.v4ExactOutputSingle({
|
|
158
|
+
body: {
|
|
159
|
+
chain_id: 8453,
|
|
160
|
+
pool_key: {
|
|
161
|
+
currency0: '0x0000000000000000000000000000000000000000', // ETH
|
|
162
|
+
currency1: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC
|
|
163
|
+
fee: 500,
|
|
164
|
+
tick_spacing: 10,
|
|
165
|
+
hooks: '0x0000000000000000000000000000000000000000'
|
|
166
|
+
},
|
|
167
|
+
zero_for_one: true,
|
|
168
|
+
exact_amount: '1000000000', // 1000 USDC output
|
|
169
|
+
hook_data: '0x' // Optional hook data
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
if (v4OutputQuote.status === 200) {
|
|
174
|
+
console.log(`Input required: ${v4OutputQuote.body.result.amount_in}`);
|
|
175
|
+
console.log(`Gas estimate: ${v4OutputQuote.body.result.gas_estimate}`);
|
|
153
176
|
}
|
|
154
177
|
|
|
155
178
|
// V3 Exact Input Quote
|
|
156
179
|
const v3InputQuote = await apiClient.quotes.v3ExactInputSingle({
|
|
157
180
|
body: {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
fee: 500 // 0.05%
|
|
181
|
+
chain_id: 1,
|
|
182
|
+
token_in: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
|
|
183
|
+
token_out: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
184
|
+
amount_in: '1000000000000000000', // 1 WETH
|
|
185
|
+
fee: 500, // 0.05%
|
|
186
|
+
sqrt_price_limit_x96: '0' // Optional price limit
|
|
163
187
|
}
|
|
164
188
|
});
|
|
165
189
|
|
|
166
190
|
if (v3InputQuote.status === 200) {
|
|
167
|
-
console.log(`Output amount: ${v3InputQuote.body.result.
|
|
168
|
-
console.log(`Price after: ${v3InputQuote.body.result.
|
|
191
|
+
console.log(`Output amount: ${v3InputQuote.body.result.amount_out}`);
|
|
192
|
+
console.log(`Price after: ${v3InputQuote.body.result.sqrt_price_x96_after}`);
|
|
193
|
+
console.log(`Ticks crossed: ${v3InputQuote.body.result.initialized_ticks_crossed}`);
|
|
194
|
+
console.log(`Gas estimate: ${v3InputQuote.body.result.gas_estimate}`);
|
|
169
195
|
}
|
|
170
196
|
|
|
171
197
|
// V3 Exact Output Quote
|
|
172
198
|
const v3OutputQuote = await apiClient.quotes.v3ExactOutputSingle({
|
|
173
199
|
body: {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
200
|
+
chain_id: 1,
|
|
201
|
+
token_in: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
|
|
202
|
+
token_out: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
203
|
+
amount_out: '1000000000', // 1000 USDC
|
|
178
204
|
fee: 500 // 0.05%
|
|
179
205
|
}
|
|
180
206
|
});
|
|
181
207
|
|
|
182
208
|
if (v3OutputQuote.status === 200) {
|
|
183
|
-
console.log(`Input required: ${v3OutputQuote.body.result.
|
|
209
|
+
console.log(`Input required: ${v3OutputQuote.body.result.amount_in}`);
|
|
210
|
+
console.log(`Price after: ${v3OutputQuote.body.result.sqrt_price_x96_after}`);
|
|
211
|
+
console.log(`Ticks crossed: ${v3OutputQuote.body.result.initialized_ticks_crossed}`);
|
|
212
|
+
console.log(`Gas estimate: ${v3OutputQuote.body.result.gas_estimate}`);
|
|
184
213
|
}
|
|
185
214
|
```
|
|
186
215
|
|
|
@@ -254,7 +283,7 @@ const poolKey: PoolKey = {
|
|
|
254
283
|
currency0: '0x0000000000000000000000000000000000000000',
|
|
255
284
|
currency1: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
256
285
|
fee: 500,
|
|
257
|
-
|
|
286
|
+
tick_spacing: 10,
|
|
258
287
|
hooks: '0x0000000000000000000000000000000000000000'
|
|
259
288
|
};
|
|
260
289
|
```
|