Skip to content

Commit

Permalink
feat: support PrioritizationType and Payer in swaps (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkamo authored Jan 19, 2025
1 parent 1b085b0 commit 89a28a5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 39 deletions.
42 changes: 28 additions & 14 deletions jupiter/client.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 48 additions & 25 deletions jupiter/openapi/jupiter-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ components:

QuoteResponse:
type: object
required:
- inputMint
- outputMint
- inAmount
- outAmount
- otherAmountThreshold
- swapMode
- slippageBps
- priceImpactPct
- routePlan
properties:
inputMint:
type: string
Expand Down Expand Up @@ -216,6 +206,16 @@ components:
type: number
timeTaken:
type: number
required:
- inputMint
- outputMint
- inAmount
- outAmount
- otherAmountThreshold
- swapMode
- slippageBps
- priceImpactPct
- routePlan

SwapMode:
type: string
Expand All @@ -231,6 +231,9 @@ components:
feeBps:
type: integer
format: int32
required:
- amount
- feeBps

RoutePlanStep:
type: object
Expand All @@ -246,14 +249,6 @@ components:

SwapInfo:
type: object
required:
- ammKey
- inputMint
- outputMint
- inAmount
- outAmount
- feeAmount
- feeMint
properties:
ammKey:
type: string
Expand All @@ -271,16 +266,25 @@ components:
type: string
feeMint:
type: string
required:
- ammKey
- label
- inputMint
- outputMint
- inAmount
- outAmount
- feeAmount
- feeMint

SwapRequest:
type: object
required:
- userPublicKey
- quoteResponse
properties:
userPublicKey:
description: The user public key.
type: string
payer:
description: Allow a custom payer to pay for the transaction.
type: string
wrapAndUnwrapSol:
description: Default is true. If true, will automatically wrap/unwrap SOL. If false, it will use wSOL token account. Will be ignored if `destinationTokenAccount` is set because the `destinationTokenAccount` may belong to a different user that we have no authority to close.
type: boolean
Expand Down Expand Up @@ -332,8 +336,6 @@ components:
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"
dynamicSlippage:
type: object
properties:
Expand All @@ -347,6 +349,11 @@ components:
correctLastValidBlockHeight:
description: Optional. Default to false. Request Swap object to be returned with the correct blockhash prior to Agave 2.0.
type: boolean
quoteResponse:
$ref: '#/components/schemas/QuoteResponse'
required:
- userPublicKey
- quoteResponse

SwapResponse:
type: object
Expand All @@ -357,6 +364,22 @@ components:
type: number
prioritizationFeeLamports:
type: number
prioritizationType:
type: object
description: The type of prioritization used for the swap, either Jito or ComputeBudget.
properties:
jito:
type: object
properties:
lamports:
type: integer
computeBudget:
type: object
properties:
estimatedMicroLamports:
type: integer
microLamports:
type: integer
dynamicSlippageReport:
type: object
properties:
Expand All @@ -376,6 +399,7 @@ components:
required:
- swapTransaction
- lastValidBlockHeight
- prioritizationFeeLamports

SwapInstructionsResponse:
type: object
Expand Down Expand Up @@ -564,8 +588,7 @@ components:
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.
description: Default is true. 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

0 comments on commit 89a28a5

Please sign in to comment.