@hawksightco/swagger-client
Version:
OpenAPI client for Hawksight v2 Public API
937 lines (882 loc) • 54.2 kB
text/typescript
/* tslint:disable */
/* eslint-disable */
/**
* Hawksight API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 0.0.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { HawksightPool } from '../models';
import { HawksightPoolResponse } from '../models';
import { InlineResponse200 } from '../models';
import { InlineResponse2001 } from '../models';
import { InlineResponse400 } from '../models';
import { MeteoraPosition } from '../models';
import { RegisterBody } from '../models';
import { TransactionMetadata } from '../models';
import { UserPortfolio } from '../models';
/**
* GeneralEndpointsApi - axios parameter creator
* @export
*/
export const GeneralEndpointsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
* Returns all Meteora positions on Hawksight ever opened, including those already closed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
allTimeMeteoraPositionsGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/allTimeMeteoraPositions`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns all closed positions from a user.
* @param {string} [user] User to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
hawksightClosedPositionsGet: async (user?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/hawksightClosedPositions`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (user !== undefined) {
localVarQueryParameter['user'] = user;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} user Position to search
* @param {string} pool Position to search
* @param {string} positions Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
hawksightPositionAnalyticsGet: async (user: string, pool: string, positions: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'user' is not null or undefined
if (user === null || user === undefined) {
throw new RequiredError('user','Required parameter user was null or undefined when calling hawksightPositionAnalyticsGet.');
}
// verify required parameter 'pool' is not null or undefined
if (pool === null || pool === undefined) {
throw new RequiredError('pool','Required parameter pool was null or undefined when calling hawksightPositionAnalyticsGet.');
}
// verify required parameter 'positions' is not null or undefined
if (positions === null || positions === undefined) {
throw new RequiredError('positions','Required parameter positions was null or undefined when calling hawksightPositionAnalyticsGet.');
}
const localVarPath = `/hawksightPositionAnalytics`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (user !== undefined) {
localVarQueryParameter['user'] = user;
}
if (pool !== undefined) {
localVarQueryParameter['pool'] = pool;
}
if (positions !== undefined) {
localVarQueryParameter['positions'] = positions;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Return info about the specified pool.
* @param {string} pairAddress The address of the pool to query.
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
poolGet: async (pairAddress: string, protocol?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'pairAddress' is not null or undefined
if (pairAddress === null || pairAddress === undefined) {
throw new RequiredError('pairAddress','Required parameter pairAddress was null or undefined when calling poolGet.');
}
const localVarPath = `/pool`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (pairAddress !== undefined) {
localVarQueryParameter['pairAddress'] = pairAddress;
}
if (protocol !== undefined) {
localVarQueryParameter['protocol'] = protocol;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
pools2Get: async (hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/pools2`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (hash !== undefined) {
localVarQueryParameter['hash'] = hash;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (skip !== undefined) {
localVarQueryParameter['skip'] = skip;
}
if (sortedBy !== undefined) {
localVarQueryParameter['sortedBy'] = sortedBy;
}
if (orderBy !== undefined) {
localVarQueryParameter['orderBy'] = orderBy;
}
if (keyword !== undefined) {
localVarQueryParameter['keyword'] = keyword;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
poolsGet: async (hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, protocol?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/pools`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (hash !== undefined) {
localVarQueryParameter['hash'] = hash;
}
if (page !== undefined) {
localVarQueryParameter['page'] = page;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (skip !== undefined) {
localVarQueryParameter['skip'] = skip;
}
if (sortedBy !== undefined) {
localVarQueryParameter['sortedBy'] = sortedBy;
}
if (orderBy !== undefined) {
localVarQueryParameter['orderBy'] = orderBy;
}
if (keyword !== undefined) {
localVarQueryParameter['keyword'] = keyword;
}
if (protocol !== undefined) {
localVarQueryParameter['protocol'] = protocol;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Retrieves the user's portfolio based on the provided wallet and optional pool address.
* @param {string} wallet The unique identifier for the user's wallet.
* @param {string} [pool] The pool address. If not specified, uses default. See /pools endpoint for available pools.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
portfolioGet: async (wallet: string, pool?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'wallet' is not null or undefined
if (wallet === null || wallet === undefined) {
throw new RequiredError('wallet','Required parameter wallet was null or undefined when calling portfolioGet.');
}
const localVarPath = `/portfolio`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (wallet !== undefined) {
localVarQueryParameter['wallet'] = wallet;
}
if (pool !== undefined) {
localVarQueryParameter['pool'] = pool;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} position Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
positionAnalyticsGet: async (position: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'position' is not null or undefined
if (position === null || position === undefined) {
throw new RequiredError('position','Required parameter position was null or undefined when calling positionAnalyticsGet.');
}
const localVarPath = `/positionAnalytics`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (position !== undefined) {
localVarQueryParameter['position'] = position;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Generates a transaction to create a user's program derived address (PDA).
* @param {RegisterBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
registerPost: async (body: RegisterBody, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'body' is not null or undefined
if (body === null || body === undefined) {
throw new RequiredError('body','Required parameter body was null or undefined when calling registerPost.');
}
const localVarPath = `/register`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
localVarHeaderParameter['Content-Type'] = 'application/json';
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns a token supported by Hawksight.
* @param {string} address The address of the token.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
tokenGet: async (address: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'address' is not null or undefined
if (address === null || address === undefined) {
throw new RequiredError('address','Required parameter address was null or undefined when calling tokenGet.');
}
const localVarPath = `/token`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (address !== undefined) {
localVarQueryParameter['address'] = address;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
/**
* Returns all tokens supported by Hawksight.
* @param {string} [keyword] Keyword for search
* @param {number} [limit] Max number of results returned
* @param {boolean} [all] show all (bypass limit)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
tokensGet: async (keyword?: string, limit?: number, all?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/tokens`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
if (keyword !== undefined) {
localVarQueryParameter['keyword'] = keyword;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (all !== undefined) {
localVarQueryParameter['all'] = all;
}
const query = new URLSearchParams(localVarUrlObj.search);
for (const key in localVarQueryParameter) {
query.set(key, localVarQueryParameter[key]);
}
for (const key in options.params) {
query.set(key, options.params[key]);
}
localVarUrlObj.search = (new URLSearchParams(query)).toString();
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
options: localVarRequestOptions,
};
},
}
};
/**
* GeneralEndpointsApi - functional programming interface
* @export
*/
export const GeneralEndpointsApiFp = function(configuration?: Configuration) {
return {
/**
* Returns all Meteora positions on Hawksight ever opened, including those already closed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async allTimeMeteoraPositionsGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<MeteoraPosition>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).allTimeMeteoraPositionsGet(options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns all closed positions from a user.
* @param {string} [user] User to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async hawksightClosedPositionsGet(user?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<InlineResponse2001>>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).hawksightClosedPositionsGet(user, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} user Position to search
* @param {string} pool Position to search
* @param {string} positions Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async hawksightPositionAnalyticsGet(user: string, pool: string, positions: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).hawksightPositionAnalyticsGet(user, pool, positions, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Return info about the specified pool.
* @param {string} pairAddress The address of the pool to query.
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async poolGet(pairAddress: string, protocol?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<HawksightPoolResponse>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).poolGet(pairAddress, protocol, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async pools2Get(hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<HawksightPool>>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).pools2Get(hash, page, limit, skip, sortedBy, orderBy, keyword, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async poolsGet(hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, protocol?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<HawksightPool>>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).poolsGet(hash, page, limit, skip, sortedBy, orderBy, keyword, protocol, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Retrieves the user's portfolio based on the provided wallet and optional pool address.
* @param {string} wallet The unique identifier for the user's wallet.
* @param {string} [pool] The pool address. If not specified, uses default. See /pools endpoint for available pools.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async portfolioGet(wallet: string, pool?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<UserPortfolio>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).portfolioGet(wallet, pool, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} position Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async positionAnalyticsGet(position: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).positionAnalyticsGet(position, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Generates a transaction to create a user's program derived address (PDA).
* @param {RegisterBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async registerPost(body: RegisterBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<TransactionMetadata>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).registerPost(body, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns a token supported by Hawksight.
* @param {string} address The address of the token.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tokenGet(address: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<InlineResponse200>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).tokenGet(address, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
/**
* Returns all tokens supported by Hawksight.
* @param {string} [keyword] Keyword for search
* @param {number} [limit] Max number of results returned
* @param {boolean} [all] show all (bypass limit)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tokensGet(keyword?: string, limit?: number, all?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<InlineResponse200>>>> {
const localVarAxiosArgs = await GeneralEndpointsApiAxiosParamCreator(configuration).tokensGet(keyword, limit, all, options);
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
return axios.request(axiosRequestArgs);
};
},
}
};
/**
* GeneralEndpointsApi - factory interface
* @export
*/
export const GeneralEndpointsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
return {
/**
* Returns all Meteora positions on Hawksight ever opened, including those already closed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async allTimeMeteoraPositionsGet(options?: AxiosRequestConfig): Promise<AxiosResponse<MeteoraPosition>> {
return GeneralEndpointsApiFp(configuration).allTimeMeteoraPositionsGet(options).then((request) => request(axios, basePath));
},
/**
* Returns all closed positions from a user.
* @param {string} [user] User to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async hawksightClosedPositionsGet(user?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<InlineResponse2001>>> {
return GeneralEndpointsApiFp(configuration).hawksightClosedPositionsGet(user, options).then((request) => request(axios, basePath));
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} user Position to search
* @param {string} pool Position to search
* @param {string} positions Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async hawksightPositionAnalyticsGet(user: string, pool: string, positions: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return GeneralEndpointsApiFp(configuration).hawksightPositionAnalyticsGet(user, pool, positions, options).then((request) => request(axios, basePath));
},
/**
* Return info about the specified pool.
* @param {string} pairAddress The address of the pool to query.
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async poolGet(pairAddress: string, protocol?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<HawksightPoolResponse>> {
return GeneralEndpointsApiFp(configuration).poolGet(pairAddress, protocol, options).then((request) => request(axios, basePath));
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async pools2Get(hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<HawksightPool>>> {
return GeneralEndpointsApiFp(configuration).pools2Get(hash, page, limit, skip, sortedBy, orderBy, keyword, options).then((request) => request(axios, basePath));
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async poolsGet(hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, protocol?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<HawksightPool>>> {
return GeneralEndpointsApiFp(configuration).poolsGet(hash, page, limit, skip, sortedBy, orderBy, keyword, protocol, options).then((request) => request(axios, basePath));
},
/**
* Retrieves the user's portfolio based on the provided wallet and optional pool address.
* @param {string} wallet The unique identifier for the user's wallet.
* @param {string} [pool] The pool address. If not specified, uses default. See /pools endpoint for available pools.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async portfolioGet(wallet: string, pool?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<UserPortfolio>> {
return GeneralEndpointsApiFp(configuration).portfolioGet(wallet, pool, options).then((request) => request(axios, basePath));
},
/**
* Returns all pools integrated by Hawksight.
* @param {string} position Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async positionAnalyticsGet(position: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
return GeneralEndpointsApiFp(configuration).positionAnalyticsGet(position, options).then((request) => request(axios, basePath));
},
/**
* Generates a transaction to create a user's program derived address (PDA).
* @param {RegisterBody} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async registerPost(body: RegisterBody, options?: AxiosRequestConfig): Promise<AxiosResponse<TransactionMetadata>> {
return GeneralEndpointsApiFp(configuration).registerPost(body, options).then((request) => request(axios, basePath));
},
/**
* Returns a token supported by Hawksight.
* @param {string} address The address of the token.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tokenGet(address: string, options?: AxiosRequestConfig): Promise<AxiosResponse<InlineResponse200>> {
return GeneralEndpointsApiFp(configuration).tokenGet(address, options).then((request) => request(axios, basePath));
},
/**
* Returns all tokens supported by Hawksight.
* @param {string} [keyword] Keyword for search
* @param {number} [limit] Max number of results returned
* @param {boolean} [all] show all (bypass limit)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tokensGet(keyword?: string, limit?: number, all?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<InlineResponse200>>> {
return GeneralEndpointsApiFp(configuration).tokensGet(keyword, limit, all, options).then((request) => request(axios, basePath));
},
};
};
/**
* GeneralEndpointsApi - object-oriented interface
* @export
* @class GeneralEndpointsApi
* @extends {BaseAPI}
*/
export class GeneralEndpointsApi extends BaseAPI {
/**
* Returns all Meteora positions on Hawksight ever opened, including those already closed.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GeneralEndpointsApi
*/
public async allTimeMeteoraPositionsGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<MeteoraPosition>> {
return GeneralEndpointsApiFp(this.configuration).allTimeMeteoraPositionsGet(options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns all closed positions from a user.
* @param {string} [user] User to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GeneralEndpointsApi
*/
public async hawksightClosedPositionsGet(user?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<InlineResponse2001>>> {
return GeneralEndpointsApiFp(this.configuration).hawksightClosedPositionsGet(user, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns all pools integrated by Hawksight.
* @param {string} user Position to search
* @param {string} pool Position to search
* @param {string} positions Position to search
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GeneralEndpointsApi
*/
public async hawksightPositionAnalyticsGet(user: string, pool: string, positions: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
return GeneralEndpointsApiFp(this.configuration).hawksightPositionAnalyticsGet(user, pool, positions, options).then((request) => request(this.axios, this.basePath));
}
/**
* Return info about the specified pool.
* @param {string} pairAddress The address of the pool to query.
* @param {string} [protocol] Either meteora or orca.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GeneralEndpointsApi
*/
public async poolGet(pairAddress: string, protocol?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<HawksightPoolResponse>> {
return GeneralEndpointsApiFp(this.configuration).poolGet(pairAddress, protocol, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns all pools integrated by Hawksight.
* @param {string} [hash] Optional hash parameter
* @param {number} [page] Page number for pagination
* @param {number} [limit] Number of items per page
* @param {number} [skip] Number of items to skip
* @param {string} [sortedBy] Field to sort the results by
* @param {string} [orderBy] Order of sorting (ascending or descending)
* @param {string} [keyword] Optional keyword for filtering pools
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof GeneralEndpointsApi
*/
public async pools2Get(hash?: string, page?: number, limit?: number, skip?: number, sortedBy?: string, orderBy?: string, keyword?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<HawksightPool>>> {
return GeneralEndpointsApiFp(this.configuration).pools2Get(hash, page, limit, skip, sortedBy, orderBy, keyword, op