jupiter

package module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 20 Imported by: 0

README

Go API client for Jupiter

Initially generated by: Swagger Codegen

Last updated by @Halimao

The core of jup.ag. Easily get a quote and swap through Jupiter API.

Overview

This API client was initially generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

Installation

import "github.com/Halimao/jupiter-sdk-go"

Documentation for API Endpoints

All URIs are relative to https://api.jup.ag.

Latest api documents https://station.jup.ag/docs/api

Class Method URI
SwapApi ProgramIdToLabelGet Get https://api.jup.ag/swap/v1/program-id-to-label
SwapApi QuoteGet Get https://api.jup.ag/swap/v1/quote
SwapApi SwapInstructionsPost Post https://api.jup.ag/swap/v1/swap-instructions
SwapApi SwapPost Post https://api.jup.ag/swap/v1/swap
TokenApi MintsTradableGet Get https://api.jup.ag/tokens/v1/mints/tradable

Author

@Halimao

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

Constants

This section is empty.

Variables

View Source
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

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

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

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

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 AccountMeta struct {
	Pubkey     string `json:"pubkey"`
	IsSigner   bool   `json:"isSigner"`
	IsWritable bool   `json:"isWritable"`
}

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 IndexedRouteMapResponse struct {
	// All the mints that are indexed to match in indexedRouteMap
	MintKeys []string `json:"mintKeys"`
	// All the possible route and their corresponding output mints
	IndexedRouteMap map[string][]float64 `json:"indexedRouteMap"`
}

type Instruction

type Instruction struct {
	ProgramId string        `json:"programId"`
	Accounts  []AccountMeta `json:"accounts"`
	Data      string        `json:"data"`
}

type PlatformFee

type PlatformFee struct {
	Amount string `json:"amount,omitempty"`
	FeeBps int32  `json:"feeBps,omitempty"`
}

type PrioritizationFeeLamports added in v0.0.4

type PrioritizationFeeLamports struct {
	PriorityLevelWithMaxLamports *PriorityLevelWithMaxLamports `json:"priorityLevelWithMaxLamports,omitempty"`
	JitoTipLamports              int32                         `json:"jitoTipLamports,omitempty"`
}

type PriorityFeeWithMaxLamports

type PriorityFeeWithMaxLamports struct {
	Global        bool   `json:"global,omitempty"`
	MaxLamports   int32  `json:"maxLamports,omitempty"`
	PriorityLevel string `json:"priorityLevel,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 RoutePlanStep struct {
	SwapInfo *SwapInfo `json:"swapInfo"`
	Percent  int32     `json:"percent"`
}

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 &#x60;excludeDexes&#x60; or &#x60;dexes&#x60; 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 &#x60;/quote&#x60;.

  • @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

SwapApiService POST /swap Returns a transaction that you can use from the quote you get from &#x60;/quote&#x60;.

  • @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 SwapMode

type SwapMode string
const (
	EXACT_IN_SwapMode  SwapMode = "ExactIn"
	EXACT_OUT_SwapMode SwapMode = "ExactOut"
)

List of SwapMode

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"`
	// Default is true. This enables the usage of shared program accountns. That means no intermediate token accounts or open orders accounts need to be created for the users. But it also means that the likelihood of hot accounts is higher.
	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 SwapRequestDynamicSlippage

type SwapRequestDynamicSlippage struct {
	MinBps int32 `json:"minBps,omitempty"`
	MaxBps int32 `json:"maxBps,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

func (a *TokenApiService) MintsTradableGet(ctx context.Context) ([]string, *http.Response, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL