Skip to content

Commit 0438cc9

Browse files
fix: adding requestID to solve api (#178)
1 parent 30c2d0b commit 0438cc9

File tree

2 files changed

+80
-38
lines changed

2 files changed

+80
-38
lines changed

docs/CHANGELOG.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22

33
## [0.3.8](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.7...docs-v0.3.8) (2025-06-30)
44

5-
65
### Bug Fixes
76

8-
* update solve api example ([#175](https://github.com/sprintertech/sprinter-sdk/issues/175)) ([9dbfbd8](https://github.com/sprintertech/sprinter-sdk/commit/9dbfbd8763e13b050e0bc3ca33414f6016a48cb4))
7+
- update solve api example ([#175](https://github.com/sprintertech/sprinter-sdk/issues/175)) ([9dbfbd8](https://github.com/sprintertech/sprinter-sdk/commit/9dbfbd8763e13b050e0bc3ca33414f6016a48cb4))
98

109
## [0.3.7](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.6...docs-v0.3.7) (2025-06-26)
1110

12-
1311
### Bug Fixes
1412

15-
* broken links solve v1 ([#169](https://github.com/sprintertech/sprinter-sdk/issues/169)) ([34be02b](https://github.com/sprintertech/sprinter-sdk/commit/34be02b69ef86a3b7cb9d27ec1bb24f69889be40))
13+
- broken links solve v1 ([#169](https://github.com/sprintertech/sprinter-sdk/issues/169)) ([34be02b](https://github.com/sprintertech/sprinter-sdk/commit/34be02b69ef86a3b7cb9d27ec1bb24f69889be40))
1614

1715
## [0.3.6](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.5...docs-v0.3.6) (2025-06-12)
1816

19-
2017
### Bug Fixes
2118

22-
* update to solve-openapi.yaml to match updated OpenAPI spec ([#167](https://github.com/sprintertech/sprinter-sdk/issues/167)) ([b79e4cc](https://github.com/sprintertech/sprinter-sdk/commit/b79e4cc7ce82df46bb8a6894b11f379dd6536dbb))
19+
- update to solve-openapi.yaml to match updated OpenAPI spec ([#167](https://github.com/sprintertech/sprinter-sdk/issues/167)) ([b79e4cc](https://github.com/sprintertech/sprinter-sdk/commit/b79e4cc7ce82df46bb8a6894b11f379dd6536dbb))
2320

2421
## [0.3.5](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.4...docs-v0.3.5) (2025-05-28)
2522

docs/docs/03-Solve/get-route-v-1.api.mdx

Lines changed: 77 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,11 @@ import OperationTabs from "@theme/OperationTabs";
1919
import TabItem from "@theme/TabItem";
2020
import Heading from "@theme/Heading";
2121

22-
<Heading
23-
as={"h1"}
24-
className={"openapi__heading"}
25-
children={"Get the executable swap route"}
26-
></Heading>
22+
<Heading as={"h1"} className={"openapi__heading"} children={"getRouteV1"}></Heading>
2723

2824
<MethodEndpoint method={"get"} path={"/v1/route"} context={"endpoint"}></MethodEndpoint>
2925

30-
Get the **finalized execution package** returned by `/v1/route` which contains all necessary data to execute a transaction. It builds on a quote by including calldata, selected liquidity paths, slippage tolerances, and chain-specific details.
31-
32-
Routes are consumed directly by solvers or smart contracts to simulate and execute cross-chain swaps or intent fills.
26+
Calculate the optimal swap route and generate execution parameters for a token exchange
3327

3428
<Heading
3529
id={"request"}
@@ -43,43 +37,40 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
4337
{
4438
in: "query",
4539
name: "amountIn",
46-
description: "The amount of tokens to sell in decimal notation",
40+
description: "The amount of input tokens to swap (in token's smallest unit)",
4741
schema: {
4842
description: "Amount of an ERC20 token as a decimal string (no scientific notation)",
4943
type: "string",
5044
pattern: "^[0-9]+$",
51-
example: "1000000000000000000",
5245
title: "TokenAmount",
5346
},
5447
required: true,
55-
example: "1000000000000000000",
5648
},
5749
{
5850
in: "query",
5951
name: "tokenIn",
60-
description: "Contract address of the input token to sell",
52+
description:
53+
"Contract address of the input token to sell. The zero address (0x00…00) represents the native currency ETH.",
6154
schema: {
6255
description: "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix",
6356
type: "string",
6457
pattern: "^0x[a-fA-F0-9]{40}$",
65-
example: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
6658
title: "Address",
6759
},
6860
required: true,
69-
example: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
7061
},
7162
{
7263
in: "query",
7364
name: "tokenOut",
74-
description: "Contract address of the output token to buy",
65+
description:
66+
"Contract address of the output token to buy. The zero address (0x00…00) represents the native currency ETH.",
7567
schema: {
7668
description: "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix",
7769
type: "string",
7870
pattern: "^0x[a-fA-F0-9]{40}$",
7971
title: "Address",
8072
},
8173
required: true,
82-
example: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
8374
},
8475
{
8576
in: "query",
@@ -93,7 +84,6 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
9384
default: 50,
9485
},
9586
required: false,
96-
example: 50,
9787
},
9888
]}
9989
></ParamsDetails>
@@ -108,11 +98,14 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
10898
description: "Successfully calculated swap route with execution details",
10999
headers: {
110100
"Request-ID": {
111-
description: "Unique request identifier",
101+
description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
112102
schema: {
103+
description:
104+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
113105
type: "string",
114106
format: "hex",
115-
pattern: "^0x[a-fA-F0-9]{24}$",
107+
pattern: "^0x[a-fA-F0-9]{32}$",
108+
title: "RequestID",
116109
},
117110
},
118111
},
@@ -121,8 +114,16 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
121114
schema: {
122115
description: "Successfully created route with execution details",
123116
type: "object",
124-
required: ["amountOut", "minAmountOut", "target", "callData"],
117+
required: ["requestId", "amountOut", "minAmountOut", "target", "callData"],
125118
properties: {
119+
requestId: {
120+
description:
121+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
122+
type: "string",
123+
format: "hex",
124+
pattern: "^0x[a-fA-F0-9]{32}$",
125+
title: "RequestID",
126+
},
126127
amountOut: {
127128
description:
128129
"Amount of an ERC20 token as a decimal string (no scientific notation)",
@@ -160,11 +161,14 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
160161
description: "Bad request due to invalid parameters",
161162
headers: {
162163
"Request-ID": {
163-
description: "Unique request identifier",
164+
description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
164165
schema: {
166+
description:
167+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
165168
type: "string",
166169
format: "hex",
167-
pattern: "^0x[a-fA-F0-9]{24}$",
170+
pattern: "^0x[a-fA-F0-9]{32}$",
171+
title: "RequestID",
168172
},
169173
},
170174
},
@@ -173,12 +177,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
173177
schema: {
174178
description: "Error response with details",
175179
type: "object",
176-
required: ["code", "error"],
180+
required: ["code", "requestId", "error"],
177181
properties: {
178182
code: {
179183
description: "Error code indicating the type of error",
180184
type: "integer",
181185
},
186+
requestId: {
187+
description:
188+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
189+
type: "string",
190+
format: "hex",
191+
pattern: "^0x[a-fA-F0-9]{32}$",
192+
title: "RequestID",
193+
},
182194
error: { description: "Error message", type: "string" },
183195
},
184196
title: "Error",
@@ -190,11 +202,14 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
190202
description: "Unauthorized access due to invalid or missing credentials",
191203
headers: {
192204
"Request-ID": {
193-
description: "Unique request identifier",
205+
description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
194206
schema: {
207+
description:
208+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
195209
type: "string",
196210
format: "hex",
197-
pattern: "^0x[a-fA-F0-9]{24}$",
211+
pattern: "^0x[a-fA-F0-9]{32}$",
212+
title: "RequestID",
198213
},
199214
},
200215
},
@@ -203,12 +218,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
203218
schema: {
204219
description: "Error response with details",
205220
type: "object",
206-
required: ["code", "error"],
221+
required: ["code", "requestId", "error"],
207222
properties: {
208223
code: {
209224
description: "Error code indicating the type of error",
210225
type: "integer",
211226
},
227+
requestId: {
228+
description:
229+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
230+
type: "string",
231+
format: "hex",
232+
pattern: "^0x[a-fA-F0-9]{32}$",
233+
title: "RequestID",
234+
},
212235
error: { description: "Error message", type: "string" },
213236
},
214237
title: "Error",
@@ -220,11 +243,14 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
220243
description: "No viable swap route found for the given parameters",
221244
headers: {
222245
"Request-ID": {
223-
description: "Unique request identifier",
246+
description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
224247
schema: {
248+
description:
249+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
225250
type: "string",
226251
format: "hex",
227-
pattern: "^0x[a-fA-F0-9]{24}$",
252+
pattern: "^0x[a-fA-F0-9]{32}$",
253+
title: "RequestID",
228254
},
229255
},
230256
},
@@ -233,12 +259,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
233259
schema: {
234260
description: "Error response with details",
235261
type: "object",
236-
required: ["code", "error"],
262+
required: ["code", "requestId", "error"],
237263
properties: {
238264
code: {
239265
description: "Error code indicating the type of error",
240266
type: "integer",
241267
},
268+
requestId: {
269+
description:
270+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
271+
type: "string",
272+
format: "hex",
273+
pattern: "^0x[a-fA-F0-9]{32}$",
274+
title: "RequestID",
275+
},
242276
error: { description: "Error message", type: "string" },
243277
},
244278
title: "Error",
@@ -250,11 +284,14 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
250284
description: "Internal server error",
251285
headers: {
252286
"Request-ID": {
253-
description: "Unique request identifier",
287+
description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
254288
schema: {
289+
description:
290+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
255291
type: "string",
256292
format: "hex",
257-
pattern: "^0x[a-fA-F0-9]{24}$",
293+
pattern: "^0x[a-fA-F0-9]{32}$",
294+
title: "RequestID",
258295
},
259296
},
260297
},
@@ -263,12 +300,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu
263300
schema: {
264301
description: "Error response with details",
265302
type: "object",
266-
required: ["code", "error"],
303+
required: ["code", "requestId", "error"],
267304
properties: {
268305
code: {
269306
description: "Error code indicating the type of error",
270307
type: "integer",
271308
},
309+
requestId: {
310+
description:
311+
"Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix",
312+
type: "string",
313+
format: "hex",
314+
pattern: "^0x[a-fA-F0-9]{32}$",
315+
title: "RequestID",
316+
},
272317
error: { description: "Error message", type: "string" },
273318
},
274319
title: "Error",

0 commit comments

Comments
 (0)