From 88e032d4dd3d3e1dc1a809ff8d23f4c380e7d3de Mon Sep 17 00:00:00 2001 From: Sergei Patrikeev <6849689+serejke@users.noreply.github.com> Date: Fri, 29 May 2026 18:07:08 +0100 Subject: [PATCH 1/2] fix(swagger): type /quote 'amount' as string to preserve u64 precision The amount query parameter is a u64 in atomic units (raw amount before decimals), but was declared type: integer, format: uint64. openapi-generator maps every type: integer to a TS number (an IEEE-754 double), which is exact only up to 2^53-1. u64 amounts can reach ~1.84e19, so any quote whose atomic input exceeds 2^53-1 silently loses precision before hitting the wire. Type it as string, matching the response-side amounts (inAmount, outAmount, otherAmountThreshold) which are already strings for the same reason. --- swagger.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/swagger.yaml b/swagger.yaml index 80c7c58..5e403fc 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -528,11 +528,15 @@ components: - Raw amount to swap (before decimals) - Input Amount if `SwapMode=ExactIn` - Output Amount if `SwapMode=ExactOut` + - This is a u64 in atomic units. It is typed as `string` to preserve full + precision: a JS `number` is an IEEE-754 double and silently loses + precision above 2^53-1, while a u64 can be up to ~1.84e19. Response-side + amounts (`inAmount`, `outAmount`, ...) are already strings for the same + reason. in: query required: true schema: - type: integer - format: uint64 + type: string SlippageParameter: name: slippageBps description: | From 048b3ba6e8f1faba712c92ce01cc6fbab881416b Mon Sep 17 00:00:00 2001 From: Sergei Patrikeev <6849689+serejke@users.noreply.github.com> Date: Fri, 29 May 2026 18:07:08 +0100 Subject: [PATCH 2/2] chore: regenerate typescript-fetch client from swagger QuoteGetRequest.amount: number -> string. Generated with the pinned openapi-generator 7.3.0 (openapitools.json) via npm run openapi-gen. --- generated/apis/SwapApi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/apis/SwapApi.ts b/generated/apis/SwapApi.ts index 8f35d1a..1daa1f2 100644 --- a/generated/apis/SwapApi.ts +++ b/generated/apis/SwapApi.ts @@ -34,7 +34,7 @@ import { export interface QuoteGetRequest { inputMint: string; outputMint: string; - amount: number; + amount: string; slippageBps?: number; swapMode?: QuoteGetSwapModeEnum; dexes?: Array;