/* 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 { InlineResponse2002 } from '../models';
import { InlineResponse400 } from '../models';
import { PriorityFeeEstimate } from '../models';
import { UtilFindAltWithTxBody } from '../models';
import { UtilGetPriorityFeeEstimateBody } from '../models';
/**
 * GeneralUtilityEndpointsApi - axios parameter creator
 * @export
 */
export const GeneralUtilityEndpointsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns OLHCV data of a given contract address from Birdeye
         * @param {string} address The contract address.
         * @param {string} timeframe Candlestick timeframe
         * @param {number} timeFrom the start time in seconds.
         * @param {number} timeTo The end time in seconds.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        utilCandlestickGet: async (address: string, timeframe: string, timeFrom: number, timeTo: number, 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 utilCandlestickGet.');
            }
            // verify required parameter 'timeframe' is not null or undefined
            if (timeframe === null || timeframe === undefined) {
                throw new RequiredError('timeframe','Required parameter timeframe was null or undefined when calling utilCandlestickGet.');
            }
            // verify required parameter 'timeFrom' is not null or undefined
            if (timeFrom === null || timeFrom === undefined) {
                throw new RequiredError('timeFrom','Required parameter timeFrom was null or undefined when calling utilCandlestickGet.');
            }
            // verify required parameter 'timeTo' is not null or undefined
            if (timeTo === null || timeTo === undefined) {
                throw new RequiredError('timeTo','Required parameter timeTo was null or undefined when calling utilCandlestickGet.');
            }
            const localVarPath = `/util/candlestick`;
            // 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;
            }

            if (timeframe !== undefined) {
                localVarQueryParameter['timeframe'] = timeframe;
            }

            if (timeFrom !== undefined) {
                localVarQueryParameter['time_from'] = timeFrom;
            }

            if (timeTo !== undefined) {
                localVarQueryParameter['time_to'] = timeTo;
            }

            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,
            };
        },
        /**
         * Find address lookup tables from Jupiter from given transaction metadata.
         * @param {UtilFindAltWithTxBody} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        utilFindAltWithTxPost: async (body: UtilFindAltWithTxBody, 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 utilFindAltWithTxPost.');
            }
            const localVarPath = `/util/findAltWithTx`;
            // 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,
            };
        },
        /**
         * Computes fees from given hawksight transaction.
         * @param {UtilGetPriorityFeeEstimateBody} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        utilGetPriorityFeeEstimatePost: async (body: UtilGetPriorityFeeEstimateBody, 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 utilGetPriorityFeeEstimatePost.');
            }
            const localVarPath = `/util/getPriorityFeeEstimate`;
            // 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,
            };
        },
    }
};

/**
 * GeneralUtilityEndpointsApi - functional programming interface
 * @export
 */
export const GeneralUtilityEndpointsApiFp = function(configuration?: Configuration) {
    return {
        /**
         * Returns OLHCV data of a given contract address from Birdeye
         * @param {string} address The contract address.
         * @param {string} timeframe Candlestick timeframe
         * @param {number} timeFrom the start time in seconds.
         * @param {number} timeTo The end time in seconds.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async utilCandlestickGet(address: string, timeframe: string, timeFrom: number, timeTo: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<InlineResponse2002>>> {
            const localVarAxiosArgs = await GeneralUtilityEndpointsApiAxiosParamCreator(configuration).utilCandlestickGet(address, timeframe, timeFrom, timeTo, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Find address lookup tables from Jupiter from given transaction metadata.
         * @param {UtilFindAltWithTxBody} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async utilFindAltWithTxPost(body: UtilFindAltWithTxBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<string>>>> {
            const localVarAxiosArgs = await GeneralUtilityEndpointsApiAxiosParamCreator(configuration).utilFindAltWithTxPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * Computes fees from given hawksight transaction.
         * @param {UtilGetPriorityFeeEstimateBody} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async utilGetPriorityFeeEstimatePost(body: UtilGetPriorityFeeEstimateBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<PriorityFeeEstimate>>> {
            const localVarAxiosArgs = await GeneralUtilityEndpointsApiAxiosParamCreator(configuration).utilGetPriorityFeeEstimatePost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
    }
};

/**
 * GeneralUtilityEndpointsApi - factory interface
 * @export
 */
export const GeneralUtilityEndpointsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    return {
        /**
         * Returns OLHCV data of a given contract address from Birdeye
         * @param {string} address The contract address.
         * @param {string} timeframe Candlestick timeframe
         * @param {number} timeFrom the start time in seconds.
         * @param {number} timeTo The end time in seconds.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async utilCandlestickGet(address: string, timeframe: string, timeFrom: number, timeTo: number, options?: AxiosRequestConfig): Promise<AxiosResponse<InlineResponse2002>> {
            return GeneralUtilityEndpointsApiFp(configuration).utilCandlestickGet(address, timeframe, timeFrom, timeTo, options).then((request) => request(axios, basePath));
        },
        /**
         * Find address lookup tables from Jupiter from given transaction metadata.
         * @param {UtilFindAltWithTxBody} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async utilFindAltWithTxPost(body: UtilFindAltWithTxBody, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<string>>> {
            return GeneralUtilityEndpointsApiFp(configuration).utilFindAltWithTxPost(body, options).then((request) => request(axios, basePath));
        },
        /**
         * Computes fees from given hawksight transaction.
         * @param {UtilGetPriorityFeeEstimateBody} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async utilGetPriorityFeeEstimatePost(body: UtilGetPriorityFeeEstimateBody, options?: AxiosRequestConfig): Promise<AxiosResponse<PriorityFeeEstimate>> {
            return GeneralUtilityEndpointsApiFp(configuration).utilGetPriorityFeeEstimatePost(body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * GeneralUtilityEndpointsApi - object-oriented interface
 * @export
 * @class GeneralUtilityEndpointsApi
 * @extends {BaseAPI}
 */
export class GeneralUtilityEndpointsApi extends BaseAPI {
    /**
     * Returns OLHCV data of a given contract address from Birdeye
     * @param {string} address The contract address.
     * @param {string} timeframe Candlestick timeframe
     * @param {number} timeFrom the start time in seconds.
     * @param {number} timeTo The end time in seconds.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof GeneralUtilityEndpointsApi
     */
    public async utilCandlestickGet(address: string, timeframe: string, timeFrom: number, timeTo: number, options?: AxiosRequestConfig) : Promise<AxiosResponse<InlineResponse2002>> {
        return GeneralUtilityEndpointsApiFp(this.configuration).utilCandlestickGet(address, timeframe, timeFrom, timeTo, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Find address lookup tables from Jupiter from given transaction metadata.
     * @param {UtilFindAltWithTxBody} body 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof GeneralUtilityEndpointsApi
     */
    public async utilFindAltWithTxPost(body: UtilFindAltWithTxBody, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<string>>> {
        return GeneralUtilityEndpointsApiFp(this.configuration).utilFindAltWithTxPost(body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Computes fees from given hawksight transaction.
     * @param {UtilGetPriorityFeeEstimateBody} body 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof GeneralUtilityEndpointsApi
     */
    public async utilGetPriorityFeeEstimatePost(body: UtilGetPriorityFeeEstimateBody, options?: AxiosRequestConfig) : Promise<AxiosResponse<PriorityFeeEstimate>> {
        return GeneralUtilityEndpointsApiFp(this.configuration).utilGetPriorityFeeEstimatePost(body, options).then((request) => request(this.axios, this.basePath));
    }
}
