Documentation
¶
Overview ¶
Package jupiter provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.
Index ¶
- Constants
- func NewGetIndexedRouteMapRequest(server string, params *GetIndexedRouteMapParams) (*http.Request, error)
- func NewGetProgramIdToLabelRequest(server string) (*http.Request, error)
- func NewGetQuoteRequest(server string, params *GetQuoteParams) (*http.Request, error)
- func NewGetTokensRequest(server string) (*http.Request, error)
- func NewPostSwapInstructionsRequest(server string, body PostSwapInstructionsJSONRequestBody) (*http.Request, error)
- func NewPostSwapInstructionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPostSwapRequest(server string, body PostSwapJSONRequestBody) (*http.Request, error)
- func NewPostSwapRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type AccountMeta
- type AmountParameter
- type AsLegacyTransactionParameter
- type Client
- func (c *Client) GetIndexedRouteMap(ctx context.Context, params *GetIndexedRouteMapParams, ...) (*http.Response, error)
- func (c *Client) GetProgramIdToLabel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetQuote(ctx context.Context, params *GetQuoteParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetTokens(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostSwap(ctx context.Context, body PostSwapJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostSwapInstructions(ctx context.Context, body PostSwapInstructionsJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostSwapInstructionsWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PostSwapWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetIndexedRouteMapWithResponse(ctx context.Context, params *GetIndexedRouteMapParams, ...) (*GetIndexedRouteMapResponse, error)
- func (c *ClientWithResponses) GetProgramIdToLabelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProgramIdToLabelResponse, error)
- func (c *ClientWithResponses) GetQuoteWithResponse(ctx context.Context, params *GetQuoteParams, reqEditors ...RequestEditorFn) (*GetQuoteResponse, error)
- func (c *ClientWithResponses) GetTokensWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTokensResponse, error)
- func (c *ClientWithResponses) PostSwapInstructionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostSwapInstructionsResponse, error)
- func (c *ClientWithResponses) PostSwapInstructionsWithResponse(ctx context.Context, body PostSwapInstructionsJSONRequestBody, ...) (*PostSwapInstructionsResponse, error)
- func (c *ClientWithResponses) PostSwapWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostSwapResponse, error)
- func (c *ClientWithResponses) PostSwapWithResponse(ctx context.Context, body PostSwapJSONRequestBody, ...) (*PostSwapResponse, error)
- type ClientWithResponsesInterface
- type DexesParameter
- type ExcludeDexesParameter
- type GetIndexedRouteMapParams
- type GetIndexedRouteMapResponse
- type GetProgramIdToLabelResponse
- type GetQuoteParams
- type GetQuoteParamsSwapMode
- type GetQuoteResponse
- type GetTokensResponse
- type HttpRequestDoer
- type IndexedRouteMapResponse
- type InputMintParameter
- type Instruction
- type MaxAccountsParameter
- type OnlyDirectRoutesParameter
- type OutputMintParameter
- type PlatformFee
- type PlatformFeeBpsParameter
- type PostSwapInstructionsJSONRequestBody
- type PostSwapInstructionsResponse
- type PostSwapJSONRequestBody
- type PostSwapResponse
- type QuoteResponse
- type RequestEditorFn
- type RestrictIntermediateTokensParameter
- type RoutePlanStep
- type SlippageParameter
- type SwapInfo
- type SwapInstructionsResponse
- type SwapMode
- type SwapModeParameter
- type SwapRequest
- type SwapRequestComputeUnitPriceMicroLamports0
- type SwapRequestComputeUnitPriceMicroLamports1
- type SwapRequestPrioritizationFeeLamports0
- type SwapRequestPrioritizationFeeLamports1
- type SwapRequest_ComputeUnitPriceMicroLamports
- func (t SwapRequest_ComputeUnitPriceMicroLamports) AsSwapRequestComputeUnitPriceMicroLamports0() (SwapRequestComputeUnitPriceMicroLamports0, error)
- func (t SwapRequest_ComputeUnitPriceMicroLamports) AsSwapRequestComputeUnitPriceMicroLamports1() (SwapRequestComputeUnitPriceMicroLamports1, error)
- func (t *SwapRequest_ComputeUnitPriceMicroLamports) FromSwapRequestComputeUnitPriceMicroLamports0(v SwapRequestComputeUnitPriceMicroLamports0) error
- func (t *SwapRequest_ComputeUnitPriceMicroLamports) FromSwapRequestComputeUnitPriceMicroLamports1(v SwapRequestComputeUnitPriceMicroLamports1) error
- func (t SwapRequest_ComputeUnitPriceMicroLamports) MarshalJSON() ([]byte, error)
- func (t *SwapRequest_ComputeUnitPriceMicroLamports) MergeSwapRequestComputeUnitPriceMicroLamports0(v SwapRequestComputeUnitPriceMicroLamports0) error
- func (t *SwapRequest_ComputeUnitPriceMicroLamports) MergeSwapRequestComputeUnitPriceMicroLamports1(v SwapRequestComputeUnitPriceMicroLamports1) error
- func (t *SwapRequest_ComputeUnitPriceMicroLamports) UnmarshalJSON(b []byte) error
- type SwapRequest_PrioritizationFeeLamports
- func (t SwapRequest_PrioritizationFeeLamports) AsSwapRequestPrioritizationFeeLamports0() (SwapRequestPrioritizationFeeLamports0, error)
- func (t SwapRequest_PrioritizationFeeLamports) AsSwapRequestPrioritizationFeeLamports1() (SwapRequestPrioritizationFeeLamports1, error)
- func (t *SwapRequest_PrioritizationFeeLamports) FromSwapRequestPrioritizationFeeLamports0(v SwapRequestPrioritizationFeeLamports0) error
- func (t *SwapRequest_PrioritizationFeeLamports) FromSwapRequestPrioritizationFeeLamports1(v SwapRequestPrioritizationFeeLamports1) error
- func (t SwapRequest_PrioritizationFeeLamports) MarshalJSON() ([]byte, error)
- func (t *SwapRequest_PrioritizationFeeLamports) MergeSwapRequestPrioritizationFeeLamports0(v SwapRequestPrioritizationFeeLamports0) error
- func (t *SwapRequest_PrioritizationFeeLamports) MergeSwapRequestPrioritizationFeeLamports1(v SwapRequestPrioritizationFeeLamports1) error
- func (t *SwapRequest_PrioritizationFeeLamports) UnmarshalJSON(b []byte) error
- type SwapResponse
Constants ¶
const DefaultAPIURL = "https://quote-api.jup.ag/v6"
Variables ¶
This section is empty.
Functions ¶
func NewGetIndexedRouteMapRequest ¶
func NewGetIndexedRouteMapRequest(server string, params *GetIndexedRouteMapParams) (*http.Request, error)
NewGetIndexedRouteMapRequest generates requests for GetIndexedRouteMap
func NewGetProgramIdToLabelRequest ¶
NewGetProgramIdToLabelRequest generates requests for GetProgramIdToLabel
func NewGetQuoteRequest ¶
func NewGetQuoteRequest(server string, params *GetQuoteParams) (*http.Request, error)
NewGetQuoteRequest generates requests for GetQuote
func NewGetTokensRequest ¶
NewGetTokensRequest generates requests for GetTokens
func NewPostSwapInstructionsRequest ¶
func NewPostSwapInstructionsRequest(server string, body PostSwapInstructionsJSONRequestBody) (*http.Request, error)
NewPostSwapInstructionsRequest calls the generic PostSwapInstructions builder with application/json body
func NewPostSwapInstructionsRequestWithBody ¶
func NewPostSwapInstructionsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPostSwapInstructionsRequestWithBody generates requests for PostSwapInstructions with any type of body
func NewPostSwapRequest ¶
func NewPostSwapRequest(server string, body PostSwapJSONRequestBody) (*http.Request, error)
NewPostSwapRequest calls the generic PostSwap builder with application/json body
Types ¶
type AccountMeta ¶
type AccountMeta struct { IsSigner bool `json:"isSigner"` IsWritable bool `json:"isWritable"` Pubkey string `json:"pubkey"` }
AccountMeta defines model for AccountMeta.
type AmountParameter ¶
type AmountParameter = int
AmountParameter defines model for AmountParameter.
type AsLegacyTransactionParameter ¶
type AsLegacyTransactionParameter = bool
AsLegacyTransactionParameter defines model for AsLegacyTransactionParameter.
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetIndexedRouteMap ¶
func (c *Client) GetIndexedRouteMap(ctx context.Context, params *GetIndexedRouteMapParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetProgramIdToLabel ¶
func (*Client) GetQuote ¶
func (c *Client) GetQuote(ctx context.Context, params *GetQuoteParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostSwap ¶
func (c *Client) PostSwap(ctx context.Context, body PostSwapJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostSwapInstructions ¶
func (c *Client) PostSwapInstructions(ctx context.Context, body PostSwapInstructionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PostSwapInstructionsWithBody ¶
type ClientInterface ¶
type ClientInterface interface { // GetIndexedRouteMap request GetIndexedRouteMap(ctx context.Context, params *GetIndexedRouteMapParams, reqEditors ...RequestEditorFn) (*http.Response, error) // GetProgramIdToLabel request GetProgramIdToLabel(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) // GetQuote request GetQuote(ctx context.Context, params *GetQuoteParams, reqEditors ...RequestEditorFn) (*http.Response, error) // PostSwapWithBody request with any body PostSwapWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostSwap(ctx context.Context, body PostSwapJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // PostSwapInstructionsWithBody request with any body PostSwapInstructionsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostSwapInstructions(ctx context.Context, body PostSwapInstructionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // GetTokens request GetTokens(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetIndexedRouteMapWithResponse ¶
func (c *ClientWithResponses) GetIndexedRouteMapWithResponse(ctx context.Context, params *GetIndexedRouteMapParams, reqEditors ...RequestEditorFn) (*GetIndexedRouteMapResponse, error)
GetIndexedRouteMapWithResponse request returning *GetIndexedRouteMapResponse
func (*ClientWithResponses) GetProgramIdToLabelWithResponse ¶
func (c *ClientWithResponses) GetProgramIdToLabelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProgramIdToLabelResponse, error)
GetProgramIdToLabelWithResponse request returning *GetProgramIdToLabelResponse
func (*ClientWithResponses) GetQuoteWithResponse ¶
func (c *ClientWithResponses) GetQuoteWithResponse(ctx context.Context, params *GetQuoteParams, reqEditors ...RequestEditorFn) (*GetQuoteResponse, error)
GetQuoteWithResponse request returning *GetQuoteResponse
func (*ClientWithResponses) GetTokensWithResponse ¶
func (c *ClientWithResponses) GetTokensWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTokensResponse, error)
GetTokensWithResponse request returning *GetTokensResponse
func (*ClientWithResponses) PostSwapInstructionsWithBodyWithResponse ¶
func (c *ClientWithResponses) PostSwapInstructionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSwapInstructionsResponse, error)
PostSwapInstructionsWithBodyWithResponse request with arbitrary body returning *PostSwapInstructionsResponse
func (*ClientWithResponses) PostSwapInstructionsWithResponse ¶
func (c *ClientWithResponses) PostSwapInstructionsWithResponse(ctx context.Context, body PostSwapInstructionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSwapInstructionsResponse, error)
func (*ClientWithResponses) PostSwapWithBodyWithResponse ¶
func (c *ClientWithResponses) PostSwapWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSwapResponse, error)
PostSwapWithBodyWithResponse request with arbitrary body returning *PostSwapResponse
func (*ClientWithResponses) PostSwapWithResponse ¶
func (c *ClientWithResponses) PostSwapWithResponse(ctx context.Context, body PostSwapJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSwapResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // GetIndexedRouteMapWithResponse request GetIndexedRouteMapWithResponse(ctx context.Context, params *GetIndexedRouteMapParams, reqEditors ...RequestEditorFn) (*GetIndexedRouteMapResponse, error) // GetProgramIdToLabelWithResponse request GetProgramIdToLabelWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetProgramIdToLabelResponse, error) // GetQuoteWithResponse request GetQuoteWithResponse(ctx context.Context, params *GetQuoteParams, reqEditors ...RequestEditorFn) (*GetQuoteResponse, error) // PostSwapWithBodyWithResponse request with any body PostSwapWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSwapResponse, error) PostSwapWithResponse(ctx context.Context, body PostSwapJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSwapResponse, error) // PostSwapInstructionsWithBodyWithResponse request with any body PostSwapInstructionsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSwapInstructionsResponse, error) PostSwapInstructionsWithResponse(ctx context.Context, body PostSwapInstructionsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostSwapInstructionsResponse, error) // GetTokensWithResponse request GetTokensWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTokensResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type DexesParameter ¶
type DexesParameter = []string
DexesParameter defines model for DexesParameter.
type ExcludeDexesParameter ¶
type ExcludeDexesParameter = []string
ExcludeDexesParameter defines model for ExcludeDexesParameter.
type GetIndexedRouteMapParams ¶
type GetIndexedRouteMapParams struct { // OnlyDirectRoutes Default is false. Direct Routes limits Jupiter routing to single hop routes only. OnlyDirectRoutes *OnlyDirectRoutesParameter `form:"onlyDirectRoutes,omitempty" json:"onlyDirectRoutes,omitempty"` }
GetIndexedRouteMapParams defines parameters for GetIndexedRouteMap.
type GetIndexedRouteMapResponse ¶
type GetIndexedRouteMapResponse struct { Body []byte HTTPResponse *http.Response JSON200 *IndexedRouteMapResponse }
func ParseGetIndexedRouteMapResponse ¶
func ParseGetIndexedRouteMapResponse(rsp *http.Response) (*GetIndexedRouteMapResponse, error)
ParseGetIndexedRouteMapResponse parses an HTTP response from a GetIndexedRouteMapWithResponse call
func (GetIndexedRouteMapResponse) Status ¶
func (r GetIndexedRouteMapResponse) Status() string
Status returns HTTPResponse.Status
func (GetIndexedRouteMapResponse) StatusCode ¶
func (r GetIndexedRouteMapResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetProgramIdToLabelResponse ¶
type GetProgramIdToLabelResponse struct { Body []byte HTTPResponse *http.Response JSON200 *map[string]string }
func ParseGetProgramIdToLabelResponse ¶
func ParseGetProgramIdToLabelResponse(rsp *http.Response) (*GetProgramIdToLabelResponse, error)
ParseGetProgramIdToLabelResponse parses an HTTP response from a GetProgramIdToLabelWithResponse call
func (GetProgramIdToLabelResponse) Status ¶
func (r GetProgramIdToLabelResponse) Status() string
Status returns HTTPResponse.Status
func (GetProgramIdToLabelResponse) StatusCode ¶
func (r GetProgramIdToLabelResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetQuoteParams ¶
type GetQuoteParams struct { // InputMint Input token mint address InputMint InputMintParameter `form:"inputMint" json:"inputMint"` // OutputMint Output token mint address OutputMint OutputMintParameter `form:"outputMint" json:"outputMint"` // Amount The amount to swap, have to factor in the token decimals. Amount AmountParameter `form:"amount" json:"amount"` // SlippageBps The slippage in basis points, 1 basis point is 0.01%. If the output token amount exceeds the slippage then the swap transaction will fail. SlippageBps *SlippageParameter `form:"slippageBps,omitempty" json:"slippageBps,omitempty"` // SwapMode (ExactIn or ExactOut) Defaults to ExactIn. ExactOut is for supporting use cases where you need an exact token amount, like payments. In this case the slippage is on the input token. SwapMode *GetQuoteParamsSwapMode `form:"swapMode,omitempty" json:"swapMode,omitempty"` // Dexes 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). Dexes *DexesParameter `form:"dexes,omitempty" json:"dexes,omitempty"` // ExcludeDexes Default is that all DEXes are included. You can pass in the DEXes that you want to exclude and separate them by `,`. You can check out the full list [here](https://quote-api.jup.ag/v6/program-id-to-label). ExcludeDexes *ExcludeDexesParameter `form:"excludeDexes,omitempty" json:"excludeDexes,omitempty"` // RestrictIntermediateTokens Restrict intermediate tokens to a top token set that has stable liquidity. This will help to ease potential high slippage error rate when swapping with minimal impact on pricing. RestrictIntermediateTokens *RestrictIntermediateTokensParameter `form:"restrictIntermediateTokens,omitempty" json:"restrictIntermediateTokens,omitempty"` // OnlyDirectRoutes Default is false. Direct Routes limits Jupiter routing to single hop routes only. OnlyDirectRoutes *OnlyDirectRoutesParameter `form:"onlyDirectRoutes,omitempty" json:"onlyDirectRoutes,omitempty"` // AsLegacyTransaction Default is false. Instead of using versioned transaction, this will use the legacy transaction. AsLegacyTransaction *AsLegacyTransactionParameter `form:"asLegacyTransaction,omitempty" json:"asLegacyTransaction,omitempty"` // PlatformFeeBps If you want to charge the user a fee, you can specify the fee in BPS. Fee % is taken out of the output token. PlatformFeeBps *PlatformFeeBpsParameter `form:"platformFeeBps,omitempty" json:"platformFeeBps,omitempty"` // MaxAccounts Rough estimate of the max accounts to be used for the quote, so that you can compose with your own accounts MaxAccounts *MaxAccountsParameter `form:"maxAccounts,omitempty" json:"maxAccounts,omitempty"` }
GetQuoteParams defines parameters for GetQuote.
type GetQuoteParamsSwapMode ¶
type GetQuoteParamsSwapMode string
GetQuoteParamsSwapMode defines parameters for GetQuote.
const ( ExactIn GetQuoteParamsSwapMode = "ExactIn" ExactOut GetQuoteParamsSwapMode = "ExactOut" )
Defines values for GetQuoteParamsSwapMode.
type GetQuoteResponse ¶
type GetQuoteResponse struct { Body []byte HTTPResponse *http.Response JSON200 *QuoteResponse }
func ParseGetQuoteResponse ¶
func ParseGetQuoteResponse(rsp *http.Response) (*GetQuoteResponse, error)
ParseGetQuoteResponse parses an HTTP response from a GetQuoteWithResponse call
func (GetQuoteResponse) Status ¶
func (r GetQuoteResponse) Status() string
Status returns HTTPResponse.Status
func (GetQuoteResponse) StatusCode ¶
func (r GetQuoteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetTokensResponse ¶
func ParseGetTokensResponse ¶
func ParseGetTokensResponse(rsp *http.Response) (*GetTokensResponse, error)
ParseGetTokensResponse parses an HTTP response from a GetTokensWithResponse call
func (GetTokensResponse) Status ¶
func (r GetTokensResponse) Status() string
Status returns HTTPResponse.Status
func (GetTokensResponse) StatusCode ¶
func (r GetTokensResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type IndexedRouteMapResponse ¶
type IndexedRouteMapResponse struct { // IndexedRouteMap All the possible route and their corresponding output mints IndexedRouteMap map[string][]float32 `json:"indexedRouteMap"` // MintKeys All the mints that are indexed to match in indexedRouteMap MintKeys []string `json:"mintKeys"` }
IndexedRouteMapResponse defines model for IndexedRouteMapResponse.
type InputMintParameter ¶
type InputMintParameter = string
InputMintParameter defines model for InputMintParameter.
type Instruction ¶
type Instruction struct { Accounts []AccountMeta `json:"accounts"` Data string `json:"data"` ProgramId string `json:"programId"` }
Instruction defines model for Instruction.
type MaxAccountsParameter ¶
type MaxAccountsParameter = int
MaxAccountsParameter defines model for MaxAccountsParameter.
type OnlyDirectRoutesParameter ¶
type OnlyDirectRoutesParameter = bool
OnlyDirectRoutesParameter defines model for OnlyDirectRoutesParameter.
type OutputMintParameter ¶
type OutputMintParameter = string
OutputMintParameter defines model for OutputMintParameter.
type PlatformFee ¶
type PlatformFee struct { Amount *string `json:"amount,omitempty"` FeeBps *int32 `json:"feeBps,omitempty"` }
PlatformFee defines model for PlatformFee.
type PlatformFeeBpsParameter ¶
type PlatformFeeBpsParameter = int
PlatformFeeBpsParameter defines model for PlatformFeeBpsParameter.
type PostSwapInstructionsJSONRequestBody ¶
type PostSwapInstructionsJSONRequestBody = SwapRequest
PostSwapInstructionsJSONRequestBody defines body for PostSwapInstructions for application/json ContentType.
type PostSwapInstructionsResponse ¶
type PostSwapInstructionsResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SwapInstructionsResponse }
func ParsePostSwapInstructionsResponse ¶
func ParsePostSwapInstructionsResponse(rsp *http.Response) (*PostSwapInstructionsResponse, error)
ParsePostSwapInstructionsResponse parses an HTTP response from a PostSwapInstructionsWithResponse call
func (PostSwapInstructionsResponse) Status ¶
func (r PostSwapInstructionsResponse) Status() string
Status returns HTTPResponse.Status
func (PostSwapInstructionsResponse) StatusCode ¶
func (r PostSwapInstructionsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PostSwapJSONRequestBody ¶
type PostSwapJSONRequestBody = SwapRequest
PostSwapJSONRequestBody defines body for PostSwap for application/json ContentType.
type PostSwapResponse ¶
type PostSwapResponse struct { Body []byte HTTPResponse *http.Response JSON200 *SwapResponse }
func ParsePostSwapResponse ¶
func ParsePostSwapResponse(rsp *http.Response) (*PostSwapResponse, error)
ParsePostSwapResponse parses an HTTP response from a PostSwapWithResponse call
func (PostSwapResponse) Status ¶
func (r PostSwapResponse) Status() string
Status returns HTTPResponse.Status
func (PostSwapResponse) StatusCode ¶
func (r PostSwapResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type QuoteResponse ¶
type QuoteResponse struct { ContextSlot *float32 `json:"contextSlot,omitempty"` InAmount string `json:"inAmount"` InputMint string `json:"inputMint"` OtherAmountThreshold string `json:"otherAmountThreshold"` OutAmount string `json:"outAmount"` OutputMint string `json:"outputMint"` PlatformFee *PlatformFee `json:"platformFee,omitempty"` PriceImpactPct string `json:"priceImpactPct"` RoutePlan []RoutePlanStep `json:"routePlan"` SlippageBps int32 `json:"slippageBps"` SwapMode SwapMode `json:"swapMode"` TimeTaken *float32 `json:"timeTaken,omitempty"` }
QuoteResponse defines model for QuoteResponse.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RestrictIntermediateTokensParameter ¶
type RestrictIntermediateTokensParameter = bool
RestrictIntermediateTokensParameter defines model for RestrictIntermediateTokensParameter.
type RoutePlanStep ¶
RoutePlanStep defines model for RoutePlanStep.
type SlippageParameter ¶
type SlippageParameter = int
SlippageParameter defines model for SlippageParameter.
type SwapInfo ¶
type SwapInfo struct { AmmKey string `json:"ammKey"` FeeAmount string `json:"feeAmount"` FeeMint string `json:"feeMint"` InAmount string `json:"inAmount"` InputMint string `json:"inputMint"` Label *string `json:"label,omitempty"` OutAmount string `json:"outAmount"` OutputMint string `json:"outputMint"` }
SwapInfo defines model for SwapInfo.
type SwapInstructionsResponse ¶
type SwapInstructionsResponse struct { // AddressLookupTableAddresses The lookup table addresses that you can use if you are using versioned transaction. AddressLookupTableAddresses []string `json:"addressLookupTableAddresses"` CleanupInstruction *Instruction `json:"cleanupInstruction,omitempty"` // ComputeBudgetInstructions The necessary instructions to setup the compute budget. ComputeBudgetInstructions []Instruction `json:"computeBudgetInstructions"` // SetupInstructions Setup missing ATA for the users. SetupInstructions []Instruction `json:"setupInstructions"` SwapInstruction Instruction `json:"swapInstruction"` TokenLedgerInstruction *Instruction `json:"tokenLedgerInstruction,omitempty"` }
SwapInstructionsResponse defines model for SwapInstructionsResponse.
type SwapModeParameter ¶
type SwapModeParameter string
SwapModeParameter defines model for SwapModeParameter.
const ( SwapModeParameterExactIn SwapModeParameter = "ExactIn" SwapModeParameterExactOut SwapModeParameter = "ExactOut" )
Defines values for SwapModeParameter.
type SwapRequest ¶
type SwapRequest struct { // 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"` // ComputeUnitPriceMicroLamports 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 *SwapRequest_ComputeUnitPriceMicroLamports `json:"computeUnitPriceMicroLamports,omitempty"` // DestinationTokenAccount 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"` // 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"` // 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 *SwapRequest_PrioritizationFeeLamports `json:"prioritizationFeeLamports,omitempty"` QuoteResponse QuoteResponse `json:"quoteResponse"` // SkipUserAccountsRpcCalls 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"` UseSharedAccounts *bool `json:"useSharedAccounts,omitempty"` // UseTokenLedger 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"` // UserPublicKey The user public key. UserPublicKey string `json:"userPublicKey"` // WrapAndUnwrapSol 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,omitempty"` }
SwapRequest defines model for SwapRequest.
type SwapRequestComputeUnitPriceMicroLamports0 ¶
type SwapRequestComputeUnitPriceMicroLamports0 = int
SwapRequestComputeUnitPriceMicroLamports0 defines model for .
type SwapRequestComputeUnitPriceMicroLamports1 ¶
type SwapRequestComputeUnitPriceMicroLamports1 string
SwapRequestComputeUnitPriceMicroLamports1 defines model for SwapRequest.ComputeUnitPriceMicroLamports.1.
const (
SwapRequestComputeUnitPriceMicroLamports1Auto SwapRequestComputeUnitPriceMicroLamports1 = "auto"
)
Defines values for SwapRequestComputeUnitPriceMicroLamports1.
type SwapRequestPrioritizationFeeLamports0 ¶
type SwapRequestPrioritizationFeeLamports0 = int
SwapRequestPrioritizationFeeLamports0 defines model for .
type SwapRequestPrioritizationFeeLamports1 ¶
type SwapRequestPrioritizationFeeLamports1 string
SwapRequestPrioritizationFeeLamports1 defines model for SwapRequest.PrioritizationFeeLamports.1.
const (
SwapRequestPrioritizationFeeLamports1Auto SwapRequestPrioritizationFeeLamports1 = "auto"
)
Defines values for SwapRequestPrioritizationFeeLamports1.
type SwapRequest_ComputeUnitPriceMicroLamports ¶
type SwapRequest_ComputeUnitPriceMicroLamports struct {
// contains filtered or unexported fields
}
SwapRequest_ComputeUnitPriceMicroLamports 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.
func (SwapRequest_ComputeUnitPriceMicroLamports) AsSwapRequestComputeUnitPriceMicroLamports0 ¶
func (t SwapRequest_ComputeUnitPriceMicroLamports) AsSwapRequestComputeUnitPriceMicroLamports0() (SwapRequestComputeUnitPriceMicroLamports0, error)
AsSwapRequestComputeUnitPriceMicroLamports0 returns the union data inside the SwapRequest_ComputeUnitPriceMicroLamports as a SwapRequestComputeUnitPriceMicroLamports0
func (SwapRequest_ComputeUnitPriceMicroLamports) AsSwapRequestComputeUnitPriceMicroLamports1 ¶
func (t SwapRequest_ComputeUnitPriceMicroLamports) AsSwapRequestComputeUnitPriceMicroLamports1() (SwapRequestComputeUnitPriceMicroLamports1, error)
AsSwapRequestComputeUnitPriceMicroLamports1 returns the union data inside the SwapRequest_ComputeUnitPriceMicroLamports as a SwapRequestComputeUnitPriceMicroLamports1
func (*SwapRequest_ComputeUnitPriceMicroLamports) FromSwapRequestComputeUnitPriceMicroLamports0 ¶
func (t *SwapRequest_ComputeUnitPriceMicroLamports) FromSwapRequestComputeUnitPriceMicroLamports0(v SwapRequestComputeUnitPriceMicroLamports0) error
FromSwapRequestComputeUnitPriceMicroLamports0 overwrites any union data inside the SwapRequest_ComputeUnitPriceMicroLamports as the provided SwapRequestComputeUnitPriceMicroLamports0
func (*SwapRequest_ComputeUnitPriceMicroLamports) FromSwapRequestComputeUnitPriceMicroLamports1 ¶
func (t *SwapRequest_ComputeUnitPriceMicroLamports) FromSwapRequestComputeUnitPriceMicroLamports1(v SwapRequestComputeUnitPriceMicroLamports1) error
FromSwapRequestComputeUnitPriceMicroLamports1 overwrites any union data inside the SwapRequest_ComputeUnitPriceMicroLamports as the provided SwapRequestComputeUnitPriceMicroLamports1
func (SwapRequest_ComputeUnitPriceMicroLamports) MarshalJSON ¶
func (t SwapRequest_ComputeUnitPriceMicroLamports) MarshalJSON() ([]byte, error)
func (*SwapRequest_ComputeUnitPriceMicroLamports) MergeSwapRequestComputeUnitPriceMicroLamports0 ¶
func (t *SwapRequest_ComputeUnitPriceMicroLamports) MergeSwapRequestComputeUnitPriceMicroLamports0(v SwapRequestComputeUnitPriceMicroLamports0) error
MergeSwapRequestComputeUnitPriceMicroLamports0 performs a merge with any union data inside the SwapRequest_ComputeUnitPriceMicroLamports, using the provided SwapRequestComputeUnitPriceMicroLamports0
func (*SwapRequest_ComputeUnitPriceMicroLamports) MergeSwapRequestComputeUnitPriceMicroLamports1 ¶
func (t *SwapRequest_ComputeUnitPriceMicroLamports) MergeSwapRequestComputeUnitPriceMicroLamports1(v SwapRequestComputeUnitPriceMicroLamports1) error
MergeSwapRequestComputeUnitPriceMicroLamports1 performs a merge with any union data inside the SwapRequest_ComputeUnitPriceMicroLamports, using the provided SwapRequestComputeUnitPriceMicroLamports1
func (*SwapRequest_ComputeUnitPriceMicroLamports) UnmarshalJSON ¶
func (t *SwapRequest_ComputeUnitPriceMicroLamports) UnmarshalJSON(b []byte) error
type SwapRequest_PrioritizationFeeLamports ¶
type SwapRequest_PrioritizationFeeLamports struct {
// contains filtered or unexported fields
}
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.
func (SwapRequest_PrioritizationFeeLamports) AsSwapRequestPrioritizationFeeLamports0 ¶
func (t SwapRequest_PrioritizationFeeLamports) AsSwapRequestPrioritizationFeeLamports0() (SwapRequestPrioritizationFeeLamports0, error)
AsSwapRequestPrioritizationFeeLamports0 returns the union data inside the SwapRequest_PrioritizationFeeLamports as a SwapRequestPrioritizationFeeLamports0
func (SwapRequest_PrioritizationFeeLamports) AsSwapRequestPrioritizationFeeLamports1 ¶
func (t SwapRequest_PrioritizationFeeLamports) AsSwapRequestPrioritizationFeeLamports1() (SwapRequestPrioritizationFeeLamports1, error)
AsSwapRequestPrioritizationFeeLamports1 returns the union data inside the SwapRequest_PrioritizationFeeLamports as a SwapRequestPrioritizationFeeLamports1
func (*SwapRequest_PrioritizationFeeLamports) FromSwapRequestPrioritizationFeeLamports0 ¶
func (t *SwapRequest_PrioritizationFeeLamports) FromSwapRequestPrioritizationFeeLamports0(v SwapRequestPrioritizationFeeLamports0) error
FromSwapRequestPrioritizationFeeLamports0 overwrites any union data inside the SwapRequest_PrioritizationFeeLamports as the provided SwapRequestPrioritizationFeeLamports0
func (*SwapRequest_PrioritizationFeeLamports) FromSwapRequestPrioritizationFeeLamports1 ¶
func (t *SwapRequest_PrioritizationFeeLamports) FromSwapRequestPrioritizationFeeLamports1(v SwapRequestPrioritizationFeeLamports1) error
FromSwapRequestPrioritizationFeeLamports1 overwrites any union data inside the SwapRequest_PrioritizationFeeLamports as the provided SwapRequestPrioritizationFeeLamports1
func (SwapRequest_PrioritizationFeeLamports) MarshalJSON ¶
func (t SwapRequest_PrioritizationFeeLamports) MarshalJSON() ([]byte, error)
func (*SwapRequest_PrioritizationFeeLamports) MergeSwapRequestPrioritizationFeeLamports0 ¶
func (t *SwapRequest_PrioritizationFeeLamports) MergeSwapRequestPrioritizationFeeLamports0(v SwapRequestPrioritizationFeeLamports0) error
MergeSwapRequestPrioritizationFeeLamports0 performs a merge with any union data inside the SwapRequest_PrioritizationFeeLamports, using the provided SwapRequestPrioritizationFeeLamports0
func (*SwapRequest_PrioritizationFeeLamports) MergeSwapRequestPrioritizationFeeLamports1 ¶
func (t *SwapRequest_PrioritizationFeeLamports) MergeSwapRequestPrioritizationFeeLamports1(v SwapRequestPrioritizationFeeLamports1) error
MergeSwapRequestPrioritizationFeeLamports1 performs a merge with any union data inside the SwapRequest_PrioritizationFeeLamports, using the provided SwapRequestPrioritizationFeeLamports1
func (*SwapRequest_PrioritizationFeeLamports) UnmarshalJSON ¶
func (t *SwapRequest_PrioritizationFeeLamports) UnmarshalJSON(b []byte) error
type SwapResponse ¶
type SwapResponse struct { LastValidBlockHeight float32 `json:"lastValidBlockHeight"` PrioritizationFeeLamports *float32 `json:"prioritizationFeeLamports,omitempty"` SwapTransaction string `json:"swapTransaction"` }
SwapResponse defines model for SwapResponse.