From 4bc6bb2554090749fc9f9dc0eeb6f809fa169ad4 Mon Sep 17 00:00:00 2001 From: itsbobbyz Date: Tue, 8 Jul 2025 00:30:56 +0100 Subject: [PATCH 1/2] Update get-route-v-1.api.mdx --- docs/docs/03-Solve/get-route-v-1.api.mdx | 134 +++++++++++++++++------ 1 file changed, 102 insertions(+), 32 deletions(-) diff --git a/docs/docs/03-Solve/get-route-v-1.api.mdx b/docs/docs/03-Solve/get-route-v-1.api.mdx index 0e2867e..c1498e9 100644 --- a/docs/docs/03-Solve/get-route-v-1.api.mdx +++ b/docs/docs/03-Solve/get-route-v-1.api.mdx @@ -19,17 +19,20 @@ import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; + - - -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. + -Routes are consumed directly by solvers or smart contracts to simulate and execute cross-chain swaps or intent fills. +Calculate the optimal swap route and generate execution parameters for a token exchange @@ -108,11 +111,15 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu description: "Successfully calculated swap route with execution details", headers: { "Request-ID": { - description: "Unique request identifier", + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", type: "string", format: "hex", - pattern: "^0x[a-fA-F0-9]{24}$", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", }, }, }, @@ -121,8 +128,22 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu schema: { description: "Successfully created route with execution details", type: "object", - required: ["amountOut", "minAmountOut", "target", "callData"], + required: [ + "requestId", + "amountOut", + "minAmountOut", + "target", + "callData", + ], properties: { + requestId: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + type: "string", + format: "hex", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", + }, amountOut: { description: "Amount of an ERC20 token as a decimal string (no scientific notation)", @@ -160,11 +181,15 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu description: "Bad request due to invalid parameters", headers: { "Request-ID": { - description: "Unique request identifier", + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", type: "string", format: "hex", - pattern: "^0x[a-fA-F0-9]{24}$", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", }, }, }, @@ -173,12 +198,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu schema: { description: "Error response with details", type: "object", - required: ["code", "error"], + required: ["code", "requestId", "error"], properties: { code: { description: "Error code indicating the type of error", type: "integer", }, + requestId: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + type: "string", + format: "hex", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", + }, error: { description: "Error message", type: "string" }, }, title: "Error", @@ -190,11 +223,15 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu description: "Unauthorized access due to invalid or missing credentials", headers: { "Request-ID": { - description: "Unique request identifier", + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", type: "string", format: "hex", - pattern: "^0x[a-fA-F0-9]{24}$", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", }, }, }, @@ -203,12 +240,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu schema: { description: "Error response with details", type: "object", - required: ["code", "error"], + required: ["code", "requestId", "error"], properties: { code: { description: "Error code indicating the type of error", type: "integer", }, + requestId: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + type: "string", + format: "hex", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", + }, error: { description: "Error message", type: "string" }, }, title: "Error", @@ -220,11 +265,15 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu description: "No viable swap route found for the given parameters", headers: { "Request-ID": { - description: "Unique request identifier", + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", type: "string", format: "hex", - pattern: "^0x[a-fA-F0-9]{24}$", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", }, }, }, @@ -233,12 +282,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu schema: { description: "Error response with details", type: "object", - required: ["code", "error"], + required: ["code", "requestId", "error"], properties: { code: { description: "Error code indicating the type of error", type: "integer", }, + requestId: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + type: "string", + format: "hex", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", + }, error: { description: "Error message", type: "string" }, }, title: "Error", @@ -250,11 +307,15 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu description: "Internal server error", headers: { "Request-ID": { - description: "Unique request identifier", + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", type: "string", format: "hex", - pattern: "^0x[a-fA-F0-9]{24}$", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", }, }, }, @@ -263,12 +324,20 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu schema: { description: "Error response with details", type: "object", - required: ["code", "error"], + required: ["code", "requestId", "error"], properties: { code: { description: "Error code indicating the type of error", type: "integer", }, + requestId: { + description: + "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + type: "string", + format: "hex", + pattern: "^0x[a-fA-F0-9]{32}$", + title: "RequestID", + }, error: { description: "Error message", type: "string" }, }, title: "Error", @@ -278,3 +347,4 @@ Routes are consumed directly by solvers or smart contracts to simulate and execu }, }} > + From ff8fa193579f0db280d97c533c34f84c09cd2a94 Mon Sep 17 00:00:00 2001 From: itsbobbyz Date: Tue, 8 Jul 2025 00:57:56 +0100 Subject: [PATCH 2/2] run lint --- docs/CHANGELOG.md | 9 ++--- docs/docs/03-Solve/get-route-v-1.api.mdx | 49 ++++++------------------ 2 files changed, 15 insertions(+), 43 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4d25cff..6515eb3 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,24 +2,21 @@ ## [0.3.8](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.7...docs-v0.3.8) (2025-06-30) - ### Bug Fixes -* update solve api example ([#175](https://github.com/sprintertech/sprinter-sdk/issues/175)) ([9dbfbd8](https://github.com/sprintertech/sprinter-sdk/commit/9dbfbd8763e13b050e0bc3ca33414f6016a48cb4)) +- update solve api example ([#175](https://github.com/sprintertech/sprinter-sdk/issues/175)) ([9dbfbd8](https://github.com/sprintertech/sprinter-sdk/commit/9dbfbd8763e13b050e0bc3ca33414f6016a48cb4)) ## [0.3.7](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.6...docs-v0.3.7) (2025-06-26) - ### Bug Fixes -* broken links solve v1 ([#169](https://github.com/sprintertech/sprinter-sdk/issues/169)) ([34be02b](https://github.com/sprintertech/sprinter-sdk/commit/34be02b69ef86a3b7cb9d27ec1bb24f69889be40)) +- broken links solve v1 ([#169](https://github.com/sprintertech/sprinter-sdk/issues/169)) ([34be02b](https://github.com/sprintertech/sprinter-sdk/commit/34be02b69ef86a3b7cb9d27ec1bb24f69889be40)) ## [0.3.6](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.5...docs-v0.3.6) (2025-06-12) - ### Bug Fixes -* 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)) +- 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)) ## [0.3.5](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.4...docs-v0.3.5) (2025-05-28) diff --git a/docs/docs/03-Solve/get-route-v-1.api.mdx b/docs/docs/03-Solve/get-route-v-1.api.mdx index c1498e9..aaca8a9 100644 --- a/docs/docs/03-Solve/get-route-v-1.api.mdx +++ b/docs/docs/03-Solve/get-route-v-1.api.mdx @@ -19,18 +19,9 @@ import OperationTabs from "@theme/OperationTabs"; import TabItem from "@theme/TabItem"; import Heading from "@theme/Heading"; + - - - + Calculate the optimal swap route and generate execution parameters for a token exchange @@ -46,11 +37,9 @@ Calculate the optimal swap route and generate execution parameters for a token e { in: "query", name: "amountIn", - description: - "The amount of input tokens to swap (in token's smallest unit)", + description: "The amount of input tokens to swap (in token's smallest unit)", schema: { - description: - "Amount of an ERC20 token as a decimal string (no scientific notation)", + description: "Amount of an ERC20 token as a decimal string (no scientific notation)", type: "string", pattern: "^[0-9]+$", title: "TokenAmount", @@ -63,8 +52,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "Contract address of the input token to sell. The zero address (0x00…00) represents the native currency ETH.", schema: { - description: - "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix", + description: "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix", type: "string", pattern: "^0x[a-fA-F0-9]{40}$", title: "Address", @@ -77,8 +65,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "Contract address of the output token to buy. The zero address (0x00…00) represents the native currency ETH.", schema: { - description: - "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix", + description: "Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix", type: "string", pattern: "^0x[a-fA-F0-9]{40}$", title: "Address", @@ -111,8 +98,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "Successfully calculated swap route with execution details", headers: { "Request-ID": { - description: - "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", @@ -128,13 +114,7 @@ Calculate the optimal swap route and generate execution parameters for a token e schema: { description: "Successfully created route with execution details", type: "object", - required: [ - "requestId", - "amountOut", - "minAmountOut", - "target", - "callData", - ], + required: ["requestId", "amountOut", "minAmountOut", "target", "callData"], properties: { requestId: { description: @@ -181,8 +161,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "Bad request due to invalid parameters", headers: { "Request-ID": { - description: - "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", @@ -223,8 +202,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "Unauthorized access due to invalid or missing credentials", headers: { "Request-ID": { - description: - "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", @@ -265,8 +243,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "No viable swap route found for the given parameters", headers: { "Request-ID": { - description: - "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", @@ -307,8 +284,7 @@ Calculate the optimal swap route and generate execution parameters for a token e description: "Internal server error", headers: { "Request-ID": { - description: - "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", + description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", schema: { description: "Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix", @@ -347,4 +323,3 @@ Calculate the optimal swap route and generate execution parameters for a token e }, }} > -