From c3f95922bbbd640c6129fe82118e4802e1474e86 Mon Sep 17 00:00:00 2001 From: Pedritos22 Date: Wed, 11 Dec 2024 23:36:45 +0100 Subject: [PATCH] feat: added TokenCategoryBasedIntermediateTokensParameter --- jupiter/client.gen.go | 24 +++++++++++++++++++++++- jupiter/openapi/jupiter-swagger.yaml | 8 ++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/jupiter/client.gen.go b/jupiter/client.gen.go index c56c150..638267d 100644 --- a/jupiter/client.gen.go +++ b/jupiter/client.gen.go @@ -1,6 +1,6 @@ // Package jupiter provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT. package jupiter import ( @@ -281,6 +281,9 @@ type SlippageParameter = int // SwapModeParameter defines model for SwapModeParameter. type SwapModeParameter string +// TokenCategoryBasedIntermediateTokensParameter defines model for TokenCategoryBasedIntermediateTokensParameter. +type TokenCategoryBasedIntermediateTokensParameter = bool + // GetIndexedRouteMapParams defines parameters for GetIndexedRouteMap. type GetIndexedRouteMapParams struct { // OnlyDirectRoutes Default is false. Direct Routes limits Jupiter routing to single hop routes only. @@ -342,6 +345,9 @@ type GetQuoteParams struct { // PreferLiquidDexes Default is false. Enabling it would only consider markets with high liquidity to reduce slippage. PreferLiquidDexes *PreferLiquidDexes `form:"preferLiquidDexes,omitempty" json:"preferLiquidDexes,omitempty"` + + // TokenCategoryBasedIntermediateTokens Default is false. Uses categorized top token lists as intermediate tokens to optimize routing paths, replacing the old static top token list. This helps achieve better pricing while maintaining route reliability. + TokenCategoryBasedIntermediateTokens *TokenCategoryBasedIntermediateTokensParameter `form:"tokenCategoryBasedIntermediateTokens,omitempty" json:"tokenCategoryBasedIntermediateTokens,omitempty"` } // GetQuoteParamsSwapMode defines parameters for GetQuote. @@ -1043,6 +1049,22 @@ func NewGetQuoteRequest(server string, params *GetQuoteParams) (*http.Request, e } + if params.TokenCategoryBasedIntermediateTokens != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tokenCategoryBasedIntermediateTokens", runtime.ParamLocationQuery, *params.TokenCategoryBasedIntermediateTokens); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + queryURL.RawQuery = queryValues.Encode() } diff --git a/jupiter/openapi/jupiter-swagger.yaml b/jupiter/openapi/jupiter-swagger.yaml index b859d13..2e26a9c 100644 --- a/jupiter/openapi/jupiter-swagger.yaml +++ b/jupiter/openapi/jupiter-swagger.yaml @@ -42,6 +42,7 @@ paths: - $ref: "#/components/parameters/MaxAccountsParameter" - $ref: "#/components/parameters/MinimizeSlippage" - $ref: "#/components/parameters/PreferLiquidDexes" + - $ref: "#/components/parameters/TokenCategoryBasedIntermediateTokensParameter" responses: "200": description: Successful response @@ -553,3 +554,10 @@ components: in: query schema: type: boolean + TokenCategoryBasedIntermediateTokensParameter: + name: tokenCategoryBasedIntermediateTokens + description: Default is false. Uses categorized top token lists as intermediate tokens to optimize routing paths, replacing the old static top token list. This helps achieve better pricing while maintaining route reliability. + in: query + schema: + type: boolean +