Documentation
¶
Overview ¶
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* Jupiter API v6 * * The core of [jup.ag](https://jup.ag). Easily get a quote and swap through Jupiter API. ### Rate Limit We update our rate limit from time to time depending on the load of our servers. We recommend running your own instance of the API if you want to have high rate limit, here to learn how to run the [self-hosted API](https://station.jup.ag/docs/apis/self-hosted). ### API Wrapper - Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data types - Public keys are base58 encoded strings - raw data such as Vec<u8\\> are base64 encoded strings * * API version: 6.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type AccountMeta
- type BasicAuth
- type Configuration
- type GenericSwaggerError
- type IndexedRouteMapResponse
- type Instruction
- type PlatformFee
- type PrioritizationFeeLamports
- type PriorityFeeWithMaxLamports
- type PriorityLevel
- type PriorityLevelWithMaxLamports
- type QuoteResponse
- type RoutePlanStep
- type SwapApiQuoteGetOpts
- type SwapApiService
- func (a *SwapApiService) ProgramIdToLabelGet(ctx context.Context) (map[string]string, *http.Response, error)
- func (a *SwapApiService) QuoteGet(ctx context.Context, inputMint string, outputMint string, amount uint64, ...) (QuoteResponse, *http.Response, error)
- func (a *SwapApiService) SwapInstructionsPost(ctx context.Context, body SwapRequest) (SwapInstructionsResponse, *http.Response, error)
- func (a *SwapApiService) SwapPost(ctx context.Context, body SwapRequest) (SwapResponse, *http.Response, error)
- type SwapInfo
- type SwapInstructionsResponse
- type SwapMode
- type SwapRequest
- type SwapRequestDynamicSlippage
- type SwapResponse
- type SwapResponseDynamicSlippageReport
- type TokenApiService
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { // API Services SwapApi *SwapApiService TokenApi *TokenApiService // contains filtered or unexported fields }
APIClient manages communication with the Jupiter API v6 API v6.0.0 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type AccountMeta ¶
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type Configuration ¶
type Configuration struct { SwapBasePath string `json:"swapBasePath,omitempty"` PriceBasePath string `json:"priceBasePath,omitempty"` TokenBasePath string `json:"tokenBasePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration(apiKey string) *Configuration
func NewDefaultConfiguration ¶ added in v0.0.4
func NewDefaultConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type IndexedRouteMapResponse ¶
type Instruction ¶
type Instruction struct { ProgramId string `json:"programId"` Accounts []AccountMeta `json:"accounts"` Data string `json:"data"` }
type PlatformFee ¶
type PrioritizationFeeLamports ¶ added in v0.0.4
type PrioritizationFeeLamports struct { PriorityLevelWithMaxLamports *PriorityLevelWithMaxLamports `json:"priorityLevelWithMaxLamports,omitempty"` JitoTipLamports int32 `json:"jitoTipLamports,omitempty"` }
type PriorityLevel ¶ added in v0.0.4
type PriorityLevel = string
const ( PriorityLevelMedium PriorityLevel = "medium" PriorityLevelHigh PriorityLevel = "high" PriorityLevelVeryHigh PriorityLevel = "veryHigh" )
type PriorityLevelWithMaxLamports ¶ added in v0.0.4
type PriorityLevelWithMaxLamports struct { MaxLamports int32 `json:"maxLamports,omitempty"` PriorityLevel PriorityLevel `json:"priorityLevel,omitempty"` }
type QuoteResponse ¶
type QuoteResponse struct { InputMint string `json:"inputMint"` InAmount string `json:"inAmount"` OutputMint string `json:"outputMint"` OutAmount string `json:"outAmount"` OtherAmountThreshold string `json:"otherAmountThreshold"` SwapMode *SwapMode `json:"swapMode"` SlippageBps int32 `json:"slippageBps"` ComputedAutoSlippage int32 `json:"computedAutoSlippage,omitempty"` PlatformFee *PlatformFee `json:"platformFee,omitempty"` PriceImpactPct string `json:"priceImpactPct"` RoutePlan []RoutePlanStep `json:"routePlan"` ContextSlot float64 `json:"contextSlot,omitempty"` TimeTaken float64 `json:"timeTaken,omitempty"` }
type RoutePlanStep ¶
type SwapApiQuoteGetOpts ¶ added in v0.0.5
type SwapApiQuoteGetOpts struct { SlippageBps optional.Int32 AutoSlippage optional.Bool AutoSlippageCollisionUsdValue optional.Int32 ComputeAutoSlippage optional.Bool MaxAutoSlippageBps optional.Int32 SwapMode optional.String Dexes optional.Interface ExcludeDexes optional.Interface RestrictIntermediateTokens optional.Bool OnlyDirectRoutes optional.Bool AsLegacyTransaction optional.Bool PlatformFeeBps optional.Int32 MaxAccounts optional.Int32 MinimizeSlippage optional.Bool PreferLiquidDexes optional.Bool }
type SwapApiService ¶ added in v0.0.4
type SwapApiService service
func (*SwapApiService) ProgramIdToLabelGet ¶ added in v0.0.4
func (a *SwapApiService) ProgramIdToLabelGet(ctx context.Context) (map[string]string, *http.Response, error)
SwapApiService GET /program-id-to-label 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.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return map[string]string
func (*SwapApiService) QuoteGet ¶ added in v0.0.4
func (a *SwapApiService) QuoteGet(ctx context.Context, inputMint string, outputMint string, amount uint64, localVarOptionals *SwapApiQuoteGetOpts) (QuoteResponse, *http.Response, error)
func (*SwapApiService) SwapInstructionsPost ¶ added in v0.0.4
func (a *SwapApiService) SwapInstructionsPost(ctx context.Context, body SwapRequest) (SwapInstructionsResponse, *http.Response, error)
SwapApiService POST /swap-instructions Returns instructions that you can use from the quote you get from `/quote`.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return SwapInstructionsResponse
func (*SwapApiService) SwapPost ¶ added in v0.0.4
func (a *SwapApiService) SwapPost(ctx context.Context, body SwapRequest) (SwapResponse, *http.Response, error)
SwapApiService POST /swap Returns a transaction that you can use from the quote you get from `/quote`.
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return SwapResponse
type SwapInfo ¶
type SwapInfo struct { AmmKey string `json:"ammKey"` Label string `json:"label,omitempty"` InputMint string `json:"inputMint"` OutputMint string `json:"outputMint"` InAmount string `json:"inAmount"` OutAmount string `json:"outAmount"` FeeAmount string `json:"feeAmount"` FeeMint string `json:"feeMint"` }
type SwapInstructionsResponse ¶
type SwapInstructionsResponse struct { TokenLedgerInstruction *Instruction `json:"tokenLedgerInstruction,omitempty"` // The necessary instructions to setup the compute budget. ComputeBudgetInstructions []Instruction `json:"computeBudgetInstructions"` // Setup missing ATA for the users. SetupInstructions []Instruction `json:"setupInstructions"` SwapInstruction *Instruction `json:"swapInstruction"` CleanupInstruction *Instruction `json:"cleanupInstruction,omitempty"` // The lookup table addresses that you can use if you are using versioned transaction. AddressLookupTableAddresses []string `json:"addressLookupTableAddresses"` }
type SwapRequest ¶
type SwapRequest struct { // The user public key. UserPublicKey string `json:"userPublicKey"` // 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. WrapAndUnwrapSol bool `json:"wrapAndUnwrapSol"` UseSharedAccounts bool `json:"useSharedAccounts"` // 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"` // The compute unit price to prioritize the transaction, the additional fee will be `computeUnitLimit (1400000) * computeUnitPriceMicroLamports`. If `auto` is used, Jupiter will automatically set a priority fee and it will be capped at 5,000,000 lamports / 0.005 SOL. ComputeUnitPriceMicroLamports int64 `json:"computeUnitPriceMicroLamports,omitempty"` // \\* 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 *PrioritizationFeeLamports `json:"prioritizationFeeLamports,omitempty"` // 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"` // Default is false. This is useful when the instruction before the swap has a transfer that increases the input token amount. Then, the swap will just use the difference between the token ledger token amount and post token amount. UseTokenLedger bool `json:"useTokenLedger,omitempty"` // Public key of the token account that will be used to receive the token out of the swap. If not provided, the user's ATA will be used. If provided, we assume that the token account is already initialized. DestinationTokenAccount string `json:"destinationTokenAccount,omitempty"` // 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"` // When enabled, it will not do any rpc calls check on user's accounts. Enable it only when you already setup all the accounts needed for the trasaction, like wrapping or unwrapping sol, destination account is already created. SkipUserAccountsRpcCalls bool `json:"skipUserAccountsRpcCalls,omitempty"` // The program authority id [0;7], load balanced across the available set by default ProgramAuthorityId int32 `json:"programAuthorityId,omitempty"` // Default is false. Enabling it would reduce use an optimized way to open WSOL that reduce compute unit. AllowOptimizedWrappedSolTokenAccount bool `json:"allowOptimizedWrappedSolTokenAccount,omitempty"` QuoteResponse *QuoteResponse `json:"quoteResponse"` DynamicSlippage *SwapRequestDynamicSlippage `json:"dynamicSlippage,omitempty"` // Optional. When passed in, Swap object will be returned with your desired slots to epxiry. BlockhashSlotsToExpiry float64 `json:"blockhashSlotsToExpiry,omitempty"` // Optional. Default to false. Request Swap object to be returned with the correct blockhash prior to Agave 2.0. CorrectLastValidBlockHeight bool `json:"correctLastValidBlockHeight,omitempty"` }
type SwapResponse ¶
type SwapResponse struct { SwapTransaction string `json:"swapTransaction"` LastValidBlockHeight uint64 `json:"lastValidBlockHeight"` PrioritizationFeeLamports uint64 `json:"prioritizationFeeLamports,omitempty"` DynamicSlippageReport *SwapResponseDynamicSlippageReport `json:"dynamicSlippageReport,omitempty"` }
type SwapResponseDynamicSlippageReport ¶
type SwapResponseDynamicSlippageReport struct { AmplificationRatio string `json:"amplificationRatio,omitempty"` OtherAmount int32 `json:"otherAmount,omitempty"` SimulatedIncurredSlippageBps int32 `json:"simulatedIncurredSlippageBps,omitempty"` SlippageBps int32 `json:"slippageBps,omitempty"` CategoryName string `json:"categoryName,omitempty"` HeuristicMaxSlippageBps int32 `json:"heuristicMaxSlippageBps,omitempty"` }
type TokenApiService ¶ added in v0.0.4
type TokenApiService service
func (*TokenApiService) MintsTradableGet ¶ added in v0.0.4
TokenApiService GET /mints/tradable Returns a list of all the tradable mints
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []string
Source Files
¶
- api_swap.go
- api_token.go
- client.go
- configuration.go
- model_account_meta.go
- model_indexed_route_map_response.go
- model_instruction.go
- model_platform_fee.go
- model_priority_fee_with_max_lamports.go
- model_quote_response.go
- model_route_plan_step.go
- model_swap_info.go
- model_swap_instructions_response.go
- model_swap_mode.go
- model_swap_request.go
- model_swap_request_dynamic_slippage.go
- model_swap_request_prioritization_fee_lamports.go
- model_swap_response.go
- model_swap_response_dynamic_slippage_report.go
- response.go