@longdotxyz/shared 0.0.75 → 0.0.76
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 +139 -0
- package/dist/contracts/index.js +3 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/pathfinding.contract.d.ts +263 -0
- package/dist/contracts/pathfinding.contract.js +45 -0
- package/dist/contracts/pathfinding.contract.js.map +1 -0
- package/package.json +1 -1
|
@@ -3715,6 +3715,144 @@ export declare const rootContract: {
|
|
|
3715
3715
|
};
|
|
3716
3716
|
};
|
|
3717
3717
|
};
|
|
3718
|
+
pathfinding: {
|
|
3719
|
+
fetchTokenPaths: {
|
|
3720
|
+
pathParams: import("zod").ZodObject<{
|
|
3721
|
+
tokenInAddress: import("zod").ZodPipeline<import("zod").ZodString, import("zod").ZodType<`0x${string}`, import("zod").ZodTypeDef, `0x${string}`>>;
|
|
3722
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
3723
|
+
tokenInAddress: `0x${string}`;
|
|
3724
|
+
}, {
|
|
3725
|
+
tokenInAddress: string;
|
|
3726
|
+
}>;
|
|
3727
|
+
method: "GET";
|
|
3728
|
+
path: "paths/:tokenInAddress";
|
|
3729
|
+
responses: {
|
|
3730
|
+
200: import("zod").ZodObject<{
|
|
3731
|
+
token_address: import("zod").ZodString;
|
|
3732
|
+
paths_count: import("zod").ZodNumber;
|
|
3733
|
+
paths: import("zod").ZodArray<import("zod").ZodObject<{
|
|
3734
|
+
start_token_address: import("zod").ZodString;
|
|
3735
|
+
end_token_address: import("zod").ZodString;
|
|
3736
|
+
score: import("zod").ZodNumber;
|
|
3737
|
+
total_liquidity_usd: import("zod").ZodNumber;
|
|
3738
|
+
total_volume_usd: import("zod").ZodNumber;
|
|
3739
|
+
bottleneck_liquidity_usd: import("zod").ZodNumber;
|
|
3740
|
+
hops: import("zod").ZodArray<import("zod").ZodObject<{
|
|
3741
|
+
pool_address: import("zod").ZodString;
|
|
3742
|
+
token_in_address: import("zod").ZodString;
|
|
3743
|
+
token_out_address: import("zod").ZodString;
|
|
3744
|
+
protocol: import("zod").ZodString;
|
|
3745
|
+
fee: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
3746
|
+
tick_spacing: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
3747
|
+
hooks: import("zod").ZodNullable<import("zod").ZodString>;
|
|
3748
|
+
liquidity_usd: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
3749
|
+
volume_usd: import("zod").ZodNullable<import("zod").ZodNumber>;
|
|
3750
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
3751
|
+
fee: number | null;
|
|
3752
|
+
hooks: string | null;
|
|
3753
|
+
pool_address: string;
|
|
3754
|
+
token_in_address: string;
|
|
3755
|
+
token_out_address: string;
|
|
3756
|
+
protocol: string;
|
|
3757
|
+
tick_spacing: number | null;
|
|
3758
|
+
liquidity_usd: number | null;
|
|
3759
|
+
volume_usd: number | null;
|
|
3760
|
+
}, {
|
|
3761
|
+
fee: number | null;
|
|
3762
|
+
hooks: string | null;
|
|
3763
|
+
pool_address: string;
|
|
3764
|
+
token_in_address: string;
|
|
3765
|
+
token_out_address: string;
|
|
3766
|
+
protocol: string;
|
|
3767
|
+
tick_spacing: number | null;
|
|
3768
|
+
liquidity_usd: number | null;
|
|
3769
|
+
volume_usd: number | null;
|
|
3770
|
+
}>, "many">;
|
|
3771
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
3772
|
+
start_token_address: string;
|
|
3773
|
+
end_token_address: string;
|
|
3774
|
+
score: number;
|
|
3775
|
+
total_liquidity_usd: number;
|
|
3776
|
+
total_volume_usd: number;
|
|
3777
|
+
bottleneck_liquidity_usd: number;
|
|
3778
|
+
hops: {
|
|
3779
|
+
fee: number | null;
|
|
3780
|
+
hooks: string | null;
|
|
3781
|
+
pool_address: string;
|
|
3782
|
+
token_in_address: string;
|
|
3783
|
+
token_out_address: string;
|
|
3784
|
+
protocol: string;
|
|
3785
|
+
tick_spacing: number | null;
|
|
3786
|
+
liquidity_usd: number | null;
|
|
3787
|
+
volume_usd: number | null;
|
|
3788
|
+
}[];
|
|
3789
|
+
}, {
|
|
3790
|
+
start_token_address: string;
|
|
3791
|
+
end_token_address: string;
|
|
3792
|
+
score: number;
|
|
3793
|
+
total_liquidity_usd: number;
|
|
3794
|
+
total_volume_usd: number;
|
|
3795
|
+
bottleneck_liquidity_usd: number;
|
|
3796
|
+
hops: {
|
|
3797
|
+
fee: number | null;
|
|
3798
|
+
hooks: string | null;
|
|
3799
|
+
pool_address: string;
|
|
3800
|
+
token_in_address: string;
|
|
3801
|
+
token_out_address: string;
|
|
3802
|
+
protocol: string;
|
|
3803
|
+
tick_spacing: number | null;
|
|
3804
|
+
liquidity_usd: number | null;
|
|
3805
|
+
volume_usd: number | null;
|
|
3806
|
+
}[];
|
|
3807
|
+
}>, "many">;
|
|
3808
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
3809
|
+
token_address: string;
|
|
3810
|
+
paths_count: number;
|
|
3811
|
+
paths: {
|
|
3812
|
+
start_token_address: string;
|
|
3813
|
+
end_token_address: string;
|
|
3814
|
+
score: number;
|
|
3815
|
+
total_liquidity_usd: number;
|
|
3816
|
+
total_volume_usd: number;
|
|
3817
|
+
bottleneck_liquidity_usd: number;
|
|
3818
|
+
hops: {
|
|
3819
|
+
fee: number | null;
|
|
3820
|
+
hooks: string | null;
|
|
3821
|
+
pool_address: string;
|
|
3822
|
+
token_in_address: string;
|
|
3823
|
+
token_out_address: string;
|
|
3824
|
+
protocol: string;
|
|
3825
|
+
tick_spacing: number | null;
|
|
3826
|
+
liquidity_usd: number | null;
|
|
3827
|
+
volume_usd: number | null;
|
|
3828
|
+
}[];
|
|
3829
|
+
}[];
|
|
3830
|
+
}, {
|
|
3831
|
+
token_address: string;
|
|
3832
|
+
paths_count: number;
|
|
3833
|
+
paths: {
|
|
3834
|
+
start_token_address: string;
|
|
3835
|
+
end_token_address: string;
|
|
3836
|
+
score: number;
|
|
3837
|
+
total_liquidity_usd: number;
|
|
3838
|
+
total_volume_usd: number;
|
|
3839
|
+
bottleneck_liquidity_usd: number;
|
|
3840
|
+
hops: {
|
|
3841
|
+
fee: number | null;
|
|
3842
|
+
hooks: string | null;
|
|
3843
|
+
pool_address: string;
|
|
3844
|
+
token_in_address: string;
|
|
3845
|
+
token_out_address: string;
|
|
3846
|
+
protocol: string;
|
|
3847
|
+
tick_spacing: number | null;
|
|
3848
|
+
liquidity_usd: number | null;
|
|
3849
|
+
volume_usd: number | null;
|
|
3850
|
+
}[];
|
|
3851
|
+
}[];
|
|
3852
|
+
}>;
|
|
3853
|
+
};
|
|
3854
|
+
};
|
|
3855
|
+
};
|
|
3718
3856
|
sponsorships: {
|
|
3719
3857
|
broadcastSponsored: {
|
|
3720
3858
|
description: "Broadcast a transaction with gas sponsorship using Privy server wallet";
|
|
@@ -3768,4 +3906,5 @@ export * from "./auction.contract";
|
|
|
3768
3906
|
export * from "./auction-template.contract";
|
|
3769
3907
|
export * from "./community.contract";
|
|
3770
3908
|
export * from "./ipfs.contract";
|
|
3909
|
+
export * from "./pathfinding.contract";
|
|
3771
3910
|
export * from "./sponsorship.contract";
|
package/dist/contracts/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const auction_template_contract_1 = require("./auction-template.contract");
|
|
|
21
21
|
const auction_contract_1 = require("./auction.contract");
|
|
22
22
|
const community_contract_1 = require("./community.contract");
|
|
23
23
|
const ipfs_contract_1 = require("./ipfs.contract");
|
|
24
|
+
const pathfinding_contract_1 = require("./pathfinding.contract");
|
|
24
25
|
const sponsorship_contract_1 = require("./sponsorship.contract");
|
|
25
26
|
const contract = (0, core_1.initContract)();
|
|
26
27
|
exports.rootContract = contract.router({
|
|
@@ -29,6 +30,7 @@ exports.rootContract = contract.router({
|
|
|
29
30
|
auctionTemplates: auction_template_contract_1.auctionTemplateContract,
|
|
30
31
|
communities: community_contract_1.communityContract,
|
|
31
32
|
ipfs: ipfs_contract_1.ipfsContract,
|
|
33
|
+
pathfinding: pathfinding_contract_1.pathfindingContract,
|
|
32
34
|
sponsorships: sponsorship_contract_1.sponsorshipContract,
|
|
33
35
|
});
|
|
34
36
|
__exportStar(require("./asset.contract"), exports);
|
|
@@ -36,5 +38,6 @@ __exportStar(require("./auction.contract"), exports);
|
|
|
36
38
|
__exportStar(require("./auction-template.contract"), exports);
|
|
37
39
|
__exportStar(require("./community.contract"), exports);
|
|
38
40
|
__exportStar(require("./ipfs.contract"), exports);
|
|
41
|
+
__exportStar(require("./pathfinding.contract"), exports);
|
|
39
42
|
__exportStar(require("./sponsorship.contract"), exports);
|
|
40
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAA6C;AAE7C,qDAAiD;AACjD,2EAAsE;AACtE,yDAAqD;AACrD,6DAAyD;AACzD,mDAA+C;AAC/C,iEAA6D;AAE7D,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AACnB,QAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,8BAAa;IACrB,QAAQ,EAAE,kCAAe;IACzB,gBAAgB,EAAE,mDAAuB;IACzC,WAAW,EAAE,sCAAiB;IAC9B,IAAI,EAAE,4BAAY;IAClB,YAAY,EAAE,0CAAmB;CACpC,CAAC,CAAC;AAEH,mDAAiC;AACjC,qDAAmC;AACnC,8DAA4C;AAC5C,uDAAqC;AACrC,kDAAgC;AAChC,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wCAA6C;AAE7C,qDAAiD;AACjD,2EAAsE;AACtE,yDAAqD;AACrD,6DAAyD;AACzD,mDAA+C;AAC/C,iEAA6D;AAC7D,iEAA6D;AAE7D,MAAM,QAAQ,GAAG,IAAA,mBAAY,GAAE,CAAC;AACnB,QAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,8BAAa;IACrB,QAAQ,EAAE,kCAAe;IACzB,gBAAgB,EAAE,mDAAuB;IACzC,WAAW,EAAE,sCAAiB;IAC9B,IAAI,EAAE,4BAAY;IAClB,WAAW,EAAE,0CAAmB;IAChC,YAAY,EAAE,0CAAmB;CACpC,CAAC,CAAC;AAEH,mDAAiC;AACjC,qDAAmC;AACnC,8DAA4C;AAC5C,uDAAqC;AACrC,kDAAgC;AAChC,yDAAuC;AACvC,yDAAuC"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
declare const FetchTokensPathsResponseSchema: z.ZodObject<{
|
|
3
|
+
token_address: z.ZodString;
|
|
4
|
+
paths_count: z.ZodNumber;
|
|
5
|
+
paths: z.ZodArray<z.ZodObject<{
|
|
6
|
+
start_token_address: z.ZodString;
|
|
7
|
+
end_token_address: z.ZodString;
|
|
8
|
+
score: z.ZodNumber;
|
|
9
|
+
total_liquidity_usd: z.ZodNumber;
|
|
10
|
+
total_volume_usd: z.ZodNumber;
|
|
11
|
+
bottleneck_liquidity_usd: z.ZodNumber;
|
|
12
|
+
hops: z.ZodArray<z.ZodObject<{
|
|
13
|
+
pool_address: z.ZodString;
|
|
14
|
+
token_in_address: z.ZodString;
|
|
15
|
+
token_out_address: z.ZodString;
|
|
16
|
+
protocol: z.ZodString;
|
|
17
|
+
fee: z.ZodNullable<z.ZodNumber>;
|
|
18
|
+
tick_spacing: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
hooks: z.ZodNullable<z.ZodString>;
|
|
20
|
+
liquidity_usd: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
volume_usd: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
fee: number | null;
|
|
24
|
+
hooks: string | null;
|
|
25
|
+
pool_address: string;
|
|
26
|
+
token_in_address: string;
|
|
27
|
+
token_out_address: string;
|
|
28
|
+
protocol: string;
|
|
29
|
+
tick_spacing: number | null;
|
|
30
|
+
liquidity_usd: number | null;
|
|
31
|
+
volume_usd: number | null;
|
|
32
|
+
}, {
|
|
33
|
+
fee: number | null;
|
|
34
|
+
hooks: string | null;
|
|
35
|
+
pool_address: string;
|
|
36
|
+
token_in_address: string;
|
|
37
|
+
token_out_address: string;
|
|
38
|
+
protocol: string;
|
|
39
|
+
tick_spacing: number | null;
|
|
40
|
+
liquidity_usd: number | null;
|
|
41
|
+
volume_usd: number | null;
|
|
42
|
+
}>, "many">;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
start_token_address: string;
|
|
45
|
+
end_token_address: string;
|
|
46
|
+
score: number;
|
|
47
|
+
total_liquidity_usd: number;
|
|
48
|
+
total_volume_usd: number;
|
|
49
|
+
bottleneck_liquidity_usd: number;
|
|
50
|
+
hops: {
|
|
51
|
+
fee: number | null;
|
|
52
|
+
hooks: string | null;
|
|
53
|
+
pool_address: string;
|
|
54
|
+
token_in_address: string;
|
|
55
|
+
token_out_address: string;
|
|
56
|
+
protocol: string;
|
|
57
|
+
tick_spacing: number | null;
|
|
58
|
+
liquidity_usd: number | null;
|
|
59
|
+
volume_usd: number | null;
|
|
60
|
+
}[];
|
|
61
|
+
}, {
|
|
62
|
+
start_token_address: string;
|
|
63
|
+
end_token_address: string;
|
|
64
|
+
score: number;
|
|
65
|
+
total_liquidity_usd: number;
|
|
66
|
+
total_volume_usd: number;
|
|
67
|
+
bottleneck_liquidity_usd: number;
|
|
68
|
+
hops: {
|
|
69
|
+
fee: number | null;
|
|
70
|
+
hooks: string | null;
|
|
71
|
+
pool_address: string;
|
|
72
|
+
token_in_address: string;
|
|
73
|
+
token_out_address: string;
|
|
74
|
+
protocol: string;
|
|
75
|
+
tick_spacing: number | null;
|
|
76
|
+
liquidity_usd: number | null;
|
|
77
|
+
volume_usd: number | null;
|
|
78
|
+
}[];
|
|
79
|
+
}>, "many">;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
token_address: string;
|
|
82
|
+
paths_count: number;
|
|
83
|
+
paths: {
|
|
84
|
+
start_token_address: string;
|
|
85
|
+
end_token_address: string;
|
|
86
|
+
score: number;
|
|
87
|
+
total_liquidity_usd: number;
|
|
88
|
+
total_volume_usd: number;
|
|
89
|
+
bottleneck_liquidity_usd: number;
|
|
90
|
+
hops: {
|
|
91
|
+
fee: number | null;
|
|
92
|
+
hooks: string | null;
|
|
93
|
+
pool_address: string;
|
|
94
|
+
token_in_address: string;
|
|
95
|
+
token_out_address: string;
|
|
96
|
+
protocol: string;
|
|
97
|
+
tick_spacing: number | null;
|
|
98
|
+
liquidity_usd: number | null;
|
|
99
|
+
volume_usd: number | null;
|
|
100
|
+
}[];
|
|
101
|
+
}[];
|
|
102
|
+
}, {
|
|
103
|
+
token_address: string;
|
|
104
|
+
paths_count: number;
|
|
105
|
+
paths: {
|
|
106
|
+
start_token_address: string;
|
|
107
|
+
end_token_address: string;
|
|
108
|
+
score: number;
|
|
109
|
+
total_liquidity_usd: number;
|
|
110
|
+
total_volume_usd: number;
|
|
111
|
+
bottleneck_liquidity_usd: number;
|
|
112
|
+
hops: {
|
|
113
|
+
fee: number | null;
|
|
114
|
+
hooks: string | null;
|
|
115
|
+
pool_address: string;
|
|
116
|
+
token_in_address: string;
|
|
117
|
+
token_out_address: string;
|
|
118
|
+
protocol: string;
|
|
119
|
+
tick_spacing: number | null;
|
|
120
|
+
liquidity_usd: number | null;
|
|
121
|
+
volume_usd: number | null;
|
|
122
|
+
}[];
|
|
123
|
+
}[];
|
|
124
|
+
}>;
|
|
125
|
+
declare const pathfindingContract: {
|
|
126
|
+
fetchTokenPaths: {
|
|
127
|
+
pathParams: z.ZodObject<{
|
|
128
|
+
tokenInAddress: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
tokenInAddress: `0x${string}`;
|
|
131
|
+
}, {
|
|
132
|
+
tokenInAddress: string;
|
|
133
|
+
}>;
|
|
134
|
+
method: "GET";
|
|
135
|
+
path: "paths/:tokenInAddress";
|
|
136
|
+
responses: {
|
|
137
|
+
200: z.ZodObject<{
|
|
138
|
+
token_address: z.ZodString;
|
|
139
|
+
paths_count: z.ZodNumber;
|
|
140
|
+
paths: z.ZodArray<z.ZodObject<{
|
|
141
|
+
start_token_address: z.ZodString;
|
|
142
|
+
end_token_address: z.ZodString;
|
|
143
|
+
score: z.ZodNumber;
|
|
144
|
+
total_liquidity_usd: z.ZodNumber;
|
|
145
|
+
total_volume_usd: z.ZodNumber;
|
|
146
|
+
bottleneck_liquidity_usd: z.ZodNumber;
|
|
147
|
+
hops: z.ZodArray<z.ZodObject<{
|
|
148
|
+
pool_address: z.ZodString;
|
|
149
|
+
token_in_address: z.ZodString;
|
|
150
|
+
token_out_address: z.ZodString;
|
|
151
|
+
protocol: z.ZodString;
|
|
152
|
+
fee: z.ZodNullable<z.ZodNumber>;
|
|
153
|
+
tick_spacing: z.ZodNullable<z.ZodNumber>;
|
|
154
|
+
hooks: z.ZodNullable<z.ZodString>;
|
|
155
|
+
liquidity_usd: z.ZodNullable<z.ZodNumber>;
|
|
156
|
+
volume_usd: z.ZodNullable<z.ZodNumber>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
fee: number | null;
|
|
159
|
+
hooks: string | null;
|
|
160
|
+
pool_address: string;
|
|
161
|
+
token_in_address: string;
|
|
162
|
+
token_out_address: string;
|
|
163
|
+
protocol: string;
|
|
164
|
+
tick_spacing: number | null;
|
|
165
|
+
liquidity_usd: number | null;
|
|
166
|
+
volume_usd: number | null;
|
|
167
|
+
}, {
|
|
168
|
+
fee: number | null;
|
|
169
|
+
hooks: string | null;
|
|
170
|
+
pool_address: string;
|
|
171
|
+
token_in_address: string;
|
|
172
|
+
token_out_address: string;
|
|
173
|
+
protocol: string;
|
|
174
|
+
tick_spacing: number | null;
|
|
175
|
+
liquidity_usd: number | null;
|
|
176
|
+
volume_usd: number | null;
|
|
177
|
+
}>, "many">;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
start_token_address: string;
|
|
180
|
+
end_token_address: string;
|
|
181
|
+
score: number;
|
|
182
|
+
total_liquidity_usd: number;
|
|
183
|
+
total_volume_usd: number;
|
|
184
|
+
bottleneck_liquidity_usd: number;
|
|
185
|
+
hops: {
|
|
186
|
+
fee: number | null;
|
|
187
|
+
hooks: string | null;
|
|
188
|
+
pool_address: string;
|
|
189
|
+
token_in_address: string;
|
|
190
|
+
token_out_address: string;
|
|
191
|
+
protocol: string;
|
|
192
|
+
tick_spacing: number | null;
|
|
193
|
+
liquidity_usd: number | null;
|
|
194
|
+
volume_usd: number | null;
|
|
195
|
+
}[];
|
|
196
|
+
}, {
|
|
197
|
+
start_token_address: string;
|
|
198
|
+
end_token_address: string;
|
|
199
|
+
score: number;
|
|
200
|
+
total_liquidity_usd: number;
|
|
201
|
+
total_volume_usd: number;
|
|
202
|
+
bottleneck_liquidity_usd: number;
|
|
203
|
+
hops: {
|
|
204
|
+
fee: number | null;
|
|
205
|
+
hooks: string | null;
|
|
206
|
+
pool_address: string;
|
|
207
|
+
token_in_address: string;
|
|
208
|
+
token_out_address: string;
|
|
209
|
+
protocol: string;
|
|
210
|
+
tick_spacing: number | null;
|
|
211
|
+
liquidity_usd: number | null;
|
|
212
|
+
volume_usd: number | null;
|
|
213
|
+
}[];
|
|
214
|
+
}>, "many">;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
token_address: string;
|
|
217
|
+
paths_count: number;
|
|
218
|
+
paths: {
|
|
219
|
+
start_token_address: string;
|
|
220
|
+
end_token_address: string;
|
|
221
|
+
score: number;
|
|
222
|
+
total_liquidity_usd: number;
|
|
223
|
+
total_volume_usd: number;
|
|
224
|
+
bottleneck_liquidity_usd: number;
|
|
225
|
+
hops: {
|
|
226
|
+
fee: number | null;
|
|
227
|
+
hooks: string | null;
|
|
228
|
+
pool_address: string;
|
|
229
|
+
token_in_address: string;
|
|
230
|
+
token_out_address: string;
|
|
231
|
+
protocol: string;
|
|
232
|
+
tick_spacing: number | null;
|
|
233
|
+
liquidity_usd: number | null;
|
|
234
|
+
volume_usd: number | null;
|
|
235
|
+
}[];
|
|
236
|
+
}[];
|
|
237
|
+
}, {
|
|
238
|
+
token_address: string;
|
|
239
|
+
paths_count: number;
|
|
240
|
+
paths: {
|
|
241
|
+
start_token_address: string;
|
|
242
|
+
end_token_address: string;
|
|
243
|
+
score: number;
|
|
244
|
+
total_liquidity_usd: number;
|
|
245
|
+
total_volume_usd: number;
|
|
246
|
+
bottleneck_liquidity_usd: number;
|
|
247
|
+
hops: {
|
|
248
|
+
fee: number | null;
|
|
249
|
+
hooks: string | null;
|
|
250
|
+
pool_address: string;
|
|
251
|
+
token_in_address: string;
|
|
252
|
+
token_out_address: string;
|
|
253
|
+
protocol: string;
|
|
254
|
+
tick_spacing: number | null;
|
|
255
|
+
liquidity_usd: number | null;
|
|
256
|
+
volume_usd: number | null;
|
|
257
|
+
}[];
|
|
258
|
+
}[];
|
|
259
|
+
}>;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
export { pathfindingContract, FetchTokensPathsResponseSchema };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FetchTokensPathsResponseSchema = exports.pathfindingContract = void 0;
|
|
4
|
+
const core_1 = require("@ts-rest/core");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const contract = (0, core_1.initContract)();
|
|
8
|
+
const FetchTokensPathsResponseSchema = zod_1.default.object({
|
|
9
|
+
token_address: zod_1.default.string(),
|
|
10
|
+
paths_count: zod_1.default.number(),
|
|
11
|
+
paths: zod_1.default.array(zod_1.default.object({
|
|
12
|
+
start_token_address: zod_1.default.string(),
|
|
13
|
+
end_token_address: zod_1.default.string(),
|
|
14
|
+
score: zod_1.default.number().describe("Path score (sum of liquidity × volume for each hop)"),
|
|
15
|
+
total_liquidity_usd: zod_1.default.number().describe("Total liquidity in USD"),
|
|
16
|
+
total_volume_usd: zod_1.default.number().describe("Total volume in USD for the past 24 hours"),
|
|
17
|
+
bottleneck_liquidity_usd: zod_1.default.number().describe("Liquidity of the bottleneck token in USD"),
|
|
18
|
+
hops: zod_1.default.array(zod_1.default.object({
|
|
19
|
+
pool_address: zod_1.default.string(),
|
|
20
|
+
token_in_address: zod_1.default.string(),
|
|
21
|
+
token_out_address: zod_1.default.string(),
|
|
22
|
+
protocol: zod_1.default.string(),
|
|
23
|
+
fee: zod_1.default.number().nullable(),
|
|
24
|
+
tick_spacing: zod_1.default.number().nullable(),
|
|
25
|
+
hooks: zod_1.default.string().nullable(),
|
|
26
|
+
liquidity_usd: zod_1.default.number().nullable(),
|
|
27
|
+
volume_usd: zod_1.default.number().nullable(),
|
|
28
|
+
})),
|
|
29
|
+
})),
|
|
30
|
+
});
|
|
31
|
+
exports.FetchTokensPathsResponseSchema = FetchTokensPathsResponseSchema;
|
|
32
|
+
const pathfindingContract = contract.router({
|
|
33
|
+
fetchTokenPaths: {
|
|
34
|
+
method: "GET",
|
|
35
|
+
path: "paths/:tokenInAddress",
|
|
36
|
+
pathParams: zod_1.default.object({
|
|
37
|
+
tokenInAddress: zod_1.default.string().pipe(types_1.hex),
|
|
38
|
+
}),
|
|
39
|
+
responses: {
|
|
40
|
+
200: FetchTokensPathsResponseSchema,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
exports.pathfindingContract = pathfindingContract;
|
|
45
|
+
//# sourceMappingURL=pathfinding.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathfinding.contract.js","s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