Skip to content

Commit b79e4cc

Browse files
itsbobbyzzz168MakMufticBeroBurny
authored
fix: update to solve-openapi.yaml to match updated OpenAPI spec (#167)
Reflected changes to https://github.com/sprintertech/ass/blob/dev/swap/openapi.yml on docs.sprinter.tech Added latest Spearbit/Cantina audit Closes sprintertech/ass#1087 --------- Co-authored-by: MakMuftic <[email protected]> Co-authored-by: BeroBurny <[email protected]>
1 parent 4b5b9c3 commit b79e4cc

File tree

9 files changed

+771
-775
lines changed

9 files changed

+771
-775
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.5](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.4...docs-v0.3.5) (2025-05-28)
44

5-
65
### Bug Fixes
76

8-
* **docs:** adding router addresses ([#163](https://github.com/sprintertech/sprinter-sdk/issues/163)) ([ff7f939](https://github.com/sprintertech/sprinter-sdk/commit/ff7f939bf87b6730fb5cdf409f1541c2c4aa95b7))
7+
- **docs:** adding router addresses ([#163](https://github.com/sprintertech/sprinter-sdk/issues/163)) ([ff7f939](https://github.com/sprintertech/sprinter-sdk/commit/ff7f939bf87b6730fb5cdf409f1541c2c4aa95b7))
98

109
## [0.3.4](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.3...docs-v0.3.4) (2025-05-27)
1110

12-
1311
### Bug Fixes
1412

15-
* **docs:** typos ([#161](https://github.com/sprintertech/sprinter-sdk/issues/161)) ([9f5c2f0](https://github.com/sprintertech/sprinter-sdk/commit/9f5c2f09d873bff398fa350d91f36829c9ba6220))
13+
- **docs:** typos ([#161](https://github.com/sprintertech/sprinter-sdk/issues/161)) ([9f5c2f0](https://github.com/sprintertech/sprinter-sdk/commit/9f5c2f09d873bff398fa350d91f36829c9ba6220))
1614

1715
## [0.3.3](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.2...docs-v0.3.3) (2025-05-21)
1816

19-
2017
### Bug Fixes
2118

22-
* added MPC details ([#159](https://github.com/sprintertech/sprinter-sdk/issues/159)) ([16fc0a2](https://github.com/sprintertech/sprinter-sdk/commit/16fc0a28ff7925c2643a313d572773d10f1b4619))
19+
- added MPC details ([#159](https://github.com/sprintertech/sprinter-sdk/issues/159)) ([16fc0a2](https://github.com/sprintertech/sprinter-sdk/commit/16fc0a28ff7925c2643a313d572773d10f1b4619))
2320

2421
## [0.3.2](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.1...docs-v0.3.2) (2025-05-16)
2522

docs/docs/03-Solve/02-solve-quick-start.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ flowchart TD
2929
F --> G[Send Transaction & Finalize Fill]
3030
3131
32-
click E "solve-get-route-v2" "Borrow Quote"
32+
33+
click E "solve-get-route-v1" "Borrow Quote"
3334
style E fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold
3435
3536
```
@@ -38,7 +39,7 @@ style E fill:#FF9B43,stroke:#333,stroke-width:2px,color:#000,font-weight:bold
3839

3940
## 2. Geting the finalized route and call data execution package
4041

41-
Calling the [**Get Route API**](solve-get-route-v2) returns the finalized route, including call data, gas estimates and token out amounts. Use this executable call data `swap_call_data` after verifying a quote.
42+
Calling the [**Get Route API**](solve-get-route-v1) returns the finalized route, including call data, gas estimates and token out amounts. Use this executable call data `swap_call_data` after verifying a quote.
4243

4344
- **Mainnet:** `https://swaps.sprinter.tech/mainnet`
4445
- **Base:** `https://swaps.sprinter.tech/base`
@@ -68,7 +69,7 @@ const fetchRoute = async () => {
6869

6970
## 3. Send transaction using `swap_call_data`
7071

71-
Once you've received a valid route from `/v2/route`, you'll use the `swap_call_data` in a transaction to execute the intent on-chain.
72+
Once you've received a valid route from `/v1/route`, you'll use the `swap_call_data` in a transaction to execute the intent on-chain.
7273

7374
Below is a simplified example using `ethers.js` to send the transaction from a connected signer:
7475

@@ -78,7 +79,7 @@ import { ethers } from "ethers";
7879
const provider = new ethers.JsonRpcProvider("https://mainnet.base.org"); // or OP/Arbitrum
7980
const signer = new ethers.Wallet("<PRIVATE_KEY>", provider);
8081

81-
const routeResponse = await fetch("https://swaps.sprinter.tech/base/v2/route", {
82+
const routeResponse = await fetch("https://swaps.sprinter.tech/base/1/route", {
8283
method: "POST",
8384
headers: {
8485
"Content-Type": "application/json",
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
---
2+
id: solve-get-route-v1
3+
title: "Get Route V1 API"
4+
description: "Calculate the optimal swap route and generate execution parameters for a token exchange"
5+
sidebar_label: "Get Route API V1 "
6+
hide_title: true
7+
hide_table_of_contents: true
8+
api: eJztWEtvGzcQ/isEkaJOu5bWrn2obnLitj60DeykF0MFRtyRlskuuSaHilRh/3sx5OplKc4LAVI3N4mcnfnmmwfJWUrboAPS1lwVciCnSNc2EP51IjNZoFdON7wpB/IZVCpUQCioRGEb0jVUwr+FRjj+RIApxBQNq0OBc1SBvxQNOKiR0HkxsU6AIPsGjcC5KsFMUWZyIyEHt0up2dpdQLeQmTRQoxxIqG0wdGX2UL0sUaRNYSdCmyZQMuAF2YTuSJu09L0XvoaqQk8iGE1PZSa9KrEGOVje0ztc6wQjLq+fneYdbvACRIEqeU9Om6k4MlZ4pdGQnmgljKXIKOunRcP4k2D0lQgdW/j7Nj/+efTjExbSVLHUS7aQLMs2kw7vgnZYyAG5gG12mJoI6wAzz6whB4oEFIVD79kXjtwWR5EirKoHeLikEh2GWqj76o5OczFeEPqnAo2yBRbMTYlzWLHzVlMp8rloHE70/GEy8vktHE+Gx78wKcuzvN3mZZhMfiQnfwb6YFJsoB1WxmHx6EjxlW4amOJF4w+W0WpfkK3QgVGcK2IMXnvRWG3IiyPsTXuZOM9jKee98+92a6jzRRvCKTqZyYl1NVBa+ulUZrLWRtehloM8kzXM0++TPM9zhjSBUJEcnOc7Tk2g8tiOeMk31nj0bOs0z/cjcxOUQu8noaoWQq06VrHdpmIANu2pQAJdMSMlQhF70FJe411AT8dXz/dNvDL6LqBwSUToIpV9dHePiXVU10SUOH8oyKdn7RPZtm0mObfQECuDpqm0ij2l/9oziuU7c3OXAYfR/fd43oG149eouGY21N92nTfVUq277pT+Ergp8g8FVfUcCOQok43jE4V0CtLm66+yw+449FUi7Dj+6lvQOgX2kP6G8zUQliqAILYP7rtclx8B4Idt6xfspORSWa10V5frrk1wHbWZPDvUKC6gWJdwEbjnCW1mUOli68LyaJrCpXPWiVX7TAnwYeXPcZOZRFawX95x9x3WeE9oU0SMZhrDzZa4npK67P550a4MvUNljd5DvDLuMrmdA1FyHfmTQ6GCQKV1+h+ujNgs72cAm9LeM2rlMMYSHtER8b/NhrN9VX9YMdMwrnD7ijCxwRTrHjXVMzTfusKjyYPzQ+fBlWGS+ThHN0O3xvIt0v/ZSPP9Dqm03VwjEVzKgezPTvqx0Dk4Mdxp8BBcxbEgavyg3+d+4Hu+cYzO9QhV2a9BG4P7z8rf07q44R4yfHEl+Q32fnVj8Lin6wI8bikaMUYVnKZFBHkBXqthYEduR9u7Nxz7FJYtmXXSMY5VMvJ/ftepyJw2ExsFOwaj7fFCXFRg1B684YsrETwWa4mIVWaSaUwiJ728lx+PkYAj2lhPNcT07B6iUyQRr2pif8y03KT4F5w4dZwQzqnfVKANA43xWnZJcitnjC2lySiTpfXEq8slB+2Vq9qWl9MTm+NSaM/HyOq5+oBbR9ddfT0Vnzu9OujHG1zsTsxmUAUWi1n5STg/bpb0AKrNsOrLgTo8y3kfqPSk/URUnzU+eQDZ7shmA27Ef1y8t8Q2sDqnYiamT4dKYbPt0t55wVrWDfLXy5eybf8FfAyYow==
9+
sidebar_class_name: "get api-method"
10+
info_path: ../src/api/generated/solve/swap-by-blanc
11+
custom_edit_url: null
12+
---
13+
14+
import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";
15+
import ParamsDetails from "@theme/ParamsDetails";
16+
import RequestSchema from "@theme/RequestSchema";
17+
import StatusCodes from "@theme/StatusCodes";
18+
import OperationTabs from "@theme/OperationTabs";
19+
import TabItem from "@theme/TabItem";
20+
import Heading from "@theme/Heading";
21+
22+
<Heading
23+
as={"h1"}
24+
className={"openapi__heading"}
25+
children={"Get the executable swap route"}
26+
></Heading>
27+
28+
<MethodEndpoint method={"get"} path={"/v1/route"} context={"endpoint"}></MethodEndpoint>
29+
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.
33+
34+
<Heading
35+
id={"request"}
36+
as={"h2"}
37+
className={"openapi-tabs__heading"}
38+
children={"Request"}
39+
></Heading>
40+
41+
<ParamsDetails
42+
parameters={[
43+
{
44+
in: "query",
45+
name: "amountIn",
46+
description: "The amount of tokens to sell in decimal notation",
47+
schema: {
48+
description: "Amount of an ERC20 token as a decimal string (no scientific notation)",
49+
type: "string",
50+
pattern: "^[0-9]+$",
51+
example: "1000000000000000000",
52+
title: "TokenAmount",
53+
},
54+
required: true,
55+
example: "1000000000000000000",
56+
},
57+
{
58+
in: "query",
59+
name: "tokenIn",
60+
description: "Contract address of the input token to sell",
61+
schema: {
62+
description: "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix",
63+
type: "string",
64+
pattern: "^0x[a-fA-F0-9]{40}$",
65+
example: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
66+
title: "Address",
67+
},
68+
required: true,
69+
example: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
70+
},
71+
{
72+
in: "query",
73+
name: "tokenOut",
74+
description: "Contract address of the output token to buy",
75+
schema: {
76+
description: "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix",
77+
type: "string",
78+
pattern: "^0x[a-fA-F0-9]{40}$",
79+
title: "Address",
80+
},
81+
required: true,
82+
example: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
83+
},
84+
{
85+
in: "query",
86+
name: "slippageBps",
87+
description: "The slippage tolerance in basis points (e.g., 50 for 0.5%)",
88+
schema: {
89+
type: "integer",
90+
format: "int32",
91+
minimum: 0,
92+
maximum: 10000,
93+
default: 50,
94+
},
95+
required: false,
96+
example: 50,
97+
},
98+
]}
99+
></ParamsDetails>
100+
101+
<RequestSchema title={"Body"} body={undefined}></RequestSchema>
102+
103+
<StatusCodes
104+
id={undefined}
105+
label={undefined}
106+
responses={{
107+
"200": {
108+
description: "Successfully calculated swap route with execution details",
109+
headers: {
110+
"Request-ID": {
111+
description: "Unique request identifier",
112+
schema: {
113+
type: "string",
114+
format: "hex",
115+
pattern: "^0x[a-fA-F0-9]{24}$",
116+
},
117+
},
118+
},
119+
content: {
120+
"application/json": {
121+
schema: {
122+
description: "Successfully created route with execution details",
123+
type: "object",
124+
required: ["amountOut", "minAmountOut", "target", "callData"],
125+
properties: {
126+
amountOut: {
127+
description:
128+
"Amount of an ERC20 token as a decimal string (no scientific notation)",
129+
type: "string",
130+
pattern: "^[0-9]+$",
131+
title: "TokenAmount",
132+
},
133+
minAmountOut: {
134+
description:
135+
"Amount of an ERC20 token as a decimal string (no scientific notation)",
136+
type: "string",
137+
pattern: "^[0-9]+$",
138+
title: "TokenAmount",
139+
},
140+
target: {
141+
description:
142+
"Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix",
143+
type: "string",
144+
pattern: "^0x[a-fA-F0-9]{40}$",
145+
title: "Address",
146+
},
147+
callData: {
148+
description: "Hex encoded calldata for the swap",
149+
type: "string",
150+
pattern: "^0x[a-fA-F0-9]*$",
151+
title: "Bytes",
152+
},
153+
},
154+
title: "RouteV1Response",
155+
},
156+
},
157+
},
158+
},
159+
"400": {
160+
description: "Bad request due to invalid parameters",
161+
headers: {
162+
"Request-ID": {
163+
description: "Unique request identifier",
164+
schema: {
165+
type: "string",
166+
format: "hex",
167+
pattern: "^0x[a-fA-F0-9]{24}$",
168+
},
169+
},
170+
},
171+
content: {
172+
"application/json": {
173+
schema: {
174+
description: "Error response with details",
175+
type: "object",
176+
required: ["code", "error"],
177+
properties: {
178+
code: {
179+
description: "Error code indicating the type of error",
180+
type: "integer",
181+
},
182+
error: { description: "Error message", type: "string" },
183+
},
184+
title: "Error",
185+
},
186+
},
187+
},
188+
},
189+
"401": {
190+
description: "Unauthorized access due to invalid or missing credentials",
191+
headers: {
192+
"Request-ID": {
193+
description: "Unique request identifier",
194+
schema: {
195+
type: "string",
196+
format: "hex",
197+
pattern: "^0x[a-fA-F0-9]{24}$",
198+
},
199+
},
200+
},
201+
content: {
202+
"application/json": {
203+
schema: {
204+
description: "Error response with details",
205+
type: "object",
206+
required: ["code", "error"],
207+
properties: {
208+
code: {
209+
description: "Error code indicating the type of error",
210+
type: "integer",
211+
},
212+
error: { description: "Error message", type: "string" },
213+
},
214+
title: "Error",
215+
},
216+
},
217+
},
218+
},
219+
"404": {
220+
description: "No viable swap route found for the given parameters",
221+
headers: {
222+
"Request-ID": {
223+
description: "Unique request identifier",
224+
schema: {
225+
type: "string",
226+
format: "hex",
227+
pattern: "^0x[a-fA-F0-9]{24}$",
228+
},
229+
},
230+
},
231+
content: {
232+
"application/json": {
233+
schema: {
234+
description: "Error response with details",
235+
type: "object",
236+
required: ["code", "error"],
237+
properties: {
238+
code: {
239+
description: "Error code indicating the type of error",
240+
type: "integer",
241+
},
242+
error: { description: "Error message", type: "string" },
243+
},
244+
title: "Error",
245+
},
246+
},
247+
},
248+
},
249+
"500": {
250+
description: "Internal server error",
251+
headers: {
252+
"Request-ID": {
253+
description: "Unique request identifier",
254+
schema: {
255+
type: "string",
256+
format: "hex",
257+
pattern: "^0x[a-fA-F0-9]{24}$",
258+
},
259+
},
260+
},
261+
content: {
262+
"application/json": {
263+
schema: {
264+
description: "Error response with details",
265+
type: "object",
266+
required: ["code", "error"],
267+
properties: {
268+
code: {
269+
description: "Error code indicating the type of error",
270+
type: "integer",
271+
},
272+
error: { description: "Error message", type: "string" },
273+
},
274+
title: "Error",
275+
},
276+
},
277+
},
278+
},
279+
}}
280+
></StatusCodes>

0 commit comments

Comments
 (0)