@longdotxyz/shared 0.0.72 → 0.0.74
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/asset.contract.d.ts +66 -3695
- package/dist/contracts/auction-template.contract.d.ts +28 -335
- package/dist/contracts/auction.contract.d.ts +9 -147
- package/dist/contracts/community.contract.d.ts +4 -98
- package/dist/contracts/index.d.ts +50 -3964
- package/dist/contracts/index.js +0 -3
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/ipfs.contract.d.ts +5 -61
- package/dist/contracts/sponsorship.contract.d.ts +3 -40
- package/dist/types/bigint.type.d.ts +1 -1
- package/dist/types/hex.type.d.ts +1 -1
- package/dist/types/pool-key.type.d.ts +4 -16
- package/package.json +2 -2
- package/dist/contracts/quote.contract.d.ts +0 -295
- package/dist/contracts/quote.contract.js +0 -138
- package/dist/contracts/quote.contract.js.map +0 -1
package/dist/contracts/index.js
CHANGED
|
@@ -21,7 +21,6 @@ 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 quote_contract_1 = require("./quote.contract");
|
|
25
24
|
const sponsorship_contract_1 = require("./sponsorship.contract");
|
|
26
25
|
const contract = (0, core_1.initContract)();
|
|
27
26
|
exports.rootContract = contract.router({
|
|
@@ -30,7 +29,6 @@ exports.rootContract = contract.router({
|
|
|
30
29
|
auctionTemplates: auction_template_contract_1.auctionTemplateContract,
|
|
31
30
|
communities: community_contract_1.communityContract,
|
|
32
31
|
ipfs: ipfs_contract_1.ipfsContract,
|
|
33
|
-
quotes: quote_contract_1.quoteContract,
|
|
34
32
|
sponsorships: sponsorship_contract_1.sponsorshipContract,
|
|
35
33
|
});
|
|
36
34
|
__exportStar(require("./asset.contract"), exports);
|
|
@@ -38,6 +36,5 @@ __exportStar(require("./auction.contract"), exports);
|
|
|
38
36
|
__exportStar(require("./auction-template.contract"), exports);
|
|
39
37
|
__exportStar(require("./community.contract"), exports);
|
|
40
38
|
__exportStar(require("./ipfs.contract"), exports);
|
|
41
|
-
__exportStar(require("./quote.contract"), exports);
|
|
42
39
|
__exportStar(require("./sponsorship.contract"), exports);
|
|
43
40
|
//# 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,
|
|
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,22 +1,14 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
declare const ipfsContract: {
|
|
3
3
|
uploadImage: {
|
|
4
|
+
[x: string]: any;
|
|
4
5
|
description: "Upload an image to IPFS";
|
|
5
6
|
method: "POST";
|
|
6
7
|
contentType: "multipart/form-data";
|
|
7
8
|
body: z.ZodAny;
|
|
8
|
-
path: "/ipfs/upload-image";
|
|
9
|
-
responses: {
|
|
10
|
-
200: z.ZodObject<{
|
|
11
|
-
result: z.ZodString;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
result: string;
|
|
14
|
-
}, {
|
|
15
|
-
result: string;
|
|
16
|
-
}>;
|
|
17
|
-
};
|
|
18
9
|
};
|
|
19
10
|
uploadMetadata: {
|
|
11
|
+
[x: string]: any;
|
|
20
12
|
description: "Upload metadata to IPFS";
|
|
21
13
|
method: "POST";
|
|
22
14
|
body: z.ZodObject<{
|
|
@@ -26,61 +18,13 @@ declare const ipfsContract: {
|
|
|
26
18
|
social_links: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
19
|
label: z.ZodString;
|
|
28
20
|
url: z.ZodString;
|
|
29
|
-
},
|
|
30
|
-
label: string;
|
|
31
|
-
url: string;
|
|
32
|
-
}, {
|
|
33
|
-
label: string;
|
|
34
|
-
url: string;
|
|
35
|
-
}>, "many">>>;
|
|
21
|
+
}, z.core.$strip>>>>;
|
|
36
22
|
vesting_recipients: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
37
23
|
address: z.ZodString;
|
|
38
24
|
amount: z.ZodNumber;
|
|
39
|
-
},
|
|
40
|
-
address: string;
|
|
41
|
-
amount: number;
|
|
42
|
-
}, {
|
|
43
|
-
address: string;
|
|
44
|
-
amount: number;
|
|
45
|
-
}>, "many">>>;
|
|
25
|
+
}, z.core.$strip>>>>;
|
|
46
26
|
fee_receiver: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
47
|
-
},
|
|
48
|
-
name: string;
|
|
49
|
-
description: string;
|
|
50
|
-
image_hash: string;
|
|
51
|
-
fee_receiver: string;
|
|
52
|
-
social_links: {
|
|
53
|
-
label: string;
|
|
54
|
-
url: string;
|
|
55
|
-
}[];
|
|
56
|
-
vesting_recipients: {
|
|
57
|
-
address: string;
|
|
58
|
-
amount: number;
|
|
59
|
-
}[];
|
|
60
|
-
}, {
|
|
61
|
-
name: string;
|
|
62
|
-
description: string;
|
|
63
|
-
image_hash: string;
|
|
64
|
-
fee_receiver?: string | undefined;
|
|
65
|
-
social_links?: {
|
|
66
|
-
label: string;
|
|
67
|
-
url: string;
|
|
68
|
-
}[] | undefined;
|
|
69
|
-
vesting_recipients?: {
|
|
70
|
-
address: string;
|
|
71
|
-
amount: number;
|
|
72
|
-
}[] | undefined;
|
|
73
|
-
}>;
|
|
74
|
-
path: "/ipfs/upload-metadata";
|
|
75
|
-
responses: {
|
|
76
|
-
200: z.ZodObject<{
|
|
77
|
-
result: z.ZodString;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
result: string;
|
|
80
|
-
}, {
|
|
81
|
-
result: string;
|
|
82
|
-
}>;
|
|
83
|
-
};
|
|
27
|
+
}, z.core.$strip>;
|
|
84
28
|
};
|
|
85
29
|
};
|
|
86
30
|
export { ipfsContract };
|
|
@@ -1,48 +1,11 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
export declare const sponsorshipContract: {
|
|
3
3
|
broadcastSponsored: {
|
|
4
|
+
[x: string]: any;
|
|
4
5
|
description: "Broadcast a transaction with gas sponsorship using Privy server wallet";
|
|
5
6
|
method: "POST";
|
|
6
7
|
body: z.ZodObject<{
|
|
7
|
-
encoded_payload: z.
|
|
8
|
-
},
|
|
9
|
-
encoded_payload: `0x${string}`;
|
|
10
|
-
}, {
|
|
11
|
-
encoded_payload: string;
|
|
12
|
-
}>;
|
|
13
|
-
path: "/sponsorship";
|
|
14
|
-
responses: {
|
|
15
|
-
200: z.ZodObject<{
|
|
16
|
-
result: z.ZodObject<{
|
|
17
|
-
transaction_hash: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
transaction_hash: `0x${string}`;
|
|
20
|
-
}, {
|
|
21
|
-
transaction_hash: string;
|
|
22
|
-
}>;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
result: {
|
|
25
|
-
transaction_hash: `0x${string}`;
|
|
26
|
-
};
|
|
27
|
-
}, {
|
|
28
|
-
result: {
|
|
29
|
-
transaction_hash: string;
|
|
30
|
-
};
|
|
31
|
-
}>;
|
|
32
|
-
400: z.ZodObject<{
|
|
33
|
-
message: z.ZodString;
|
|
34
|
-
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
message: string;
|
|
36
|
-
}, {
|
|
37
|
-
message: string;
|
|
38
|
-
}>;
|
|
39
|
-
500: z.ZodObject<{
|
|
40
|
-
message: z.ZodString;
|
|
41
|
-
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
message: string;
|
|
43
|
-
}, {
|
|
44
|
-
message: string;
|
|
45
|
-
}>;
|
|
46
|
-
};
|
|
8
|
+
encoded_payload: z.ZodPipe<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
47
10
|
};
|
|
48
11
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
export declare const coerceBigInt: z.
|
|
2
|
+
export declare const coerceBigInt: z.ZodPipe<z.ZodAny, z.ZodTransform<bigint, any>>;
|
package/dist/types/hex.type.d.ts
CHANGED
|
@@ -8,21 +8,9 @@ export type PoolKey = {
|
|
|
8
8
|
hooks: Hex;
|
|
9
9
|
};
|
|
10
10
|
export declare const poolKeySchema: z.ZodObject<{
|
|
11
|
-
currency0: z.
|
|
12
|
-
currency1: z.
|
|
11
|
+
currency0: z.ZodPipe<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
12
|
+
currency1: z.ZodPipe<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
13
13
|
fee: z.ZodNumber;
|
|
14
14
|
tickSpacing: z.ZodNumber;
|
|
15
|
-
hooks: z.
|
|
16
|
-
},
|
|
17
|
-
currency0: `0x${string}`;
|
|
18
|
-
currency1: `0x${string}`;
|
|
19
|
-
fee: number;
|
|
20
|
-
tickSpacing: number;
|
|
21
|
-
hooks: `0x${string}`;
|
|
22
|
-
}, {
|
|
23
|
-
currency0: string;
|
|
24
|
-
currency1: string;
|
|
25
|
-
fee: number;
|
|
26
|
-
tickSpacing: number;
|
|
27
|
-
hooks: string;
|
|
28
|
-
}>;
|
|
15
|
+
hooks: z.ZodPipe<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
16
|
+
}, z.core.$strip>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longdotxyz/shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.74",
|
|
4
4
|
"description": "Shared types and utilities for Long.xyz API",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"ts-jest": "^29.2.5",
|
|
36
36
|
"tsx": "^4.20.6",
|
|
37
37
|
"typescript": "^5.7.3",
|
|
38
|
-
"typescript-eslint": "^8.46.
|
|
38
|
+
"typescript-eslint": "^8.46.4"
|
|
39
39
|
},
|
|
40
40
|
"jest": {
|
|
41
41
|
"moduleFileExtensions": [
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
declare const quoteContract: {
|
|
3
|
-
v4ExactOutputSingle: {
|
|
4
|
-
description: "Get a quote for an exact output single V4 swap";
|
|
5
|
-
query: z.ZodObject<{
|
|
6
|
-
chainId: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>>;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
chainId: number;
|
|
9
|
-
}, {
|
|
10
|
-
chainId?: number | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
method: "POST";
|
|
13
|
-
body: z.ZodObject<{
|
|
14
|
-
pool_key: z.ZodObject<{
|
|
15
|
-
currency0: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
16
|
-
currency1: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
17
|
-
fee: z.ZodNumber;
|
|
18
|
-
tickSpacing: z.ZodNumber;
|
|
19
|
-
hooks: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
currency0: `0x${string}`;
|
|
22
|
-
currency1: `0x${string}`;
|
|
23
|
-
fee: number;
|
|
24
|
-
tickSpacing: number;
|
|
25
|
-
hooks: `0x${string}`;
|
|
26
|
-
}, {
|
|
27
|
-
currency0: string;
|
|
28
|
-
currency1: string;
|
|
29
|
-
fee: number;
|
|
30
|
-
tickSpacing: number;
|
|
31
|
-
hooks: string;
|
|
32
|
-
}>;
|
|
33
|
-
zero_for_one: z.ZodBoolean;
|
|
34
|
-
exact_amount: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
35
|
-
hook_data: z.ZodOptional<z.ZodString>;
|
|
36
|
-
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
pool_key: {
|
|
38
|
-
currency0: `0x${string}`;
|
|
39
|
-
currency1: `0x${string}`;
|
|
40
|
-
fee: number;
|
|
41
|
-
tickSpacing: number;
|
|
42
|
-
hooks: `0x${string}`;
|
|
43
|
-
};
|
|
44
|
-
zero_for_one: boolean;
|
|
45
|
-
exact_amount: bigint;
|
|
46
|
-
hook_data?: string | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
pool_key: {
|
|
49
|
-
currency0: string;
|
|
50
|
-
currency1: string;
|
|
51
|
-
fee: number;
|
|
52
|
-
tickSpacing: number;
|
|
53
|
-
hooks: string;
|
|
54
|
-
};
|
|
55
|
-
zero_for_one: boolean;
|
|
56
|
-
exact_amount?: any;
|
|
57
|
-
hook_data?: string | undefined;
|
|
58
|
-
}>;
|
|
59
|
-
path: "/quotes/v4/exact-output-single";
|
|
60
|
-
responses: {
|
|
61
|
-
200: z.ZodObject<{
|
|
62
|
-
result: z.ZodObject<{
|
|
63
|
-
amount_in: z.ZodString;
|
|
64
|
-
gas_estimate: z.ZodString;
|
|
65
|
-
}, "strip", z.ZodTypeAny, {
|
|
66
|
-
amount_in: string;
|
|
67
|
-
gas_estimate: string;
|
|
68
|
-
}, {
|
|
69
|
-
amount_in: string;
|
|
70
|
-
gas_estimate: string;
|
|
71
|
-
}>;
|
|
72
|
-
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
result: {
|
|
74
|
-
amount_in: string;
|
|
75
|
-
gas_estimate: string;
|
|
76
|
-
};
|
|
77
|
-
}, {
|
|
78
|
-
result: {
|
|
79
|
-
amount_in: string;
|
|
80
|
-
gas_estimate: string;
|
|
81
|
-
};
|
|
82
|
-
}>;
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
v4ExactInputSingle: {
|
|
86
|
-
description: "Get a quote for an exact input single V4 swap";
|
|
87
|
-
query: z.ZodObject<{
|
|
88
|
-
chainId: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>>;
|
|
89
|
-
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
chainId: number;
|
|
91
|
-
}, {
|
|
92
|
-
chainId?: number | undefined;
|
|
93
|
-
}>;
|
|
94
|
-
method: "POST";
|
|
95
|
-
body: z.ZodObject<{
|
|
96
|
-
pool_key: z.ZodObject<{
|
|
97
|
-
currency0: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
98
|
-
currency1: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
99
|
-
fee: z.ZodNumber;
|
|
100
|
-
tickSpacing: z.ZodNumber;
|
|
101
|
-
hooks: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
102
|
-
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
currency0: `0x${string}`;
|
|
104
|
-
currency1: `0x${string}`;
|
|
105
|
-
fee: number;
|
|
106
|
-
tickSpacing: number;
|
|
107
|
-
hooks: `0x${string}`;
|
|
108
|
-
}, {
|
|
109
|
-
currency0: string;
|
|
110
|
-
currency1: string;
|
|
111
|
-
fee: number;
|
|
112
|
-
tickSpacing: number;
|
|
113
|
-
hooks: string;
|
|
114
|
-
}>;
|
|
115
|
-
zero_for_one: z.ZodBoolean;
|
|
116
|
-
exact_amount: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
117
|
-
hook_data: z.ZodOptional<z.ZodString>;
|
|
118
|
-
}, "strip", z.ZodTypeAny, {
|
|
119
|
-
pool_key: {
|
|
120
|
-
currency0: `0x${string}`;
|
|
121
|
-
currency1: `0x${string}`;
|
|
122
|
-
fee: number;
|
|
123
|
-
tickSpacing: number;
|
|
124
|
-
hooks: `0x${string}`;
|
|
125
|
-
};
|
|
126
|
-
zero_for_one: boolean;
|
|
127
|
-
exact_amount: bigint;
|
|
128
|
-
hook_data?: string | undefined;
|
|
129
|
-
}, {
|
|
130
|
-
pool_key: {
|
|
131
|
-
currency0: string;
|
|
132
|
-
currency1: string;
|
|
133
|
-
fee: number;
|
|
134
|
-
tickSpacing: number;
|
|
135
|
-
hooks: string;
|
|
136
|
-
};
|
|
137
|
-
zero_for_one: boolean;
|
|
138
|
-
exact_amount?: any;
|
|
139
|
-
hook_data?: string | undefined;
|
|
140
|
-
}>;
|
|
141
|
-
path: "/quotes/v4/exact-input-single";
|
|
142
|
-
responses: {
|
|
143
|
-
200: z.ZodObject<{
|
|
144
|
-
result: z.ZodObject<{
|
|
145
|
-
amount_out: z.ZodString;
|
|
146
|
-
gas_estimate: z.ZodString;
|
|
147
|
-
}, "strip", z.ZodTypeAny, {
|
|
148
|
-
gas_estimate: string;
|
|
149
|
-
amount_out: string;
|
|
150
|
-
}, {
|
|
151
|
-
gas_estimate: string;
|
|
152
|
-
amount_out: string;
|
|
153
|
-
}>;
|
|
154
|
-
}, "strip", z.ZodTypeAny, {
|
|
155
|
-
result: {
|
|
156
|
-
gas_estimate: string;
|
|
157
|
-
amount_out: string;
|
|
158
|
-
};
|
|
159
|
-
}, {
|
|
160
|
-
result: {
|
|
161
|
-
gas_estimate: string;
|
|
162
|
-
amount_out: string;
|
|
163
|
-
};
|
|
164
|
-
}>;
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
v3ExactOutputSingle: {
|
|
168
|
-
description: "Get a quote for an exact output single V3 swap";
|
|
169
|
-
query: z.ZodObject<{
|
|
170
|
-
chainId: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>>;
|
|
171
|
-
}, "strip", z.ZodTypeAny, {
|
|
172
|
-
chainId: number;
|
|
173
|
-
}, {
|
|
174
|
-
chainId?: number | undefined;
|
|
175
|
-
}>;
|
|
176
|
-
method: "POST";
|
|
177
|
-
body: z.ZodObject<{
|
|
178
|
-
token_in: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
179
|
-
token_out: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
180
|
-
amount_out: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
181
|
-
fee: z.ZodNumber;
|
|
182
|
-
}, "strip", z.ZodTypeAny, {
|
|
183
|
-
fee: number;
|
|
184
|
-
amount_out: bigint;
|
|
185
|
-
token_in: `0x${string}`;
|
|
186
|
-
token_out: `0x${string}`;
|
|
187
|
-
}, {
|
|
188
|
-
fee: number;
|
|
189
|
-
token_in: string;
|
|
190
|
-
token_out: string;
|
|
191
|
-
amount_out?: any;
|
|
192
|
-
}>;
|
|
193
|
-
path: "/quotes/v3/exact-output-single";
|
|
194
|
-
responses: {
|
|
195
|
-
200: z.ZodObject<{
|
|
196
|
-
result: z.ZodObject<{
|
|
197
|
-
amount_in: z.ZodString;
|
|
198
|
-
sqrt_price_x96_after: z.ZodString;
|
|
199
|
-
initialized_ticks_crossed: z.ZodNumber;
|
|
200
|
-
gas_estimate: z.ZodString;
|
|
201
|
-
}, "strip", z.ZodTypeAny, {
|
|
202
|
-
amount_in: string;
|
|
203
|
-
gas_estimate: string;
|
|
204
|
-
sqrt_price_x96_after: string;
|
|
205
|
-
initialized_ticks_crossed: number;
|
|
206
|
-
}, {
|
|
207
|
-
amount_in: string;
|
|
208
|
-
gas_estimate: string;
|
|
209
|
-
sqrt_price_x96_after: string;
|
|
210
|
-
initialized_ticks_crossed: number;
|
|
211
|
-
}>;
|
|
212
|
-
}, "strip", z.ZodTypeAny, {
|
|
213
|
-
result: {
|
|
214
|
-
amount_in: string;
|
|
215
|
-
gas_estimate: string;
|
|
216
|
-
sqrt_price_x96_after: string;
|
|
217
|
-
initialized_ticks_crossed: number;
|
|
218
|
-
};
|
|
219
|
-
}, {
|
|
220
|
-
result: {
|
|
221
|
-
amount_in: string;
|
|
222
|
-
gas_estimate: string;
|
|
223
|
-
sqrt_price_x96_after: string;
|
|
224
|
-
initialized_ticks_crossed: number;
|
|
225
|
-
};
|
|
226
|
-
}>;
|
|
227
|
-
};
|
|
228
|
-
};
|
|
229
|
-
v3ExactInputSingle: {
|
|
230
|
-
description: "Get a quote for an exact input single V3 swap";
|
|
231
|
-
query: z.ZodObject<{
|
|
232
|
-
chainId: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodNumber, number, number>>>;
|
|
233
|
-
}, "strip", z.ZodTypeAny, {
|
|
234
|
-
chainId: number;
|
|
235
|
-
}, {
|
|
236
|
-
chainId?: number | undefined;
|
|
237
|
-
}>;
|
|
238
|
-
method: "POST";
|
|
239
|
-
body: z.ZodObject<{
|
|
240
|
-
token_in: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
241
|
-
token_out: z.ZodPipeline<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
|
|
242
|
-
amount_in: z.ZodEffects<z.ZodAny, bigint, any>;
|
|
243
|
-
fee: z.ZodNumber;
|
|
244
|
-
sqrt_price_limit_x96: z.ZodOptional<z.ZodEffects<z.ZodAny, bigint, any>>;
|
|
245
|
-
}, "strip", z.ZodTypeAny, {
|
|
246
|
-
fee: number;
|
|
247
|
-
amount_in: bigint;
|
|
248
|
-
token_in: `0x${string}`;
|
|
249
|
-
token_out: `0x${string}`;
|
|
250
|
-
sqrt_price_limit_x96?: bigint | undefined;
|
|
251
|
-
}, {
|
|
252
|
-
fee: number;
|
|
253
|
-
token_in: string;
|
|
254
|
-
token_out: string;
|
|
255
|
-
amount_in?: any;
|
|
256
|
-
sqrt_price_limit_x96?: any;
|
|
257
|
-
}>;
|
|
258
|
-
path: "/quotes/v3/exact-input-single";
|
|
259
|
-
responses: {
|
|
260
|
-
200: z.ZodObject<{
|
|
261
|
-
result: z.ZodObject<{
|
|
262
|
-
amount_out: z.ZodString;
|
|
263
|
-
sqrt_price_x96_after: z.ZodString;
|
|
264
|
-
initialized_ticks_crossed: z.ZodNumber;
|
|
265
|
-
gas_estimate: z.ZodString;
|
|
266
|
-
}, "strip", z.ZodTypeAny, {
|
|
267
|
-
gas_estimate: string;
|
|
268
|
-
amount_out: string;
|
|
269
|
-
sqrt_price_x96_after: string;
|
|
270
|
-
initialized_ticks_crossed: number;
|
|
271
|
-
}, {
|
|
272
|
-
gas_estimate: string;
|
|
273
|
-
amount_out: string;
|
|
274
|
-
sqrt_price_x96_after: string;
|
|
275
|
-
initialized_ticks_crossed: number;
|
|
276
|
-
}>;
|
|
277
|
-
}, "strip", z.ZodTypeAny, {
|
|
278
|
-
result: {
|
|
279
|
-
gas_estimate: string;
|
|
280
|
-
amount_out: string;
|
|
281
|
-
sqrt_price_x96_after: string;
|
|
282
|
-
initialized_ticks_crossed: number;
|
|
283
|
-
};
|
|
284
|
-
}, {
|
|
285
|
-
result: {
|
|
286
|
-
gas_estimate: string;
|
|
287
|
-
amount_out: string;
|
|
288
|
-
sqrt_price_x96_after: string;
|
|
289
|
-
initialized_ticks_crossed: number;
|
|
290
|
-
};
|
|
291
|
-
}>;
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
export { quoteContract };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.quoteContract = 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 quoteContract = contract.router({
|
|
9
|
-
v4ExactOutputSingle: {
|
|
10
|
-
method: "POST",
|
|
11
|
-
path: "/v4/exact-output-single",
|
|
12
|
-
query: zod_1.default.object({
|
|
13
|
-
chainId: zod_1.default.coerce
|
|
14
|
-
.number()
|
|
15
|
-
.int()
|
|
16
|
-
.refine((val) => Object.values(types_1.ChainID).includes(val), {
|
|
17
|
-
message: "Invalid chain ID",
|
|
18
|
-
})
|
|
19
|
-
.optional()
|
|
20
|
-
.default(types_1.ChainID.BASE_MAINNET)
|
|
21
|
-
.describe("The chain ID of the quote to get"),
|
|
22
|
-
}),
|
|
23
|
-
body: zod_1.default.object({
|
|
24
|
-
pool_key: types_1.poolKeySchema,
|
|
25
|
-
zero_for_one: zod_1.default.boolean(),
|
|
26
|
-
exact_amount: types_1.coerceBigInt,
|
|
27
|
-
hook_data: zod_1.default.optional(zod_1.default.string()),
|
|
28
|
-
}),
|
|
29
|
-
responses: {
|
|
30
|
-
200: zod_1.default.object({
|
|
31
|
-
result: zod_1.default.object({
|
|
32
|
-
amount_in: zod_1.default.string(),
|
|
33
|
-
gas_estimate: zod_1.default.string(),
|
|
34
|
-
}),
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
description: "Get a quote for an exact output single V4 swap",
|
|
38
|
-
},
|
|
39
|
-
v4ExactInputSingle: {
|
|
40
|
-
method: "POST",
|
|
41
|
-
path: "/v4/exact-input-single",
|
|
42
|
-
query: zod_1.default.object({
|
|
43
|
-
chainId: zod_1.default.coerce
|
|
44
|
-
.number()
|
|
45
|
-
.int()
|
|
46
|
-
.refine((val) => Object.values(types_1.ChainID).includes(val), {
|
|
47
|
-
message: "Invalid chain ID",
|
|
48
|
-
})
|
|
49
|
-
.optional()
|
|
50
|
-
.default(types_1.ChainID.BASE_MAINNET)
|
|
51
|
-
.describe("The chain ID of the quote to get"),
|
|
52
|
-
}),
|
|
53
|
-
body: zod_1.default.object({
|
|
54
|
-
pool_key: types_1.poolKeySchema,
|
|
55
|
-
zero_for_one: zod_1.default.boolean(),
|
|
56
|
-
exact_amount: types_1.coerceBigInt,
|
|
57
|
-
hook_data: zod_1.default.optional(zod_1.default.string()),
|
|
58
|
-
}),
|
|
59
|
-
responses: {
|
|
60
|
-
200: zod_1.default.object({
|
|
61
|
-
result: zod_1.default.object({
|
|
62
|
-
amount_out: zod_1.default.string(),
|
|
63
|
-
gas_estimate: zod_1.default.string(),
|
|
64
|
-
}),
|
|
65
|
-
}),
|
|
66
|
-
},
|
|
67
|
-
description: "Get a quote for an exact input single V4 swap",
|
|
68
|
-
},
|
|
69
|
-
v3ExactOutputSingle: {
|
|
70
|
-
method: "POST",
|
|
71
|
-
path: "/v3/exact-output-single",
|
|
72
|
-
query: zod_1.default.object({
|
|
73
|
-
chainId: zod_1.default.coerce
|
|
74
|
-
.number()
|
|
75
|
-
.int()
|
|
76
|
-
.refine((val) => Object.values(types_1.ChainID).includes(val), {
|
|
77
|
-
message: "Invalid chain ID",
|
|
78
|
-
})
|
|
79
|
-
.optional()
|
|
80
|
-
.default(types_1.ChainID.BASE_MAINNET)
|
|
81
|
-
.describe("The chain ID of the quote to get"),
|
|
82
|
-
}),
|
|
83
|
-
body: zod_1.default.object({
|
|
84
|
-
token_in: zod_1.default.string().pipe(types_1.hex),
|
|
85
|
-
token_out: zod_1.default.string().pipe(types_1.hex),
|
|
86
|
-
amount_out: types_1.coerceBigInt,
|
|
87
|
-
fee: zod_1.default.number(),
|
|
88
|
-
}),
|
|
89
|
-
responses: {
|
|
90
|
-
200: zod_1.default.object({
|
|
91
|
-
result: zod_1.default.object({
|
|
92
|
-
amount_in: zod_1.default.string(),
|
|
93
|
-
sqrt_price_x96_after: zod_1.default.string(),
|
|
94
|
-
initialized_ticks_crossed: zod_1.default.number(),
|
|
95
|
-
gas_estimate: zod_1.default.string(),
|
|
96
|
-
}),
|
|
97
|
-
}),
|
|
98
|
-
},
|
|
99
|
-
description: "Get a quote for an exact output single V3 swap",
|
|
100
|
-
},
|
|
101
|
-
v3ExactInputSingle: {
|
|
102
|
-
method: "POST",
|
|
103
|
-
path: "/v3/exact-input-single",
|
|
104
|
-
query: zod_1.default.object({
|
|
105
|
-
chainId: zod_1.default.coerce
|
|
106
|
-
.number()
|
|
107
|
-
.int()
|
|
108
|
-
.refine((val) => Object.values(types_1.ChainID).includes(val), {
|
|
109
|
-
message: "Invalid chain ID",
|
|
110
|
-
})
|
|
111
|
-
.optional()
|
|
112
|
-
.default(types_1.ChainID.BASE_MAINNET)
|
|
113
|
-
.describe("The chain ID of the quote to get"),
|
|
114
|
-
}),
|
|
115
|
-
body: zod_1.default.object({
|
|
116
|
-
token_in: zod_1.default.string().pipe(types_1.hex),
|
|
117
|
-
token_out: zod_1.default.string().pipe(types_1.hex),
|
|
118
|
-
amount_in: types_1.coerceBigInt,
|
|
119
|
-
fee: zod_1.default.number(),
|
|
120
|
-
sqrt_price_limit_x96: zod_1.default.optional(types_1.coerceBigInt),
|
|
121
|
-
}),
|
|
122
|
-
responses: {
|
|
123
|
-
200: zod_1.default.object({
|
|
124
|
-
result: zod_1.default.object({
|
|
125
|
-
amount_out: zod_1.default.string(),
|
|
126
|
-
sqrt_price_x96_after: zod_1.default.string(),
|
|
127
|
-
initialized_ticks_crossed: zod_1.default.number(),
|
|
128
|
-
gas_estimate: zod_1.default.string(),
|
|
129
|
-
}),
|
|
130
|
-
}),
|
|
131
|
-
},
|
|
132
|
-
description: "Get a quote for an exact input single V3 swap",
|
|
133
|
-
},
|
|
134
|
-
}, {
|
|
135
|
-
pathPrefix: "/quotes",
|
|
136
|
-
});
|
|
137
|
-
exports.quoteContract = quoteContract;
|
|
138
|
-
//# sourceMappingURL=quote.contract.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quote.contract.js","sourceRoot":"","sources":["../../src/contracts/quote.contract.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AAC7C,6BAAoB;AAEpB,oCAAqE;AAErE,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,KAAK,EAAE,aAAC,CAAC,MAAM,CAAC;YACZ,OAAO,EAAE,aAAC,CAAC,MAAM;iBACZ,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,eAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACnD,OAAO,EAAE,kBAAkB;aAC9B,CAAC;iBACD,QAAQ,EAAE;iBACV,OAAO,CAAC,eAAO,CAAC,YAAY,CAAC;iBAC7B,QAAQ,CAAC,kCAAkC,CAAC;SACpD,CAAC;QACF,IAAI,EAAE,aAAC,CAAC,MAAM,CAAC;YACX,QAAQ,EAAE,qBAAa;YACvB,YAAY,EAAE,aAAC,CAAC,OAAO,EAAE;YACzB,YAAY,EAAE,oBAAY;YAC1B,SAAS,EAAE,aAAC,CAAC,QAAQ,CAAC,aAAC,CAAC,MAAM,EAAE,CAAC;SACpC,CAAC;QACF,SAAS,EAAE;YACP,GAAG,E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