Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
apis/SwapApi.ts
apis/TokenApi.ts
apis/UltraApi.ts
apis/index.ts
index.ts
models/AccountMeta.ts
models/IndexedRouteMapResponse.ts
models/ErrorResponse.ts
models/GetOrder200Response.ts
models/GetOrder200ResponsePlatformFee.ts
models/GetOrder200ResponseRoutePlanInner.ts
models/GetOrder200ResponseRoutePlanInnerSwapInfo.ts
models/GetOrder400Response.ts
models/GetRouters200ResponseInner.ts
models/GetShield200Response.ts
models/GetShield200ResponseWarningsValueInner.ts
models/HoldingsResponse.ts
models/Instruction.ts
models/MintInformation.ts
models/MintInformationAudit.ts
models/MintInformationFirstPool.ts
models/NativeHoldingsResponse.ts
models/PlatformFee.ts
models/PostExecute200Response.ts
models/PostExecute200ResponseSwapEventsInner.ts
models/PostExecute400Response.ts
models/PostExecuteRequest.ts
models/QuoteResponse.ts
models/RoutePlanStep.ts
models/SwapInfo.ts
Expand All @@ -14,5 +33,7 @@ models/SwapRequest.ts
models/SwapRequestPrioritizationFeeLamports.ts
models/SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamports.ts
models/SwapResponse.ts
models/SwapStats.ts
models/TokenAccount.ts
models/index.ts
runtime.ts
218 changes: 218 additions & 0 deletions generated/apis/TokenApi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
/* tslint:disable */
/* eslint-disable */
/**
* 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.
*/


import * as runtime from '../runtime';
import type {
ErrorResponse,
GetOrder400Response,
MintInformation,
} from '../models/index';
import {
ErrorResponseFromJSON,
ErrorResponseToJSON,
GetOrder400ResponseFromJSON,
GetOrder400ResponseToJSON,
MintInformationFromJSON,
MintInformationToJSON,
} from '../models/index';

export interface GetCategoryByIntervalRequest {
category: GetCategoryByIntervalCategoryEnum;
interval: GetCategoryByIntervalIntervalEnum;
limit?: number;
}

export interface GetTokensByTagRequest {
query: GetTokensByTagQueryEnum;
}

export interface SearchTokensRequest {
query: string;
}

/**
*
*/
export class TokenApi extends runtime.BaseAPI {

/**
* Returns an array of mints and their information for the given category and interval :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* category
*/
async getCategoryByIntervalRaw(requestParameters: GetCategoryByIntervalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MintInformation>>> {
if (requestParameters.category === null || requestParameters.category === undefined) {
throw new runtime.RequiredError('category','Required parameter requestParameters.category was null or undefined when calling getCategoryByInterval.');
}

if (requestParameters.interval === null || requestParameters.interval === undefined) {
throw new runtime.RequiredError('interval','Required parameter requestParameters.interval was null or undefined when calling getCategoryByInterval.');
}

const queryParameters: any = {};

if (requestParameters.limit !== undefined) {
queryParameters['limit'] = requestParameters.limit;
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/{category}/{interval}`.replace(`{${"category"}}`, encodeURIComponent(String(requestParameters.category))).replace(`{${"interval"}}`, encodeURIComponent(String(requestParameters.interval))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MintInformationFromJSON));
}

/**
* Returns an array of mints and their information for the given category and interval :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* category
*/
async getCategoryByInterval(requestParameters: GetCategoryByIntervalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MintInformation>> {
const response = await this.getCategoryByIntervalRaw(requestParameters, initOverrides);
return await response.value();
}

/**
* Returns an array of mints that recently had their **first created pool** - Default to 30 mints in response :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* recent
*/
async getRecentTokensRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MintInformation>>> {
const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/recent`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MintInformationFromJSON));
}

/**
* Returns an array of mints that recently had their **first created pool** - Default to 30 mints in response :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* recent
*/
async getRecentTokens(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MintInformation>> {
const response = await this.getRecentTokensRaw(initOverrides);
return await response.value();
}

/**
* Request an array of mints and their information by a tag - Note that this will return the entire array of existing mints that belongs to the tag. :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* tag
*/
async getTokensByTagRaw(requestParameters: GetTokensByTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MintInformation>>> {
if (requestParameters.query === null || requestParameters.query === undefined) {
throw new runtime.RequiredError('query','Required parameter requestParameters.query was null or undefined when calling getTokensByTag.');
}

const queryParameters: any = {};

if (requestParameters.query !== undefined) {
queryParameters['query'] = requestParameters.query;
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/tag`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MintInformationFromJSON));
}

/**
* Request an array of mints and their information by a tag - Note that this will return the entire array of existing mints that belongs to the tag. :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* tag
*/
async getTokensByTag(requestParameters: GetTokensByTagRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MintInformation>> {
const response = await this.getTokensByTagRaw(requestParameters, initOverrides);
return await response.value();
}

/**
* Request a search by token\'s symbol, name or mint address :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* search
*/
async searchTokensRaw(requestParameters: SearchTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MintInformation>>> {
if (requestParameters.query === null || requestParameters.query === undefined) {
throw new runtime.RequiredError('query','Required parameter requestParameters.query was null or undefined when calling searchTokens.');
}

const queryParameters: any = {};

if (requestParameters.query !== undefined) {
queryParameters['query'] = requestParameters.query;
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/search`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MintInformationFromJSON));
}

/**
* Request a search by token\'s symbol, name or mint address :::note - Refer to [Token API doc](/docs/token-api/v2) for more information :::
* search
*/
async searchTokens(requestParameters: SearchTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MintInformation>> {
const response = await this.searchTokensRaw(requestParameters, initOverrides);
return await response.value();
}

}

/**
* @export
*/
export const GetCategoryByIntervalCategoryEnum = {
Toporganicscore: 'toporganicscore',
Toptraded: 'toptraded',
Toptrending: 'toptrending'
} as const;
export type GetCategoryByIntervalCategoryEnum = typeof GetCategoryByIntervalCategoryEnum[keyof typeof GetCategoryByIntervalCategoryEnum];
/**
* @export
*/
export const GetCategoryByIntervalIntervalEnum = {
_5m: '5m',
_1h: '1h',
_6h: '6h',
_24h: '24h'
} as const;
export type GetCategoryByIntervalIntervalEnum = typeof GetCategoryByIntervalIntervalEnum[keyof typeof GetCategoryByIntervalIntervalEnum];
/**
* @export
*/
export const GetTokensByTagQueryEnum = {
Lst: 'lst',
Verified: 'verified'
} as const;
export type GetTokensByTagQueryEnum = typeof GetTokensByTagQueryEnum[keyof typeof GetTokensByTagQueryEnum];
Loading