|
| 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