From d9d18f75e6172ef06aff0de4e45c9235cb14d881 Mon Sep 17 00:00:00 2001 From: itsbobbyz Date: Fri, 31 Oct 2025 21:38:20 +0900 Subject: [PATCH 1/2] Update to solve api for gas --- docs/CHANGELOG.md | 3 +- docs/docs/03-Solve/get-route-v-1.api.mdx | 61 +++- .../src/api/generated/solve/get-quote.api.mdx | 183 ------------ .../api/generated/solve/get-route-v-1.api.mdx | 129 ++++++-- .../api/generated/solve/get-route-v-2.api.mdx | 280 ------------------ docs/src/api/generated/solve/sidebar.ts | 16 +- .../generated/solve/swap-by-blanc.info.mdx | 9 +- docs/src/api/solve-openapi.yaml | 53 +++- 8 files changed, 214 insertions(+), 520 deletions(-) delete mode 100644 docs/src/api/generated/solve/get-quote.api.mdx delete mode 100644 docs/src/api/generated/solve/get-route-v-2.api.mdx diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 495e935..be5260d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,10 +2,9 @@ ## [0.3.9](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.8...docs-v0.3.9) (2025-07-08) - ### Bug Fixes -* adding requestID to solve api ([#178](https://github.com/sprintertech/sprinter-sdk/issues/178)) ([0438cc9](https://github.com/sprintertech/sprinter-sdk/commit/0438cc921ab037988d46f43f61bfe481d7a0e8b1)) +- adding requestID to solve api ([#178](https://github.com/sprintertech/sprinter-sdk/issues/178)) ([0438cc9](https://github.com/sprintertech/sprinter-sdk/commit/0438cc921ab037988d46f43f61bfe481d7a0e8b1)) ## [0.3.8](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.7...docs-v0.3.8) (2025-06-30) 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 aaca8a9..c71763c 100644 --- a/docs/docs/03-Solve/get-route-v-1.api.mdx +++ b/docs/docs/03-Solve/get-route-v-1.api.mdx @@ -37,9 +37,11 @@ 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", @@ -52,7 +54,8 @@ 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", @@ -65,7 +68,8 @@ 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", @@ -85,6 +89,14 @@ Calculate the optimal swap route and generate execution parameters for a token e }, required: false, }, + { + in: "query", + name: "timeout", + description: + "Optional timeout in milliseconds. If set, returns the best pathfinder result within the timeout window. Must be a positive integer.", + schema: { type: "integer", format: "int32", minimum: 1 }, + required: false, + }, ]} > @@ -98,7 +110,8 @@ 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", @@ -114,7 +127,15 @@ 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", + "gasUsed", + "gasLimit", + ], properties: { requestId: { description: @@ -151,6 +172,21 @@ Calculate the optimal swap route and generate execution parameters for a token e pattern: "^0x[a-fA-F0-9]*$", title: "Bytes", }, + gasUsed: { + description: "Actual gas consumed by the swap simulation", + type: "integer", + format: "uint64", + minimum: 0, + example: 180000, + }, + gasLimit: { + description: + "Recommended gas limit for the swap transaction (gasUsed * 1.3)", + type: "integer", + format: "uint64", + minimum: 0, + example: 234000, + }, }, title: "RouteV1Response", }, @@ -161,7 +197,8 @@ 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", @@ -202,7 +239,8 @@ 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", @@ -243,7 +281,8 @@ 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", @@ -284,7 +323,8 @@ 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", @@ -323,3 +363,4 @@ Calculate the optimal swap route and generate execution parameters for a token e }, }} > + diff --git a/docs/src/api/generated/solve/get-quote.api.mdx b/docs/src/api/generated/solve/get-quote.api.mdx deleted file mode 100644 index 48591d5..0000000 --- a/docs/src/api/generated/solve/get-quote.api.mdx +++ /dev/null @@ -1,183 +0,0 @@ ---- -id: get-quote -title: "getQuote" -description: "Get a price estimation quote" -sidebar_label: "getQuote" -hide_title: true -hide_table_of_contents: true -api: eJztlt9v2zYQx/+VA7GHdpMb2ZHr2G+K43RGX7okBQoYXkqL54iNRCrkybVn6H8vKPpXYsfZAuxhWP1m8u745eeOp1syXaDhJLUaCtZjd0h/lJqQBUygTYws3BbrsQ9IwKEwMkFASzKvfeBhZVxww3MkNJb1RksmnctDiWbBAqZ4jqzHeK5LRbdS7cW+SRH8LugpkL5HZYE0WMwykAoEJjLnGShN9aksYDZJMeest3wSKt6E4QoGV/1W6OMBt8A3gSwZqe7gjdJgE4mK5FQmm/BvWcBoUTjN3rC+HxEad8Kfo7DRHf/2CwsYznleZM6uGe79XBBJ9e6NU+CVsSpgBh9KaVCwHpkSXwpTBYdx1td6jubqzkIYtBuUR7C1QpgsCGFAKRos840rqkQLFB5finP4LimFr+H8KxQGp3J+nFU4H/HGNG5cOmbLKKweYwvn78+bnXbUiQZn3bAb9aPognfPJt12NECBcT/qtludpggvd2jGXtpxkv8g8nHAuqS/R3hSLv5fgPthi/P4tDtptU4vB2cXYRxiux9dtjoYX3TDs9N+p/2+n7RYNXaBbKGVRevQtMJwn1DddsCWSYLWTsssW0BikBMKFrBEK0JFzosXRSaT+qGefLPOdfks9etNNN+oPFxKEXBeYEIoQJdUlLRqP1vWevINE/e/MK5BkvTKVz3MFcV/sPU8Suho9zLjrUedh6tVulhVOa/oUMLOuQAXDi29PkMDY7SBdXX4/AgkLjN7IBm76tF5OuGPM+SX9875vcy5AoNc8EmGUFtBjtbyOzzAfItXKltOp7JO1ZNicWTW1Op7bGg19wV8VrykVBv5FwpowFDNeCYFxJ+GcI+LnwB3AbYPldtQuVfgXhCaGRqv4Ce3LbcqYDlSqldjnO8cKeuxk/WQZjEpjaRFPaLFhfyIi7h0JqOx69Hr7WuHzF9q12i5FsvrRRb4r2aKXKDZfja/NOJPw4Y3eNIgfa171lNtck5g728zOcPbX+tLSTXV9UGry11/5wVMFnCecZUcjFdaFBsLcPYsYDM01ps034XvwsYEibuvWaEt5bwui5XYOyQ4OO8ut3X10ui7okI4p5Mi41K5o0qTuSA+AyPmbccBS7Ult7BcTrjFzyarKrfsRw+XFiGtKxTBelOeWTwi683VqijfwisG6IOqXSd6PKjPeFY6u3pKerW258bRIyJ2xtt/SYMf2F6U4AfArYax+2OkE1E/nGD9Alz2vGOcJFjseu01Jhdl81g/DG5YVf0AB+2RRg== -sidebar_class_name: "get api-method" -info_path: ../src/api/generated/solve/swap-by-blanc -custom_edit_url: null ---- - -import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import ParamsDetails from "@theme/ParamsDetails"; -import RequestSchema from "@theme/RequestSchema"; -import StatusCodes from "@theme/StatusCodes"; -import OperationTabs from "@theme/OperationTabs"; -import TabItem from "@theme/TabItem"; -import Heading from "@theme/Heading"; - - - - - -Get a price estimation quote - - - - - - - - diff --git a/docs/src/api/generated/solve/get-route-v-1.api.mdx b/docs/src/api/generated/solve/get-route-v-1.api.mdx index 342ed6e..850d8df 100644 --- a/docs/src/api/generated/solve/get-route-v-1.api.mdx +++ b/docs/src/api/generated/solve/get-route-v-1.api.mdx @@ -5,7 +5,7 @@ description: "Calculate the optimal swap route and generate execution parameters sidebar_label: "getRouteV1" hide_title: true hide_table_of_contents: true -api: eJztWEtvGzcQ/isEkaJOu5bWrn2obnLitj60DeykF0MFRtyRlskuuSaHilRh/3sx5OplKc4LAVI3N4mcnfnmmwfJWUrboAPS1lwVciCnSNc2EP51IjNZoFdON7wpB/IZVCpUQCioRGEb0jVUwr+FRjj+RIApxBQNq0OBc1SBvxQNOKiR0HkxsU6AIPsGjcC5KsFMUWZyIyEHt0up2dpdQLeQmTRQoxxIqG0wdGX2UL0sUaRNYSdCmyZQMuAF2YTuSJu09L0XvoaqQk8iG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VkXYBuQLV+6PRDc47jL2sT//BLu1sNLerFxtxOL7c2qK+Z7+u1YCKwX/1pZXZCWeRv69fSczWb/AdEncbk= sidebar_class_name: "get api-method" info_path: ../src/api/generated/solve/swap-by-blanc custom_edit_url: null @@ -59,7 +59,8 @@ Calculate the optimal swap route and generate execution parameters for a token e { in: "query", name: "tokenIn", - description: "Contract address of the input token to sell", + 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", @@ -72,7 +73,8 @@ Calculate the optimal swap route and generate execution parameters for a token e { in: "query", name: "tokenOut", - description: "Contract address of the output token to buy", + 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", @@ -95,6 +97,14 @@ Calculate the optimal swap route and generate execution parameters for a token e }, required: false, }, + { + in: "query", + name: "timeout", + description: + "Optional timeout in milliseconds. If set, returns the best pathfinder result within the timeout window. Must be a positive integer.", + schema: { type: "integer", format: "int32", minimum: 1 }, + required: false, + }, ]} > @@ -108,11 +118,15 @@ 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", + 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 +135,24 @@ Calculate the optimal swap route and generate execution parameters for a token e schema: { description: "Successfully created route with execution details", type: "object", - required: ["amountOut", "minAmountOut", "target", "callData"], + required: [ + "requestId", + "amountOut", + "minAmountOut", + "target", + "callData", + "gasUsed", + "gasLimit", + ], 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)", @@ -150,6 +180,21 @@ Calculate the optimal swap route and generate execution parameters for a token e pattern: "^0x[a-fA-F0-9]*$", title: "Bytes", }, + gasUsed: { + description: "Actual gas consumed by the swap simulation", + type: "integer", + format: "uint64", + minimum: 0, + example: 180000, + }, + gasLimit: { + description: + "Recommended gas limit for the swap transaction (gasUsed * 1.3)", + type: "integer", + format: "uint64", + minimum: 0, + example: 234000, + }, }, title: "RouteV1Response", }, @@ -160,11 +205,15 @@ 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", + 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 +222,20 @@ Calculate the optimal swap route and generate execution parameters for a token e 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 +247,15 @@ 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", + 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 +264,20 @@ Calculate the optimal swap route and generate execution parameters for a token e 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 +289,15 @@ 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", + 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 +306,20 @@ Calculate the optimal swap route and generate execution parameters for a token e 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 +331,15 @@ Calculate the optimal swap route and generate execution parameters for a token e 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 +348,20 @@ Calculate the optimal swap route and generate execution parameters for a token e 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", diff --git a/docs/src/api/generated/solve/get-route-v-2.api.mdx b/docs/src/api/generated/solve/get-route-v-2.api.mdx deleted file mode 100644 index 342ed6e..0000000 --- a/docs/src/api/generated/solve/get-route-v-2.api.mdx +++ /dev/null @@ -1,280 +0,0 @@ ---- -id: get-route-v-1 -title: "getRouteV1" -description: "Calculate the optimal swap route and generate execution parameters for a token exchange" -sidebar_label: "getRouteV1" -hide_title: true -hide_table_of_contents: true -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== -sidebar_class_name: "get api-method" -info_path: ../src/api/generated/solve/swap-by-blanc -custom_edit_url: null ---- - -import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint"; -import ParamsDetails from "@theme/ParamsDetails"; -import RequestSchema from "@theme/RequestSchema"; -import StatusCodes from "@theme/StatusCodes"; -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 - - - - - - - - diff --git a/docs/src/api/generated/solve/sidebar.ts b/docs/src/api/generated/solve/sidebar.ts index 42aaf4a..9593821 100644 --- a/docs/src/api/generated/solve/sidebar.ts +++ b/docs/src/api/generated/solve/sidebar.ts @@ -12,20 +12,8 @@ const sidebar: SidebarsConfig = { items: [ { type: "doc", - id: "../src/api/generated/solve/", - label: "Missing summary", - className: "api-method get", - }, - { - type: "doc", - id: "../src/api/generated/solve/", - label: "Missing summary", - className: "api-method get", - }, - { - type: "doc", - id: "../src/api/generated/solve/", - label: "Missing summary", + id: "../src/api/generated/solve/get-route-v-1", + label: "getRouteV1", className: "api-method get", }, ], diff --git a/docs/src/api/generated/solve/swap-by-blanc.info.mdx b/docs/src/api/generated/solve/swap-by-blanc.info.mdx index 32d46f0..1af4539 100644 --- a/docs/src/api/generated/solve/swap-by-blanc.info.mdx +++ b/docs/src/api/generated/solve/swap-by-blanc.info.mdx @@ -35,18 +35,17 @@ API used by Blanc Swap children={"Authentication"} > - - API key with format sk_live_* +
- + - - + +
Security Scheme Type:apiKeyhttp
Header parameter name:X-API-KeyHTTP Authorization Scheme:basic
diff --git a/docs/src/api/solve-openapi.yaml b/docs/src/api/solve-openapi.yaml index b2fad09..a0490c9 100644 --- a/docs/src/api/solve-openapi.yaml +++ b/docs/src/api/solve-openapi.yaml @@ -27,13 +27,13 @@ paths: required: true - in: query name: tokenIn - description: Contract address of the input token to sell + description: Contract address of the input token to sell. The zero address (0x00…00) represents the native currency ETH. schema: $ref: "#/components/schemas/Address" required: true - in: query name: tokenOut - description: Contract address of the output token to buy + description: Contract address of the output token to buy. The zero address (0x00…00) represents the native currency ETH. schema: $ref: "#/components/schemas/Address" required: true @@ -47,6 +47,14 @@ paths: maximum: 10000 default: 50 required: false + - in: query + name: timeout + description: Optional timeout in milliseconds. If set, returns the best pathfinder result within the timeout window. Must be a positive integer. + schema: + type: integer + format: int32 + minimum: 1 + required: false responses: 200: description: Successfully calculated swap route with execution details @@ -102,13 +110,17 @@ components: headers: RequestID: - description: Unique request identifier + description: Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix schema: - type: string - format: hex - pattern: "^0x[a-fA-F0-9]{24}$" + $ref: "#/components/schemas/RequestID" schemas: + RequestID: + description: Unique request identifier (16 bytes) encoded as hexadecimal with 0x prefix + type: string + format: hex + pattern: "^0x[a-fA-F0-9]{32}$" + Address: description: Ethereum contract address (20 bytes) encoded as hexadecimal with 0x prefix type: string @@ -127,8 +139,19 @@ components: RouteV1Response: description: Successfully created route with execution details type: object - required: [amountOut, minAmountOut, target, callData] + required: + [ + requestId, + amountOut, + minAmountOut, + target, + callData, + gasUsed, + gasLimit, + ] properties: + requestId: + $ref: "#/components/schemas/RequestID" amountOut: description: Amount of tokens to receive $ref: "#/components/schemas/TokenAmount" @@ -141,15 +164,29 @@ components: callData: description: Hex encoded calldata for the swap $ref: "#/components/schemas/Bytes" + gasUsed: + description: Actual gas consumed by the swap simulation + type: integer + format: uint64 + minimum: 0 + example: 180000 + gasLimit: + description: Recommended gas limit for the swap transaction (gasUsed * 1.3) + type: integer + format: uint64 + minimum: 0 + example: 234000 Error: 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: + $ref: "#/components/schemas/RequestID" error: description: Error message type: string From f0d7544c2caa53347784330cabbcfb7ef750c1b1 Mon Sep 17 00:00:00 2001 From: itsbobbyz Date: Fri, 31 Oct 2025 21:54:34 +0900 Subject: [PATCH 2/2] updated Solve API for gas limits --- docs/CHANGELOG.md | 6 ++--- docs/docs/03-Solve/get-route-v-1.api.mdx | 31 ++++++++---------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 9313066..928f77f 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,17 +2,15 @@ ## [0.3.11](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.10...docs-v0.3.11) (2025-10-09) - ### Bug Fixes -* borrow quote example ([#189](https://github.com/sprintertech/sprinter-sdk/issues/189)) ([1583e74](https://github.com/sprintertech/sprinter-sdk/commit/1583e74b750fd4b5a7fe1b5887f742221ea3061f)) +- borrow quote example ([#189](https://github.com/sprintertech/sprinter-sdk/issues/189)) ([1583e74](https://github.com/sprintertech/sprinter-sdk/commit/1583e74b750fd4b5a7fe1b5887f742221ea3061f)) ## [0.3.10](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.9...docs-v0.3.10) (2025-09-15) - ### Bug Fixes -* missing base url ([#185](https://github.com/sprintertech/sprinter-sdk/issues/185)) ([c9b535d](https://github.com/sprintertech/sprinter-sdk/commit/c9b535dd422413a9f06414ef8158f07c1b650462)), closes [#184](https://github.com/sprintertech/sprinter-sdk/issues/184) +- missing base url ([#185](https://github.com/sprintertech/sprinter-sdk/issues/185)) ([c9b535d](https://github.com/sprintertech/sprinter-sdk/commit/c9b535dd422413a9f06414ef8158f07c1b650462)), closes [#184](https://github.com/sprintertech/sprinter-sdk/issues/184) ## [0.3.9](https://github.com/sprintertech/sprinter-sdk/compare/docs-v0.3.8...docs-v0.3.9) (2025-07-08) 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 c71763c..9903b0c 100644 --- a/docs/docs/03-Solve/get-route-v-1.api.mdx +++ b/docs/docs/03-Solve/get-route-v-1.api.mdx @@ -37,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", @@ -54,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", @@ -68,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", @@ -110,8 +106,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", @@ -180,8 +175,7 @@ Calculate the optimal swap route and generate execution parameters for a token e example: 180000, }, gasLimit: { - description: - "Recommended gas limit for the swap transaction (gasUsed * 1.3)", + description: "Recommended gas limit for the swap transaction (gasUsed * 1.3)", type: "integer", format: "uint64", minimum: 0, @@ -197,8 +191,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", @@ -239,8 +232,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", @@ -281,8 +273,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", @@ -323,8 +314,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", @@ -363,4 +353,3 @@ Calculate the optimal swap route and generate execution parameters for a token e }, }} > -