@jup-ag/api
Version:
## Generate typescript types from swagger schema
1,207 lines (1,177 loc) • 49.3 kB
text/typescript
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 JitoTipLamports
*/
interface JitoTipLamports {
/**
* - 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 at https://docs.jito.wtf/
*
* @type {number}
* @memberof JitoTipLamports
*/
jitoTipLamports: number;
}
/**
* Check if a given object implements the JitoTipLamports interface.
*/
declare function instanceOfJitoTipLamports(value: object): boolean;
declare function JitoTipLamportsFromJSON(json: any): JitoTipLamports;
declare function JitoTipLamportsFromJSONTyped(json: any, ignoreDiscriminator: boolean): JitoTipLamports;
declare function JitoTipLamportsToJSON(value?: JitoTipLamports | null): any;
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 JitoTipLamportsWithPayerJitoTipLamportsWithPayer
*/
interface JitoTipLamportsWithPayerJitoTipLamportsWithPayer {
/**
* Exact amount of lamports to use for the tip
* @type {number}
* @memberof JitoTipLamportsWithPayerJitoTipLamportsWithPayer
*/
lamports: number;
/**
* Public key of an account that will be used to pay for the tip
* @type {string}
* @memberof JitoTipLamportsWithPayerJitoTipLamportsWithPayer
*/
payer: string;
}
/**
* Check if a given object implements the JitoTipLamportsWithPayerJitoTipLamportsWithPayer interface.
*/
declare function instanceOfJitoTipLamportsWithPayerJitoTipLamportsWithPayer(value: object): boolean;
declare function JitoTipLamportsWithPayerJitoTipLamportsWithPayerFromJSON(json: any): JitoTipLamportsWithPayerJitoTipLamportsWithPayer;
declare function JitoTipLamportsWithPayerJitoTipLamportsWithPayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): JitoTipLamportsWithPayerJitoTipLamportsWithPayer;
declare function JitoTipLamportsWithPayerJitoTipLamportsWithPayerToJSON(value?: JitoTipLamportsWithPayerJitoTipLamportsWithPayer | null): any;
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 JitoTipLamportsWithPayer
*/
interface JitoTipLamportsWithPayer {
/**
*
* @type {JitoTipLamportsWithPayerJitoTipLamportsWithPayer}
* @memberof JitoTipLamportsWithPayer
*/
jitoTipLamportsWithPayer: JitoTipLamportsWithPayerJitoTipLamportsWithPayer;
}
/**
* Check if a given object implements the JitoTipLamportsWithPayer interface.
*/
declare function instanceOfJitoTipLamportsWithPayer(value: object): boolean;
declare function JitoTipLamportsWithPayerFromJSON(json: any): JitoTipLamportsWithPayer;
declare function JitoTipLamportsWithPayerFromJSONTyped(json: any, ignoreDiscriminator: boolean): JitoTipLamportsWithPayer;
declare function JitoTipLamportsWithPayerToJSON(value?: JitoTipLamportsWithPayer | null): any;
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports
*/
interface PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports {
/**
*
* @type {string}
* @memberof PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports
*/
priorityLevel: PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum;
/**
* - Maximum lamports to cap the priority fee estimation, to prevent overpaying
*
* @type {number}
* @memberof PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports
*/
maxLamports: number;
/**
* - A boolean to choose between using a global or local fee market to estimate. If `global` is set to `false`, the estimation focuses on fees relevant to the **writable accounts** involved in the instruction.
*
* @type {boolean}
* @memberof PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports
*/
global?: boolean;
}
/**
* @export
*/
declare const PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum: {
readonly Medium: "medium";
readonly High: "high";
readonly VeryHigh: "veryHigh";
};
type PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum = typeof PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum[keyof typeof PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum];
/**
* Check if a given object implements the PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports interface.
*/
declare function instanceOfPriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports(value: object): boolean;
declare function PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsFromJSON(json: any): PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports;
declare function PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports;
declare function PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsToJSON(value?: PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports | null): any;
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 PriorityLevelWithMaxLamports
*/
interface PriorityLevelWithMaxLamports {
/**
*
* @type {PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports}
* @memberof PriorityLevelWithMaxLamports
*/
priorityLevelWithMaxLamports: PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports;
}
/**
* Check if a given object implements the PriorityLevelWithMaxLamports interface.
*/
declare function instanceOfPriorityLevelWithMaxLamports(value: object): boolean;
declare function PriorityLevelWithMaxLamportsFromJSON(json: any): PriorityLevelWithMaxLamports;
declare function PriorityLevelWithMaxLamportsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PriorityLevelWithMaxLamports;
declare function PriorityLevelWithMaxLamportsToJSON(value?: PriorityLevelWithMaxLamports | null): any;
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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;
}
/**
* 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 | null;
/**
*
* @type {number}
* @memberof RoutePlanStep
*/
bps?: 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* - The value includes platform fees and DEX fees, excluding slippage
*
* @type {string}
* @memberof QuoteResponse
*/
outAmount: string;
/**
* - Calculated minimum output amount after accounting for `slippageBps` on the `outAmount` value
* - Not used by `/swap` endpoint to build transaction
*
* @type {string}
* @memberof QuoteResponse
*/
otherAmountThreshold: string;
/**
* - The version of instruction to use in the swap program
*
* @type {string}
* @memberof QuoteResponse
*/
instructionVersion?: QuoteResponseInstructionVersionEnum | null;
/**
*
* @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;
}
/**
* @export
*/
declare const QuoteResponseInstructionVersionEnum: {
readonly V1: "V1";
readonly V2: "V2";
};
type QuoteResponseInstructionVersionEnum = typeof QuoteResponseInstructionVersionEnum[keyof typeof QuoteResponseInstructionVersionEnum];
/**
* 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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 jito tips using the `prioritizationFeeLamports` parameter, 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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.
*/
/**
* @type SwapRequestPrioritizationFeeLamports
* - 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
* - Defaults to `auto`, but preferred to use `priorityLevelWithMaxLamports` as it may be more accurate when accounting local fee market
* - Fixed lamports can be passed in as an integer in the `prioritizationFeeLamports` parameter
*
* @export
*/
type SwapRequestPrioritizationFeeLamports = JitoTipLamports | JitoTipLamportsWithPayer | PriorityLevelWithMaxLamports;
declare function SwapRequestPrioritizationFeeLamportsFromJSON(json: any): SwapRequestPrioritizationFeeLamports;
declare function SwapRequestPrioritizationFeeLamportsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SwapRequestPrioritizationFeeLamports;
declare function SwapRequestPrioritizationFeeLamportsToJSON(value?: SwapRequestPrioritizationFeeLamports | null): any;
/**
* Swap API
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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;
/**
* - Allow a custom payer to pay for the transaction fees and rent of token accounts
* - Note that users can close their ATAs elsewhere and have you reopen them again, your fees should account for this
*
* @type {string}
* @memberof SwapRequest
*/
payer?: string;
/**
* - To automatically wrap/unwrap SOL in the transaction, as WSOL is an SPL token while native SOL is not
* - When true and input mint is SOL, it will wrap the SOL amount to WSOL and swap
* - When true and output mint is SOL, it will unwrap the WSOL back to SOL
* - When false and input mint is SOL, it will use existing WSOL amount to swap
* - When false and output mint is SOL, it will not unwrap the WSOL to SOL
* - To set this parameter to false, you need to have the WSOL token account initialized
*
* @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 initialized 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**
* - Swap API no longer requires the use of the Referral Program
* - If `platformFeeBps` is passed in `/quote`, the `feeAccount` must be passed as well
*
* @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
* - `destinationTokenAccount` and `nativeDestinationAccount` are mutually exclusive
*
* @type {string}
* @memberof SwapRequest
*/
destinationTokenAccount?: string;
/**
* - Public key of an account that will be used to receive the native SOL token out of the swap
* - If not provided, the swap will default unwrap the WSOL and transfer the native SOL to the swap authority account
* - If provided, we will unwrap the WSOL and transfer the native SOL to the account
* - Only works if the output mint is SOL, is using the V2 instructions and the account passed in is not owned by token program
* - When sending native SOL to a new account, you must swap at least enough to cover the rent required to create it.
* - `destinationTokenAccount` and `nativeDestinationAccount` are mutually exclusive
*
* @type {string}
* @memberof SwapRequest
*/
nativeDestinationAccount?: 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
* - The returned swap transaction will still attempt to create required accounts regardless if it exists or not
*
* @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.
* - This is no longer maintained, we are focusing efforts on RTSE on Ultra Swap API
*
* @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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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
* API reference for Jupiter\'s Swap API, including Quote, Swap and Swap Instructions endpoints. ### Rate Limits Since 1 December 2024, we have updated our API structure. Please refer to https://dev.jup.ag/ for further details on usage and rate limits. ### Usage - API Wrapper Typescript 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;
instructionVersion?: QuoteGetInstructionVersionEnum;
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`
* quote
*/
quoteGetRaw(requestParameters: QuoteGetRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<QuoteResponse>>;
/**
* Request for a quote to be used in `POST /swap`
* quote
*/
quoteGet(requestParameters: QuoteGetRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<QuoteResponse>;
/**
* Request for swap instructions that you can use from the quote you get from `/quote`
* 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`
* swap-instructions
*/
swapInstructionsPost(requestParameters: SwapInstructionsPostRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<SwapInstructionsResponse>;
/**
* Request for a base64-encoded unsigned swap transaction based on the `/quote` response
* swap
*/
swapPostRaw(requestParameters: SwapPostRequest, initOverrides?: RequestInit | InitOverrideFunction): Promise<ApiResponse<SwapResponse>>;
/**
* Request for a base64-encoded unsigned swap transaction based on the `/quote` response
* 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];
/**
* @export
*/
declare const QuoteGetInstructionVersionEnum: {
readonly V1: "V1";
readonly V2: "V2";
};
type QuoteGetInstructionVersionEnum = typeof QuoteGetInstructionVersionEnum[keyof typeof QuoteGetInstructionVersionEnum];
/**
* 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, JitoTipLamports, JitoTipLamportsFromJSON, JitoTipLamportsFromJSONTyped, JitoTipLamportsToJSON, JitoTipLamportsWithPayer, JitoTipLamportsWithPayerFromJSON, JitoTipLamportsWithPayerFromJSONTyped, JitoTipLamportsWithPayerJitoTipLamportsWithPayer, JitoTipLamportsWithPayerJitoTipLamportsWithPayerFromJSON, JitoTipLamportsWithPayerJitoTipLamportsWithPayerFromJSONTyped, JitoTipLamportsWithPayerJitoTipLamportsWithPayerToJSON, JitoTipLamportsWithPayerToJSON, Json, Middleware, ModelPropertyNaming, PlatformFee, PlatformFeeFromJSON, PlatformFeeFromJSONTyped, PlatformFeeToJSON, PriorityLevelWithMaxLamports, PriorityLevelWithMaxLamportsFromJSON, PriorityLevelWithMaxLamportsFromJSONTyped, PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports, PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsFromJSON, PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsFromJSONTyped, PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsPriorityLevelEnum, PriorityLevelWithMaxLamportsPriorityLevelWithMaxLamportsToJSON, PriorityLevelWithMaxLamportsToJSON, QuoteGetInstructionVersionEnum, QuoteGetRequest, QuoteGetSwapModeEnum, QuoteResponse, QuoteResponseFromJSON, QuoteResponseFromJSONTyped, QuoteResponseInstructionVersionEnum, 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, SwapRequestPrioritizationFeeLamportsToJSON, SwapRequestToJSON, SwapResponse, SwapResponseFromJSON, SwapResponseFromJSONTyped, SwapResponseToJSON, TextApiResponse, VoidApiResponse, canConsumeForm, createJupiterApiClient, exists, instanceOfAccountMeta, instanceOfIndexedRouteMapResponse, instanceOfInstruction, instanceOfJitoTipLamports, instanceOfJitoTipLamportsWithPayer, instanceOfJitoTipLamportsWithPayerJitoTipLamportsWithPayer, instanceOfPlatformFee, instanceOfPriorityLevelWithMaxLamports, instanceOfPriorityLevelWithMaxLamportsPriorityLevelWithMaxLamports, instanceOfQuoteResponse, instanceOfRoutePlanStep, instanceOfSwapInfo, instanceOfSwapInstructionsResponse, instanceOfSwapRequest, instanceOfSwapResponse, mapValues, querystring };