@jup-ag/api
Version:
## Generate typescript types from swagger schema
1,038 lines (1,014 loc) • 41.5 kB
text/typescript
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
declare const BASE_PATH: string;
interface ConfigurationParameters {
basePath?: string;
fetchApi?: FetchAPI;
middleware?: Middleware[];
queryParamsStringify?: (params: HTTPQuery) => string;
username?: string;
password?: string;
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
headers?: HTTPHeaders;
credentials?: RequestCredentials;
}
declare class Configuration {
private configuration;
constructor(configuration?: ConfigurationParameters);
set config(configuration: Configuration);
get basePath(): string;
get fetchApi(): FetchAPI | undefined;
get middleware(): Middleware[];
get queryParamsStringify(): (params: HTTPQuery) => string;
get username(): string | undefined;
get password(): string | undefined;
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
get headers(): HTTPHeaders | undefined;
get credentials(): RequestCredentials | undefined;
}
declare const DefaultConfig: Configuration;
/**
* This is the base class for all generated API classes.
*/
declare class BaseAPI {
protected configuration: Configuration;
private static readonly jsonRegex;
private middleware;
constructor(configuration?: Configuration);
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
protected isJsonMime(mime: string | null | undefined): boolean;
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
private createFetchParams;
private fetchApi;
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
private clone;
}
declare class ResponseError extends Error {
response: Response;
name: "ResponseError";
constructor(response: Response, msg?: string);
}
declare class FetchError extends Error {
cause: Error;
name: "FetchError";
constructor(cause: Error, msg?: string);
}
declare class RequiredError extends Error {
field: string;
name: "RequiredError";
constructor(field: string, msg?: string);
}
declare const COLLECTION_FORMATS: {
csv: string;
ssv: string;
tsv: string;
pipes: string;
};
type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
type Json = any;
type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
type HTTPHeaders = {
[key: string]: string;
};
type HTTPQuery = {
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
};
type HTTPBody = Json | FormData | URLSearchParams;
type HTTPRequestInit = {
headers?: HTTPHeaders;
method: HTTPMethod;
credentials?: RequestCredentials;
body?: HTTPBody;
};
type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
type InitOverrideFunction = (requestContext: {
init: HTTPRequestInit;
context: RequestOpts;
}) => Promise<RequestInit>;
interface FetchParams {
url: string;
init: RequestInit;
}
interface RequestOpts {
path: string;
method: HTTPMethod;
headers: HTTPHeaders;
query?: HTTPQuery;
body?: HTTPBody;
}
declare function exists(json: any, key: string): boolean;
declare function querystring(params: HTTPQuery, prefix?: string): string;
declare function mapValues(data: any, fn: (item: any) => any): {};
declare function canConsumeForm(consumes: Consume[]): boolean;
interface Consume {
contentType: string;
}
interface RequestContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
}
interface ResponseContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
response: Response;
}
interface ErrorContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
error: unknown;
response?: Response;
}
interface Middleware {
pre?(context: RequestContext): Promise<FetchParams | void>;
post?(context: ResponseContext): Promise<Response | void>;
onError?(context: ErrorContext): Promise<Response | void>;
}
interface ApiResponse<T> {
raw: Response;
value(): Promise<T>;
}
interface ResponseTransformer<T> {
(json: any): T;
}
declare class JSONApiResponse<T> {
raw: Response;
private transformer;
constructor(raw: Response, transformer?: ResponseTransformer<T>);
value(): Promise<T>;
}
declare class VoidApiResponse {
raw: Response;
constructor(raw: Response);
value(): Promise<void>;
}
declare class BlobApiResponse {
raw: Response;
constructor(raw: Response);
value(): Promise<Blob>;
}
declare class TextApiResponse {
raw: Response;
constructor(raw: Response);
value(): Promise<string>;
}
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface AccountMeta
*/
interface AccountMeta {
/**
*
* @type {string}
* @memberof AccountMeta
*/
pubkey: string;
/**
*
* @type {boolean}
* @memberof AccountMeta
*/
isSigner: boolean;
/**
*
* @type {boolean}
* @memberof AccountMeta
*/
isWritable: boolean;
}
/**
* Check if a given object implements the AccountMeta interface.
*/
declare function instanceOfAccountMeta(value: object): boolean;
declare function AccountMetaFromJSON(json: any): AccountMeta;
declare function AccountMetaFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMeta;
declare function AccountMetaToJSON(value?: AccountMeta | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface IndexedRouteMapResponse
*/
interface IndexedRouteMapResponse {
/**
* All the mints that are indexed to match in indexedRouteMap
* @type {Array<string>}
* @memberof IndexedRouteMapResponse
*/
mintKeys: Array<string>;
/**
* All the possible route and their corresponding output mints
* @type {{ [key: string]: Array<number>; }}
* @memberof IndexedRouteMapResponse
*/
indexedRouteMap: {
[key: string]: Array<number>;
};
}
/**
* Check if a given object implements the IndexedRouteMapResponse interface.
*/
declare function instanceOfIndexedRouteMapResponse(value: object): boolean;
declare function IndexedRouteMapResponseFromJSON(json: any): IndexedRouteMapResponse;
declare function IndexedRouteMapResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): IndexedRouteMapResponse;
declare function IndexedRouteMapResponseToJSON(value?: IndexedRouteMapResponse | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface Instruction
*/
interface Instruction {
/**
*
* @type {string}
* @memberof Instruction
*/
programId: string;
/**
*
* @type {Array<AccountMeta>}
* @memberof Instruction
*/
accounts: Array<AccountMeta>;
/**
*
* @type {string}
* @memberof Instruction
*/
data: string;
}
/**
* Check if a given object implements the Instruction interface.
*/
declare function instanceOfInstruction(value: object): boolean;
declare function InstructionFromJSON(json: any): Instruction;
declare function InstructionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Instruction;
declare function InstructionToJSON(value?: Instruction | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface PlatformFee
*/
interface PlatformFee {
/**
*
* @type {string}
* @memberof PlatformFee
*/
amount?: string;
/**
*
* @type {number}
* @memberof PlatformFee
*/
feeBps?: number;
}
/**
* Check if a given object implements the PlatformFee interface.
*/
declare function instanceOfPlatformFee(value: object): boolean;
declare function PlatformFeeFromJSON(json: any): PlatformFee;
declare function PlatformFeeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PlatformFee;
declare function PlatformFeeToJSON(value?: PlatformFee | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SwapInfo
*/
interface SwapInfo {
/**
*
* @type {string}
* @memberof SwapInfo
*/
ammKey: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
label?: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
inputMint: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
outputMint: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
inAmount: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
outAmount: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
feeAmount: string;
/**
*
* @type {string}
* @memberof SwapInfo
*/
feeMint: string;
}
/**
* Check if a given object implements the SwapInfo interface.
*/
declare function instanceOfSwapInfo(value: object): boolean;
declare function SwapInfoFromJSON(json: any): SwapInfo;
declare function SwapInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapInfo;
declare function SwapInfoToJSON(value?: SwapInfo | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface RoutePlanStep
*/
interface RoutePlanStep {
/**
*
* @type {SwapInfo}
* @memberof RoutePlanStep
*/
swapInfo: SwapInfo;
/**
*
* @type {number}
* @memberof RoutePlanStep
*/
percent: number;
}
/**
* Check if a given object implements the RoutePlanStep interface.
*/
declare function instanceOfRoutePlanStep(value: object): boolean;
declare function RoutePlanStepFromJSON(json: any): RoutePlanStep;
declare function RoutePlanStepFromJSONTyped(json: any, ignoreDiscriminator: boolean): RoutePlanStep;
declare function RoutePlanStepToJSON(value?: RoutePlanStep | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
declare const SwapMode: {
readonly ExactIn: "ExactIn";
readonly ExactOut: "ExactOut";
};
type SwapMode = typeof SwapMode[keyof typeof SwapMode];
declare function SwapModeFromJSON(json: any): SwapMode;
declare function SwapModeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapMode;
declare function SwapModeToJSON(value?: SwapMode | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface QuoteResponse
*/
interface QuoteResponse {
/**
*
* @type {string}
* @memberof QuoteResponse
*/
inputMint: string;
/**
*
* @type {string}
* @memberof QuoteResponse
*/
inAmount: string;
/**
*
* @type {string}
* @memberof QuoteResponse
*/
outputMint: string;
/**
* - Calculated output amount from routing engine
* - Exlcuding slippage or platform fees
*
* @type {string}
* @memberof QuoteResponse
*/
outAmount: string;
/**
* - Calculated minimum output amount after accounting for `slippageBps` and `platformFeeBps`
* - Not used by `/swap` endpoint to build transaction
*
* @type {string}
* @memberof QuoteResponse
*/
otherAmountThreshold: string;
/**
*
* @type {SwapMode}
* @memberof QuoteResponse
*/
swapMode: SwapMode;
/**
*
* @type {number}
* @memberof QuoteResponse
*/
slippageBps: number;
/**
*
* @type {PlatformFee}
* @memberof QuoteResponse
*/
platformFee?: PlatformFee;
/**
*
* @type {string}
* @memberof QuoteResponse
*/
priceImpactPct: string;
/**
*
* @type {Array<RoutePlanStep>}
* @memberof QuoteResponse
*/
routePlan: Array<RoutePlanStep>;
/**
*
* @type {number}
* @memberof QuoteResponse
*/
contextSlot?: number;
/**
*
* @type {number}
* @memberof QuoteResponse
*/
timeTaken?: number;
}
/**
* Check if a given object implements the QuoteResponse interface.
*/
declare function instanceOfQuoteResponse(value: object): boolean;
declare function QuoteResponseFromJSON(json: any): QuoteResponse;
declare function QuoteResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): QuoteResponse;
declare function QuoteResponseToJSON(value?: QuoteResponse | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SwapInstructionsResponse
*/
interface SwapInstructionsResponse {
/**
* - If you set `{\"prioritizationFeeLamports\": {\"jitoTipLamports\": 5000}}`, you will see a custom tip instruction to Jito here.
*
* @type {Array<Instruction>}
* @memberof SwapInstructionsResponse
*/
otherInstructions?: Array<Instruction>;
/**
* - To setup the compute budget for the transaction.
*
* @type {Array<Instruction>}
* @memberof SwapInstructionsResponse
*/
computeBudgetInstructions: Array<Instruction>;
/**
* - To setup required token accounts for the users.
*
* @type {Array<Instruction>}
* @memberof SwapInstructionsResponse
*/
setupInstructions: Array<Instruction>;
/**
*
* @type {Instruction}
* @memberof SwapInstructionsResponse
*/
swapInstruction: Instruction;
/**
*
* @type {Instruction}
* @memberof SwapInstructionsResponse
*/
cleanupInstruction?: Instruction;
/**
* - The lookup table addresses if you are using versioned transaction.
*
* @type {Array<string>}
* @memberof SwapInstructionsResponse
*/
addressLookupTableAddresses: Array<string>;
}
/**
* Check if a given object implements the SwapInstructionsResponse interface.
*/
declare function instanceOfSwapInstructionsResponse(value: object): boolean;
declare function SwapInstructionsResponseFromJSON(json: any): SwapInstructionsResponse;
declare function SwapInstructionsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapInstructionsResponse;
declare function SwapInstructionsResponseToJSON(value?: SwapInstructionsResponse | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports
*/
interface SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports {
/**
*
* @type {string}
* @memberof SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports
*/
priorityLevel?: SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum;
/**
* - Maximum lamports to cap the priority fee estimation, to prevent overpaying
*
* @type {number}
* @memberof SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports
*/
maxLamports?: number;
}
/**
* @export
*/
declare const SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum: {
readonly Medium: "medium";
readonly High: "high";
readonly VeryHigh: "veryHigh";
};
type SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum = typeof SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum[keyof typeof SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum];
/**
* Check if a given object implements the SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports interface.
*/
declare function instanceOfSwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports(value: object): boolean;
declare function SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsFromJSON(json: any): SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports;
declare function SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports;
declare function SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsToJSON(value?: SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* - To specify a level or amount of additional fees to prioritize the transaction
* - It can be used for EITHER priority fee OR Jito tip (not both at the same time)
* - If you want to include both, you will need to use `/swap-instructions` to add both at the same time
*
* @export
* @interface SwapRequestPrioritizationFeeLamports
*/
interface SwapRequestPrioritizationFeeLamports {
/**
*
* @type {SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports}
* @memberof SwapRequestPrioritizationFeeLamports
*/
priorityLevelWithMaxLamports?: SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports;
/**
* - Exact amount of tip to use in a tip instruction
* - Refer to Jito docs on how to estimate the tip amount based on percentiles
* - It has to be used together with a connection to a Jito RPC
* - [See their docs](https://docs.jito.wtf/)
*
* @type {number}
* @memberof SwapRequestPrioritizationFeeLamports
*/
jitoTipLamports?: number;
}
/**
* Check if a given object implements the SwapRequestPrioritizationFeeLamports interface.
*/
declare function instanceOfSwapRequestPrioritizationFeeLamports(value: object): boolean;
declare function SwapRequestPrioritizationFeeLamportsFromJSON(json: any): SwapRequestPrioritizationFeeLamports;
declare function SwapRequestPrioritizationFeeLamportsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapRequestPrioritizationFeeLamports;
declare function SwapRequestPrioritizationFeeLamportsToJSON(value?: SwapRequestPrioritizationFeeLamports | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SwapRequest
*/
interface SwapRequest {
/**
*
* @type {string}
* @memberof SwapRequest
*/
userPublicKey: string;
/**
* - To automatically wrap/unwrap SOL in the transaction
* - If false, it will use wSOL token account
* - Parameter will be ignored if `destinationTokenAccount` is set because the `destinationTokenAccount` may belong to a different user that we have no authority to close
*
* @type {boolean}
* @memberof SwapRequest
*/
wrapAndUnwrapSol?: boolean;
/**
* - The default is determined dynamically by the routing engine, allowing us to optimize for compute units, etc
* - This enables the usage of shared program accounts, this is essential as complex routing will require multiple intermediate token accounts which the user might not have
* - If true, you do not need to handle the creation of intermediate token accounts for the user
* - Do note, shared accounts route will fail on some new AMMs (low liquidity token)
*
* @type {boolean}
* @memberof SwapRequest
*/
useSharedAccounts?: boolean;
/**
* - An token account that will be used to collect fees
* - The mint of the token account **can only be either the input or output mint of the swap**
* - You no longer are required to use the Referral Program
* - See [Add Fees](/docs/swap-api/add-fees-to-swap) guide for more details
*
* @type {string}
* @memberof SwapRequest
*/
feeAccount?: string;
/**
* - Specify any public key that belongs to you to track the transactions
* - Useful for integrators to get all the swap transactions from this public key
* - Query the data using a block explorer like Solscan/SolanaFM or query like Dune/Flipside
*
* @type {string}
* @memberof SwapRequest
*/
trackingAccount?: string;
/**
*
* @type {SwapRequestPrioritizationFeeLamports}
* @memberof SwapRequest
*/
prioritizationFeeLamports?: SwapRequestPrioritizationFeeLamports;
/**
* - Builds a legacy transaction rather than the default versioned transaction
* - Used together with `asLegacyTransaction` in `/quote`, otherwise the transaction might be too large
*
* @type {boolean}
* @memberof SwapRequest
*/
asLegacyTransaction?: boolean;
/**
* - Public key of a token account that will be used to receive the token out of the swap
* - If not provided, the signer's token account will be used
* - If provided, we assume that the token account is already initialized
*
* @type {string}
* @memberof SwapRequest
*/
destinationTokenAccount?: string;
/**
* - When enabled, it will do a swap simulation to get the compute unit used and set it in ComputeBudget's compute unit limit
* - This incurs one extra RPC call to simulate this
* - We recommend to enable this to estimate compute unit correctly and reduce priority fees needed or have higher chance to be included in a block
*
* @type {boolean}
* @memberof SwapRequest
*/
dynamicComputeUnitLimit?: boolean;
/**
* - When enabled, it will not do any additional RPC calls to check on required accounts
* - Enable it only when you already setup all the accounts needed for the trasaction, like wrapping or unwrapping sol, or destination account is already created
*
* @type {boolean}
* @memberof SwapRequest
*/
skipUserAccountsRpcCalls?: boolean;
/**
* - When enabled, it estimates slippage and apply it in the swap transaction directly, overwriting the `slippageBps` parameter in the quote response.
* - Used together with `dynamicSlippage` in `/quote`, otherwise the slippage used will be the one in the `/quote`'s `slippageBps`
* - [See notes for more information](/docs/swap-api/send-swap-transaction#how-jupiter-estimates-slippage)
*
* @type {boolean}
* @memberof SwapRequest
*/
dynamicSlippage?: boolean;
/**
* - To use an exact compute unit price to calculate priority fee
* - `computeUnitLimit (1400000) * computeUnitPriceMicroLamports`
* - We recommend using `prioritizationFeeLamports` and `dynamicComputeUnitLimit` instead of passing in your own compute unit price
*
* @type {number}
* @memberof SwapRequest
*/
computeUnitPriceMicroLamports?: number;
/**
* - Pass in the number of slots we want the transaction to be valid for
* - Example: If you pass in 10 slots, the transaction will be valid for ~400ms * 10 = approximately 4 seconds before it expires
*
* @type {number}
* @memberof SwapRequest
*/
blockhashSlotsToExpiry?: number;
/**
*
* @type {QuoteResponse}
* @memberof SwapRequest
*/
quoteResponse: QuoteResponse;
}
/**
* Check if a given object implements the SwapRequest interface.
*/
declare function instanceOfSwapRequest(value: object): boolean;
declare function SwapRequestFromJSON(json: any): SwapRequest;
declare function SwapRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapRequest;
declare function SwapRequestToJSON(value?: SwapRequest | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SwapResponse
*/
interface SwapResponse {
/**
*
* @type {string}
* @memberof SwapResponse
*/
swapTransaction: string;
/**
*
* @type {number}
* @memberof SwapResponse
*/
lastValidBlockHeight: number;
/**
*
* @type {number}
* @memberof SwapResponse
*/
prioritizationFeeLamports?: number;
}
/**
* Check if a given object implements the SwapResponse interface.
*/
declare function instanceOfSwapResponse(value: object): boolean;
declare function SwapResponseFromJSON(json: any): SwapResponse;
declare function SwapResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapResponse;
declare function SwapResponseToJSON(value?: SwapResponse | null): any;
/**
* Swap API
* The heart and soul of Jupiter lies in the Quote and Swap API. ### API Rate Limit Since 1 December 2024, we have updated our API structure. Please refer to [Developer Docs](https://dev.jup.ag/docs/) for further details on usage and rate limits. ### API Usage - API Wrapper Typescript [@jup-ag/api](https://github.com/jup-ag/jupiter-quote-api-node) ### Data Types To Note - Public keys are base58 encoded strings - Raw data such as Vec<u8\\> are base64 encoded strings
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
interface QuoteGetRequest {
inputMint: string;
outputMint: string;
amount: number;
slippageBps?: number;
swapMode?: QuoteGetSwapModeEnum;
dexes?: Array<string>;
excludeDexes?: Array<string>;
restrictIntermediateTokens?: boolean;
onlyDirectRoutes?: boolean;
asLegacyTransaction?: boolean;
platformFeeBps?: number;
maxAccounts?: number;
dynamicSlippage?: boolean;
}
interface SwapInstructionsPostRequest {
swapRequest: SwapRequest;
}
interface SwapPostRequest {
swapRequest: SwapRequest;
}
/**
*
*/
declare class SwapApi extends BaseAPI {
/**
* 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. This can be used in conjunction with the `excludeDexes` or `dexes` parameter.
* program-id-to-label
*/
programIdToLabelGetRaw(initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<{
[key: string]: string;
}>>;
/**
* 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. This can be used in conjunction with the `excludeDexes` or `dexes` parameter.
* program-id-to-label
*/
programIdToLabelGet(initOverrides?: RequestInit | InitOverrideFunction): Promise<{
[key: string]: string;
}>;
/**
* Request for a quote to be used in `POST /swap` :::note Refer to [Swap API doc](https://dev.jup.ag/docs/swap-api/get-quote) for more information :::
* quote
*/
quoteGetRaw(requestParameters: QuoteGetRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<QuoteResponse>>;
/**
* Request for a quote to be used in `POST /swap` :::note Refer to [Swap API doc](https://dev.jup.ag/docs/swap-api/get-quote) for more information :::
* quote
*/
quoteGet(requestParameters: QuoteGetRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<QuoteResponse>;
/**
* Request for swap instructions that you can use from the quote you get from `/quote` :::note Refer to [Swap API doc](https://dev.jup.ag/docs/swap-api/build-swap-transaction#build-your-own-transaction-with-instructions) for more information :::
* swap-instructions
*/
swapInstructionsPostRaw(requestParameters: SwapInstructionsPostRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<SwapInstructionsResponse>>;
/**
* Request for swap instructions that you can use from the quote you get from `/quote` :::note Refer to [Swap API doc](https://dev.jup.ag/docs/swap-api/build-swap-transaction#build-your-own-transaction-with-instructions) for more information :::
* swap-instructions
*/
swapInstructionsPost(requestParameters: SwapInstructionsPostRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<SwapInstructionsResponse>;
/**
* Request for a base64-encoded unsigned swap transaction based on the `/quote` response :::note Refer to [Swap API doc](https://dev.jup.ag/docs/swap-api/build-swap-transaction) for more information :::
* swap
*/
swapPostRaw(requestParameters: SwapPostRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<SwapResponse>>;
/**
* Request for a base64-encoded unsigned swap transaction based on the `/quote` response :::note Refer to [Swap API doc](https://dev.jup.ag/docs/swap-api/build-swap-transaction) for more information :::
* swap
*/
swapPost(requestParameters: SwapPostRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<SwapResponse>;
}
/**
* @export
*/
declare const QuoteGetSwapModeEnum: {
readonly ExactIn: "ExactIn";
readonly ExactOut: "ExactOut";
};
type QuoteGetSwapModeEnum = typeof QuoteGetSwapModeEnum[keyof typeof QuoteGetSwapModeEnum];
/**
* Creates a Jupiter API client with optional API key support
* @param config Configuration parameters
* @returns SwapApi instance
*/
declare const createJupiterApiClient: (config?: ConfigurationParameters) => SwapApi;
export { AccountMeta, AccountMetaFromJSON, AccountMetaFromJSONTyped, AccountMetaToJSON, ApiResponse, BASE_PATH, BaseAPI, BlobApiResponse, COLLECTION_FORMATS, Configuration, ConfigurationParameters, Consume, DefaultConfig, ErrorContext, FetchAPI, FetchError, FetchParams, HTTPBody, HTTPHeaders, HTTPMethod, HTTPQuery, HTTPRequestInit, IndexedRouteMapResponse, IndexedRouteMapResponseFromJSON, IndexedRouteMapResponseFromJSONTyped, IndexedRouteMapResponseToJSON, InitOverrideFunction, Instruction, InstructionFromJSON, InstructionFromJSONTyped, InstructionToJSON, JSONApiResponse, Json, Middleware, ModelPropertyNaming, PlatformFee, PlatformFeeFromJSON, PlatformFeeFromJSONTyped, PlatformFeeToJSON, QuoteGetRequest, QuoteGetSwapModeEnum, QuoteResponse, QuoteResponseFromJSON, QuoteResponseFromJSONTyped, QuoteResponseToJSON, RequestContext, RequestOpts, RequiredError, ResponseContext, ResponseError, ResponseTransformer, RoutePlanStep, RoutePlanStepFromJSON, RoutePlanStepFromJSONTyped, RoutePlanStepToJSON, SwapApi, SwapInfo, SwapInfoFromJSON, SwapInfoFromJSONTyped, SwapInfoToJSON, SwapInstructionsPostRequest, SwapInstructionsResponse, SwapInstructionsResponseFromJSON, SwapInstructionsResponseFromJSONTyped, SwapInstructionsResponseToJSON, SwapMode, SwapModeFromJSON, SwapModeFromJSONTyped, SwapModeToJSON, SwapPostRequest, SwapRequest, SwapRequestFromJSON, SwapRequestFromJSONTyped, SwapRequestPrioritizationFeeLamports, SwapRequestPrioritizationFeeLamportsFromJSON, SwapRequestPrioritizationFeeLamportsFromJSONTyped, SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports, SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsFromJSON, SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsFromJSONTyped, SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum, SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsToJSON, SwapRequestPrioritizationFeeLamportsToJSON, SwapRequestToJSON, SwapResponse, SwapResponseFromJSON, SwapResponseFromJSONTyped, SwapResponseToJSON, TextApiResponse, VoidApiResponse, canConsumeForm, createJupiterApiClient, exists, instanceOfAccountMeta, instanceOfIndexedRouteMapResponse, instanceOfInstruction, instanceOfPlatformFee, instanceOfQuoteResponse, instanceOfRoutePlanStep, instanceOfSwapInfo, instanceOfSwapInstructionsResponse, instanceOfSwapRequest, instanceOfSwapRequestPrioritizationFeeLamports, instanceOfSwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports, instanceOfSwapResponse, mapValues, querystring };