diff --git a/jupiter/client.gen.go b/jupiter/client.gen.go index 2f77437..9ddbb16 100644 --- a/jupiter/client.gen.go +++ b/jupiter/client.gen.go @@ -128,6 +128,9 @@ type SwapMode string // SwapRequest defines model for SwapRequest. type SwapRequest struct { + // AllowOptimizedWrappedSolTokenAccount Default is false. Enabling it would reduce use an optimized way to open WSOL that reduce compute unit. + AllowOptimizedWrappedSolTokenAccount *bool `json:"allowOptimizedWrappedSolTokenAccount,omitempty"` + // AsLegacyTransaction Default is false. Request a legacy transaction rather than the default versioned transaction, needs to be paired with a quote using asLegacyTransaction otherwise the transaction might be too large. AsLegacyTransaction *bool `json:"asLegacyTransaction,omitempty"` @@ -139,11 +142,15 @@ type SwapRequest struct { // DynamicComputeUnitLimit When enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget's compute unit limit. This will increase latency slightly since there will be one extra RPC call to simulate this. Default is `false`. DynamicComputeUnitLimit *bool `json:"dynamicComputeUnitLimit,omitempty"` + DynamicSlippage *struct { + MaxBps *int `json:"maxBps,omitempty"` + MinBps *int `json:"minBps,omitempty"` + } `json:"dynamicSlippage,omitempty"` // FeeAccount Fee token account, same as the output token for ExactIn and as the input token for ExactOut, it is derived using the seeds = ["referral_ata", referral_account, mint] and the `REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3` referral contract (only pass in if you set a feeBps and make sure that the feeAccount has been created). FeeAccount *string `json:"feeAccount,omitempty"` - // PrioritizationFeeLamports Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. + // PrioritizationFeeLamports \* PriorityFeeWithMaxLamports is impossible to be typed. Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. PrioritizationFeeLamports *SwapRequest_PrioritizationFeeLamports `json:"prioritizationFeeLamports,omitempty"` // ProgramAuthorityId The program authority id [0;7], load balanced across the available set by default @@ -183,13 +190,19 @@ type SwapRequestPrioritizationFeeLamports0 = int // SwapRequestPrioritizationFeeLamports1 defines model for SwapRequest.PrioritizationFeeLamports.1. type SwapRequestPrioritizationFeeLamports1 string -// SwapRequest_PrioritizationFeeLamports Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. +// SwapRequest_PrioritizationFeeLamports \* PriorityFeeWithMaxLamports is impossible to be typed. Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. type SwapRequest_PrioritizationFeeLamports struct { union json.RawMessage } // SwapResponse defines model for SwapResponse. type SwapResponse struct { + DynamicSlippageReport *struct { + AmplificationRatio *string `json:"amplificationRatio,omitempty"` + OtherAmount *int `json:"otherAmount,omitempty"` + SimulatedIncurredSlippageBps *int `json:"simulatedIncurredSlippageBps,omitempty"` + SlippageBps *int `json:"slippageBps,omitempty"` + } `json:"dynamicSlippageReport,omitempty"` LastValidBlockHeight float32 `json:"lastValidBlockHeight"` PrioritizationFeeLamports *float32 `json:"prioritizationFeeLamports,omitempty"` SwapTransaction string `json:"swapTransaction"` diff --git a/jupiter/openapi/jupiter-swagger.yaml b/jupiter/openapi/jupiter-swagger.yaml index 83f4345..b9ccd83 100644 --- a/jupiter/openapi/jupiter-swagger.yaml +++ b/jupiter/openapi/jupiter-swagger.yaml @@ -1,4 +1,4 @@ -openapi: '3.0.2' +openapi: "3.0.2" info: title: Jupiter API v6 version: 6.0.0 @@ -24,31 +24,31 @@ paths: summary: GET /quote description: Sends a GET request to the Jupiter API to get the best priced quote. parameters: - - $ref: '#/components/parameters/InputMintParameter' - - $ref: '#/components/parameters/OutputMintParameter' - - $ref: '#/components/parameters/AmountParameter' - - $ref: '#/components/parameters/SlippageParameter' - - $ref: '#/components/parameters/AutoSlippageParameter' - - $ref: '#/components/parameters/AutoSlippageCollisionValueParameter' - - $ref: '#/components/parameters/ComputeAutoSlippageParameter' - - $ref: '#/components/parameters/MaxAutoSlippageBpsParameter' - - $ref: '#/components/parameters/SwapModeParameter' - - $ref: '#/components/parameters/DexesParameter' - - $ref: '#/components/parameters/ExcludeDexesParameter' - - $ref: '#/components/parameters/RestrictIntermediateTokensParameter' - - $ref: '#/components/parameters/OnlyDirectRoutesParameter' - - $ref: '#/components/parameters/AsLegacyTransactionParameter' - - $ref: '#/components/parameters/PlatformFeeBpsParameter' - - $ref: '#/components/parameters/MaxAccountsParameter' - - $ref: '#/components/parameters/MinimizeSlippage' - - $ref: '#/components/parameters/PreferLiquidDexes' + - $ref: "#/components/parameters/InputMintParameter" + - $ref: "#/components/parameters/OutputMintParameter" + - $ref: "#/components/parameters/AmountParameter" + - $ref: "#/components/parameters/SlippageParameter" + - $ref: "#/components/parameters/AutoSlippageParameter" + - $ref: "#/components/parameters/AutoSlippageCollisionValueParameter" + - $ref: "#/components/parameters/ComputeAutoSlippageParameter" + - $ref: "#/components/parameters/MaxAutoSlippageBpsParameter" + - $ref: "#/components/parameters/SwapModeParameter" + - $ref: "#/components/parameters/DexesParameter" + - $ref: "#/components/parameters/ExcludeDexesParameter" + - $ref: "#/components/parameters/RestrictIntermediateTokensParameter" + - $ref: "#/components/parameters/OnlyDirectRoutesParameter" + - $ref: "#/components/parameters/AsLegacyTransactionParameter" + - $ref: "#/components/parameters/PlatformFeeBpsParameter" + - $ref: "#/components/parameters/MaxAccountsParameter" + - $ref: "#/components/parameters/MinimizeSlippage" + - $ref: "#/components/parameters/PreferLiquidDexes" responses: - '200': + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/QuoteResponse' + $ref: "#/components/schemas/QuoteResponse" /swap: post: summary: POST /swap @@ -58,14 +58,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SwapRequest' + $ref: "#/components/schemas/SwapRequest" responses: - '200': + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/SwapResponse' + $ref: "#/components/schemas/SwapResponse" /swap-instructions: post: summary: POST /swap-instructions @@ -75,20 +75,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SwapRequest' + $ref: "#/components/schemas/SwapRequest" responses: - '200': + "200": description: Successful response content: application/json: schema: - $ref: '#/components/schemas/SwapInstructionsResponse' + $ref: "#/components/schemas/SwapInstructionsResponse" /program-id-to-label: get: summary: GET /program-id-to-label description: Returns a hash, which key is the program id and value is the label. This is used to help map error from transaction by identifying the fault program id. With that, we can use the `excludeDexes` or `dexes` parameter. responses: - '200': + "200": description: Default response content: application/json: @@ -102,20 +102,20 @@ paths: description: DEPRECATED, please use /tokens for tradable mints. Returns a hash map, input mint as key and an array of valid output mint as values, token mints are indexed to reduce the file size deprecated: true parameters: - - $ref: '#/components/parameters/OnlyDirectRoutesParameter' + - $ref: "#/components/parameters/OnlyDirectRoutesParameter" responses: - '200': + "200": description: Default response content: application/json: schema: - $ref: '#/components/schemas/IndexedRouteMapResponse' + $ref: "#/components/schemas/IndexedRouteMapResponse" /tokens: get: summary: GET /tokens description: Returns a list of all the tradable mints responses: - '200': + "200": description: Default response content: application/json: @@ -124,9 +124,9 @@ paths: items: type: string example: - - 'So11111111111111111111111111111111111111112' - - 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' - - 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' + - "So11111111111111111111111111111111111111112" + - "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" + - "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" components: schemas: @@ -138,7 +138,7 @@ components: accounts: type: array items: - $ref: '#/components/schemas/AccountMeta' + $ref: "#/components/schemas/AccountMeta" data: type: string required: @@ -160,6 +160,17 @@ components: - isSigner - isWritable + PriorityFeeWithMaxLamports: + type: object + properties: + global: + type: boolean + maxLamports: + type: integer + priorityLevel: + type: string + enum: ["medium", "high", "veryHigh"] + QuoteResponse: type: object required: @@ -184,8 +195,7 @@ components: otherAmountThreshold: type: string swapMode: - $ref: '#/components/schemas/SwapMode' - required: true + $ref: "#/components/schemas/SwapMode" slippageBps: type: integer format: int32 @@ -193,13 +203,13 @@ components: type: integer format: int32 platformFee: - $ref: '#/components/schemas/PlatformFee' + $ref: "#/components/schemas/PlatformFee" priceImpactPct: type: string routePlan: type: array items: - $ref: '#/components/schemas/RoutePlanStep' + $ref: "#/components/schemas/RoutePlanStep" contextSlot: type: number timeTaken: @@ -224,7 +234,7 @@ components: type: object properties: swapInfo: - $ref: '#/components/schemas/SwapInfo' + $ref: "#/components/schemas/SwapInfo" percent: type: integer format: int32 @@ -285,13 +295,17 @@ components: anyOf: - type: integer - type: string - enum: ['auto'] + enum: ["auto"] prioritizationFeeLamports: - description: Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. + description: \* PriorityFeeWithMaxLamports is impossible to be typed. Prioritization fee lamports paid for the transaction in addition to the signatures fee. Mutually exclusive with compute_unit_price_micro_lamports. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. anyOf: - type: integer - type: string - enum: ['auto'] + enum: ["auto"] + # It's impossible to type this, with Swagger 2.0, anyOf, oneOf typing is not supported + # - type: object + # $ref: "#/components/schemas/PriorityFeeWithMaxLamports" + asLegacyTransaction: description: Default is false. Request a legacy transaction rather than the default versioned transaction, needs to be paired with a quote using asLegacyTransaction otherwise the transaction might be too large. type: boolean @@ -312,8 +326,19 @@ components: programAuthorityId: description: The program authority id [0;7], load balanced across the available set by default type: integer + allowOptimizedWrappedSolTokenAccount: + description: Default is false. Enabling it would reduce use an optimized way to open WSOL that reduce compute unit. + type: boolean + default: false quoteResponse: - $ref: '#/components/schemas/QuoteResponse' + $ref: "#/components/schemas/QuoteResponse" + dynamicSlippage: + type: object + properties: + minBps: + type: integer + maxBps: + type: integer SwapResponse: type: object @@ -324,6 +349,17 @@ components: type: number prioritizationFeeLamports: type: number + dynamicSlippageReport: + type: object + properties: + amplificationRatio: + type: string + otherAmount: + type: integer + simulatedIncurredSlippageBps: + type: integer + slippageBps: + type: integer required: - swapTransaction - lastValidBlockHeight @@ -333,23 +369,23 @@ components: properties: tokenLedgerInstruction: description: If you are using `useTokenLedger = true`. - $ref: '#/components/schemas/Instruction' + $ref: "#/components/schemas/Instruction" computeBudgetInstructions: description: The necessary instructions to setup the compute budget. type: array items: - $ref: '#/components/schemas/Instruction' + $ref: "#/components/schemas/Instruction" setupInstructions: description: Setup missing ATA for the users. type: array items: - $ref: '#/components/schemas/Instruction' + $ref: "#/components/schemas/Instruction" swapInstruction: description: The actual swap instruction. - $ref: '#/components/schemas/Instruction' + $ref: "#/components/schemas/Instruction" cleanupInstruction: description: Unwrap the SOL if `wrapAndUnwrapSol = true`. - $ref: '#/components/schemas/Instruction' + $ref: "#/components/schemas/Instruction" addressLookupTableAddresses: description: The lookup table addresses that you can use if you are using versioned transaction. type: array @@ -380,11 +416,11 @@ components: items: type: number example: - '1': + "1": - 2 - 3 - 4 - '2': + "2": - 1 - 3 - 4 @@ -447,7 +483,7 @@ components: in: query schema: type: string - enum: ['ExactIn', 'ExactOut'] + enum: ["ExactIn", "ExactOut"] DexesParameter: name: dexes description: Default is that all DEXes are included. You can pass in the DEXes that you want to include only and separate them by `,`. You can check out the full list [here](https://quote-api.jup.ag/v6/program-id-to-label). @@ -505,4 +541,4 @@ components: description: Default is false. Enabling it would only consider markets with high liquidity to reduce slippage. in: query schema: - type: boolean + type: boolean \ No newline at end of file