/* 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 { GetBlockCountResponse } from '../models'; import { GetBlockDecodedResponse } from '../models'; import { GetBlockHashByHeightResponse } from '../models'; import { GetBlockHexResponse } from '../models'; import { GetBlockPrevoutResponse } from '../models'; import { GetBlockResponse } from '../models'; import { GetBlockStatsRequest } from '../models'; import { GetBlockStatsResponse } from '../models'; import { GetBlockSummaryResponse } from '../models'; import { GetBlockchainInfoResponse } from '../models'; import { GetBlocksResponse } from '../models'; import { GetLatestBlockHashResponse } from '../models'; import { GetLatestBlockHeightResponse } from '../models'; import { GetLatestBlockTimeResponse } from '../models'; import { UtilsResponseEnvelope } from '../models'; /** * BlocksApi - axios parameter creator * @export */ export const BlocksApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Returns the height of the latest block * @summary Get the height of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockCount: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/blockcount`; // 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, }; }, /** * Get block by hash or height as a decoded object * @summary Get block by hash or height (verbosity 2) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockDecoded: async (identifier: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'identifier' is not null or undefined if (identifier === null || identifier === undefined) { throw new RequiredError('identifier','Required parameter identifier was null or undefined when calling getBlockDecoded.'); } const localVarPath = `/block/raw/{identifier}/decoded` .replace(`{${"identifier"}}`, encodeURIComponent(String(identifier))); // 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 blockhash of specified block. * @summary Returns blockhash of specified block. * @param {string} blockHeight Block Height * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockHashByHeight: async (blockHeight: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'blockHeight' is not null or undefined if (blockHeight === null || blockHeight === undefined) { throw new RequiredError('blockHeight','Required parameter blockHeight was null or undefined when calling getBlockHashByHeight.'); } const localVarPath = `/blockhash/{block_height}` .replace(`{${"block_height"}}`, encodeURIComponent(String(blockHeight))); // 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, }; }, /** * Get block by hash or height as a raw hex string * @summary Get block by hash or height (verbosity 0) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockHex: async (identifier: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'identifier' is not null or undefined if (identifier === null || identifier === undefined) { throw new RequiredError('identifier','Required parameter identifier was null or undefined when calling getBlockHex.'); } const localVarPath = `/block/raw/{identifier}/hex` .replace(`{${"identifier"}}`, encodeURIComponent(String(identifier))); // 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, }; }, /** * Get detailed information about a specific block by hash or height * @summary Get block info by hash or height * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockInfo: async (identifier: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'identifier' is not null or undefined if (identifier === null || identifier === undefined) { throw new RequiredError('identifier','Required parameter identifier was null or undefined when calling getBlockInfo.'); } const localVarPath = `/block/{identifier}` .replace(`{${"identifier"}}`, encodeURIComponent(String(identifier))); // 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, }; }, /** * Get block by hash or height with prevout information * @summary Get block by hash or height (verbosity 3) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockPrevout: async (identifier: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'identifier' is not null or undefined if (identifier === null || identifier === undefined) { throw new RequiredError('identifier','Required parameter identifier was null or undefined when calling getBlockPrevout.'); } const localVarPath = `/block/raw/{identifier}/prevout` .replace(`{${"identifier"}}`, encodeURIComponent(String(identifier))); // 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, }; }, /** * Computes per block statistics for a given window * @summary Get block stats * @param {GetBlockStatsRequest} body Block stats request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockStats: async (body: GetBlockStatsRequest, 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 getBlockStats.'); } const localVarPath = `/block/stats`; // 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, }; }, /** * Get block by hash or height as a summary object * @summary Get block by hash or height (verbosity 1) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockSummary: async (identifier: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'identifier' is not null or undefined if (identifier === null || identifier === undefined) { throw new RequiredError('identifier','Required parameter identifier was null or undefined when calling getBlockSummary.'); } const localVarPath = `/block/raw/{identifier}/summary` .replace(`{${"identifier"}}`, encodeURIComponent(String(identifier))); // 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 an object containing various state info regarding blockchain processing * @summary Get blockchain information * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlockchainInfo: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/blockchain/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 the latest block height, last 100 block hashes, and featured inscriptions * @summary Returns the latest block height, last 100 block hashes, and featured inscriptions * @param {*} [options] Override http request option. * @throws {RequiredError} */ getBlocks: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/blocks`; // 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 the height of the latest block. * @summary Returns the height of the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLatestBlockHeight: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/blockheight`; // 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 blockhash for the latest block. * @summary Returns blockhash for the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLatestBlockhash: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/blockhash`; // 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 the UNIX timestamp of when the latest block was mined * @summary Get the timestamp of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLatestBlocktime: async (options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/blocktime`; // 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, }; }, } }; /** * BlocksApi - functional programming interface * @export */ export const BlocksApiFp = function(configuration?: Configuration) { return { /** * Returns the height of the latest block * @summary Get the height of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockCount(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockCount(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Get block by hash or height as a decoded object * @summary Get block by hash or height (verbosity 2) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockDecoded(identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockDecoded(identifier, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns blockhash of specified block. * @summary Returns blockhash of specified block. * @param {string} blockHeight Block Height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockHashByHeight(blockHeight: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockHashByHeight(blockHeight, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Get block by hash or height as a raw hex string * @summary Get block by hash or height (verbosity 0) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockHex(identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockHex(identifier, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Get detailed information about a specific block by hash or height * @summary Get block info by hash or height * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockInfo(identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockInfo(identifier, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Get block by hash or height with prevout information * @summary Get block by hash or height (verbosity 3) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockPrevout(identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockPrevout(identifier, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Computes per block statistics for a given window * @summary Get block stats * @param {GetBlockStatsRequest} body Block stats request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockStats(body: GetBlockStatsRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockStats(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Get block by hash or height as a summary object * @summary Get block by hash or height (verbosity 1) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockSummary(identifier: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockSummary(identifier, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns an object containing various state info regarding blockchain processing * @summary Get blockchain information * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockchainInfo(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlockchainInfo(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns the latest block height, last 100 block hashes, and featured inscriptions * @summary Returns the latest block height, last 100 block hashes, and featured inscriptions * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlocks(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getBlocks(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns the height of the latest block. * @summary Returns the height of the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestBlockHeight(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getLatestBlockHeight(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns blockhash for the latest block. * @summary Returns blockhash for the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestBlockhash(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getLatestBlockhash(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Returns the UNIX timestamp of when the latest block was mined * @summary Get the timestamp of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestBlocktime(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await BlocksApiAxiosParamCreator(configuration).getLatestBlocktime(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * BlocksApi - factory interface * @export */ export const BlocksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * Returns the height of the latest block * @summary Get the height of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockCount(options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockCount(options).then((request) => request(axios, basePath)); }, /** * Get block by hash or height as a decoded object * @summary Get block by hash or height (verbosity 2) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockDecoded(identifier: string, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockDecoded(identifier, options).then((request) => request(axios, basePath)); }, /** * Returns blockhash of specified block. * @summary Returns blockhash of specified block. * @param {string} blockHeight Block Height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockHashByHeight(blockHeight: string, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockHashByHeight(blockHeight, options).then((request) => request(axios, basePath)); }, /** * Get block by hash or height as a raw hex string * @summary Get block by hash or height (verbosity 0) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockHex(identifier: string, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockHex(identifier, options).then((request) => request(axios, basePath)); }, /** * Get detailed information about a specific block by hash or height * @summary Get block info by hash or height * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockInfo(identifier: string, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockInfo(identifier, options).then((request) => request(axios, basePath)); }, /** * Get block by hash or height with prevout information * @summary Get block by hash or height (verbosity 3) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockPrevout(identifier: string, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockPrevout(identifier, options).then((request) => request(axios, basePath)); }, /** * Computes per block statistics for a given window * @summary Get block stats * @param {GetBlockStatsRequest} body Block stats request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockStats(body: GetBlockStatsRequest, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockStats(body, options).then((request) => request(axios, basePath)); }, /** * Get block by hash or height as a summary object * @summary Get block by hash or height (verbosity 1) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockSummary(identifier: string, options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockSummary(identifier, options).then((request) => request(axios, basePath)); }, /** * Returns an object containing various state info regarding blockchain processing * @summary Get blockchain information * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlockchainInfo(options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlockchainInfo(options).then((request) => request(axios, basePath)); }, /** * Returns the latest block height, last 100 block hashes, and featured inscriptions * @summary Returns the latest block height, last 100 block hashes, and featured inscriptions * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getBlocks(options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getBlocks(options).then((request) => request(axios, basePath)); }, /** * Returns the height of the latest block. * @summary Returns the height of the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestBlockHeight(options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getLatestBlockHeight(options).then((request) => request(axios, basePath)); }, /** * Returns blockhash for the latest block. * @summary Returns blockhash for the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestBlockhash(options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getLatestBlockhash(options).then((request) => request(axios, basePath)); }, /** * Returns the UNIX timestamp of when the latest block was mined * @summary Get the timestamp of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLatestBlocktime(options?: AxiosRequestConfig): Promise> { return BlocksApiFp(configuration).getLatestBlocktime(options).then((request) => request(axios, basePath)); }, }; }; /** * BlocksApi - object-oriented interface * @export * @class BlocksApi * @extends {BaseAPI} */ export class BlocksApi extends BaseAPI { /** * Returns the height of the latest block * @summary Get the height of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockCount(options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockCount(options).then((request) => request(this.axios, this.basePath)); } /** * Get block by hash or height as a decoded object * @summary Get block by hash or height (verbosity 2) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockDecoded(identifier: string, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockDecoded(identifier, options).then((request) => request(this.axios, this.basePath)); } /** * Returns blockhash of specified block. * @summary Returns blockhash of specified block. * @param {string} blockHeight Block Height * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockHashByHeight(blockHeight: string, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockHashByHeight(blockHeight, options).then((request) => request(this.axios, this.basePath)); } /** * Get block by hash or height as a raw hex string * @summary Get block by hash or height (verbosity 0) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockHex(identifier: string, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockHex(identifier, options).then((request) => request(this.axios, this.basePath)); } /** * Get detailed information about a specific block by hash or height * @summary Get block info by hash or height * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockInfo(identifier: string, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockInfo(identifier, options).then((request) => request(this.axios, this.basePath)); } /** * Get block by hash or height with prevout information * @summary Get block by hash or height (verbosity 3) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockPrevout(identifier: string, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockPrevout(identifier, options).then((request) => request(this.axios, this.basePath)); } /** * Computes per block statistics for a given window * @summary Get block stats * @param {GetBlockStatsRequest} body Block stats request parameters * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockStats(body: GetBlockStatsRequest, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockStats(body, options).then((request) => request(this.axios, this.basePath)); } /** * Get block by hash or height as a summary object * @summary Get block by hash or height (verbosity 1) * @param {string} identifier Block hash or height * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockSummary(identifier: string, options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockSummary(identifier, options).then((request) => request(this.axios, this.basePath)); } /** * Returns an object containing various state info regarding blockchain processing * @summary Get blockchain information * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlockchainInfo(options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlockchainInfo(options).then((request) => request(this.axios, this.basePath)); } /** * Returns the latest block height, last 100 block hashes, and featured inscriptions * @summary Returns the latest block height, last 100 block hashes, and featured inscriptions * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getBlocks(options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getBlocks(options).then((request) => request(this.axios, this.basePath)); } /** * Returns the height of the latest block. * @summary Returns the height of the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getLatestBlockHeight(options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getLatestBlockHeight(options).then((request) => request(this.axios, this.basePath)); } /** * Returns blockhash for the latest block. * @summary Returns blockhash for the latest block. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getLatestBlockhash(options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getLatestBlockhash(options).then((request) => request(this.axios, this.basePath)); } /** * Returns the UNIX timestamp of when the latest block was mined * @summary Get the timestamp of the latest block * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BlocksApi */ public async getLatestBlocktime(options?: AxiosRequestConfig) : Promise> { return BlocksApiFp(this.configuration).getLatestBlocktime(options).then((request) => request(this.axios, this.basePath)); } }