/* tslint:disable */ /* eslint-disable */ /** * Satstream API * Satstream API * * OpenAPI spec version: 1.0 * Contact: team@satstream.io * * 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 { GetMempoolAncestorsRequest } from '../models'; import { GetMempoolAncestorsResponse } from '../models'; import { GetMempoolDescendantsRequest } from '../models'; import { GetMempoolDescendantsResponse } from '../models'; import { GetMempoolInfoResponse } from '../models'; import { GetRawMempoolRequest } from '../models'; import { GetRawMempoolResponse } from '../models'; import { TestMempoolAcceptRequest } from '../models'; import { TestMempoolAcceptResponse } from '../models'; import { UtilsResponseEnvelope } from '../models'; /** * MempoolApi - axios parameter creator * @export */ export const MempoolApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns all in-mempool ancestors for a transaction in the mempool * @summary Get mempool ancestors * @param {GetMempoolAncestorsRequest} body Mempool ancestors request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMempoolAncestors: async (body: GetMempoolAncestorsRequest, options: AxiosRequestConfig = {}): Promise => { // 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 getMempoolAncestors.'); } const localVarPath = `/mempool/ancestors`; // 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; // authentication ApiKeyAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-KEY") : await configuration.apiKey; localVarHeaderParameter["X-API-KEY"] = localVarApiKeyValue; } 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 all in-mempool descendants for a transaction in the mempool * @summary Get mempool descendants * @param {GetMempoolDescendantsRequest} body Mempool descendants request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMempoolDescendants: async (body: GetMempoolDescendantsRequest, options: AxiosRequestConfig = {}): Promise => { // 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 getMempoolDescendants.'); } const localVarPath = `/mempool/descendants`; // 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; // authentication ApiKeyAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-KEY") : await configuration.apiKey; localVarHeaderParameter["X-API-KEY"] = localVarApiKeyValue; } 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 details on the active state of the TX memory pool * @summary Get mempool information * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMempoolInfo: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/mempool/info`; // 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; // authentication ApiKeyAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-KEY") : await configuration.apiKey; localVarHeaderParameter["X-API-KEY"] = localVarApiKeyValue; } 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 transaction ids in memory pool * @summary Get raw mempool * @param {GetRawMempoolRequest} body Raw mempool request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ getRawMempool: async (body: GetRawMempoolRequest, options: AxiosRequestConfig = {}): Promise => { // 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 getRawMempool.'); } const localVarPath = `/mempool/raw`; // 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; // authentication ApiKeyAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-KEY") : await configuration.apiKey; localVarHeaderParameter["X-API-KEY"] = localVarApiKeyValue; } 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, }; }, /** * Tests whether raw transactions would be accepted by mempool * @summary Test mempool accept * @param {TestMempoolAcceptRequest} body Raw transactions to test * @param {*} [options] Override http request option. * @throws {RequiredError} */ testMempoolAccept: async (body: TestMempoolAcceptRequest, options: AxiosRequestConfig = {}): Promise => { // 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 testMempoolAccept.'); } const localVarPath = `/mempool/test-accept`; // 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; // authentication ApiKeyAuth required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("X-API-KEY") : await configuration.apiKey; localVarHeaderParameter["X-API-KEY"] = localVarApiKeyValue; } 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, }; }, } }; /** * MempoolApi - functional programming interface * @export */ export const MempoolApiFp = function(configuration?: Configuration) { return { /** * Returns all in-mempool ancestors for a transaction in the mempool * @summary Get mempool ancestors * @param {GetMempoolAncestorsRequest} body Mempool ancestors request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMempoolAncestors(body: GetMempoolAncestorsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await MempoolApiAxiosParamCreator(configuration).getMempoolAncestors(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns all in-mempool descendants for a transaction in the mempool * @summary Get mempool descendants * @param {GetMempoolDescendantsRequest} body Mempool descendants request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMempoolDescendants(body: GetMempoolDescendantsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await MempoolApiAxiosParamCreator(configuration).getMempoolDescendants(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns details on the active state of the TX memory pool * @summary Get mempool information * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMempoolInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await MempoolApiAxiosParamCreator(configuration).getMempoolInfo(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns all transaction ids in memory pool * @summary Get raw mempool * @param {GetRawMempoolRequest} body Raw mempool request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getRawMempool(body: GetRawMempoolRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await MempoolApiAxiosParamCreator(configuration).getRawMempool(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Tests whether raw transactions would be accepted by mempool * @summary Test mempool accept * @param {TestMempoolAcceptRequest} body Raw transactions to test * @param {*} [options] Override http request option. * @throws {RequiredError} */ async testMempoolAccept(body: TestMempoolAcceptRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await MempoolApiAxiosParamCreator(configuration).testMempoolAccept(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * MempoolApi - factory interface * @export */ export const MempoolApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * Returns all in-mempool ancestors for a transaction in the mempool * @summary Get mempool ancestors * @param {GetMempoolAncestorsRequest} body Mempool ancestors request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMempoolAncestors(body: GetMempoolAncestorsRequest, options?: AxiosRequestConfig): Promise> { return MempoolApiFp(configuration).getMempoolAncestors(body, options).then((request) => request(axios, basePath)); }, /** * Returns all in-mempool descendants for a transaction in the mempool * @summary Get mempool descendants * @param {GetMempoolDescendantsRequest} body Mempool descendants request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMempoolDescendants(body: GetMempoolDescendantsRequest, options?: AxiosRequestConfig): Promise> { return MempoolApiFp(configuration).getMempoolDescendants(body, options).then((request) => request(axios, basePath)); }, /** * Returns details on the active state of the TX memory pool * @summary Get mempool information * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMempoolInfo(options?: AxiosRequestConfig): Promise> { return MempoolApiFp(configuration).getMempoolInfo(options).then((request) => request(axios, basePath)); }, /** * Returns all transaction ids in memory pool * @summary Get raw mempool * @param {GetRawMempoolRequest} body Raw mempool request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getRawMempool(body: GetRawMempoolRequest, options?: AxiosRequestConfig): Promise> { return MempoolApiFp(configuration).getRawMempool(body, options).then((request) => request(axios, basePath)); }, /** * Tests whether raw transactions would be accepted by mempool * @summary Test mempool accept * @param {TestMempoolAcceptRequest} body Raw transactions to test * @param {*} [options] Override http request option. * @throws {RequiredError} */ async testMempoolAccept(body: TestMempoolAcceptRequest, options?: AxiosRequestConfig): Promise> { return MempoolApiFp(configuration).testMempoolAccept(body, options).then((request) => request(axios, basePath)); }, }; }; /** * MempoolApi - object-oriented interface * @export * @class MempoolApi * @extends {BaseAPI} */ export class MempoolApi extends BaseAPI { /** * Returns all in-mempool ancestors for a transaction in the mempool * @summary Get mempool ancestors * @param {GetMempoolAncestorsRequest} body Mempool ancestors request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MempoolApi */ public async getMempoolAncestors(body: GetMempoolAncestorsRequest, options?: AxiosRequestConfig) : Promise> { return MempoolApiFp(this.configuration).getMempoolAncestors(body, options).then((request) => request(this.axios, this.basePath)); } /** * Returns all in-mempool descendants for a transaction in the mempool * @summary Get mempool descendants * @param {GetMempoolDescendantsRequest} body Mempool descendants request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MempoolApi */ public async getMempoolDescendants(body: GetMempoolDescendantsRequest, options?: AxiosRequestConfig) : Promise> { return MempoolApiFp(this.configuration).getMempoolDescendants(body, options).then((request) => request(this.axios, this.basePath)); } /** * Returns details on the active state of the TX memory pool * @summary Get mempool information * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MempoolApi */ public async getMempoolInfo(options?: AxiosRequestConfig) : Promise> { return MempoolApiFp(this.configuration).getMempoolInfo(options).then((request) => request(this.axios, this.basePath)); } /** * Returns all transaction ids in memory pool * @summary Get raw mempool * @param {GetRawMempoolRequest} body Raw mempool request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MempoolApi */ public async getRawMempool(body: GetRawMempoolRequest, options?: AxiosRequestConfig) : Promise> { return MempoolApiFp(this.configuration).getRawMempool(body, options).then((request) => request(this.axios, this.basePath)); } /** * Tests whether raw transactions would be accepted by mempool * @summary Test mempool accept * @param {TestMempoolAcceptRequest} body Raw transactions to test * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MempoolApi */ public async testMempoolAccept(body: TestMempoolAcceptRequest, options?: AxiosRequestConfig) : Promise> { return MempoolApiFp(this.configuration).testMempoolAccept(body, options).then((request) => request(this.axios, this.basePath)); } }