/// <reference path="./custom.d.ts" />
// tslint:disable
/**
 * Ordinals API
 * A service that indexes Bitcoin Ordinals data and exposes it via REST API endpoints.
 *
 * OpenAPI spec version: v0.0.1
 * 
 *
 * NOTE: This file is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the file manually.
 */

import * as url from "url";
import * as isomorphicFetch from "isomorphic-fetch";
import { Configuration } from "./configuration";

const BASE_PATH = "https://api.hiro.so/".replace(/\/+$/, "");

/**
 *
 * @export
 */
export const COLLECTION_FORMATS = {
    csv: ",",
    ssv: " ",
    tsv: "\t",
    pipes: "|",
};

/**
 *
 * @export
 * @interface FetchAPI
 */
export interface FetchAPI {
    (url: string, init?: any): Promise<Response>;
}

/**
 *
 * @export
 * @interface FetchArgs
 */
export interface FetchArgs {
    url: string;
    options: any;
}

/**
 *
 * @export
 * @class BaseAPI
 */
export class BaseAPI {
    protected configuration: Configuration;

    constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected fetch: FetchAPI = isomorphicFetch) {
        if (configuration) {
            this.configuration = configuration;
            this.basePath = configuration.basePath || this.basePath;
        }
    }
};

/**
 *
 * @export
 * @class RequiredError
 * @extends {Error}
 */
export class RequiredError extends Error {
    name: "RequiredError"
    constructor(public field: string, msg?: string) {
        super(msg);
    }
}

/**
 * 
 * @export
 * @interface ApiStatusResponse
 */
export interface ApiStatusResponse {
    /**
     * 
     * @type {string}
     * @memberof ApiStatusResponse
     */
    server_version: string;
    /**
     * 
     * @type {string}
     * @memberof ApiStatusResponse
     */
    status: string;
    /**
     * 
     * @type {number}
     * @memberof ApiStatusResponse
     */
    block_height?: number;
    /**
     * 
     * @type {number}
     * @memberof ApiStatusResponse
     */
    max_inscription_number?: number;
}
/**
 * 
 * @export
 * @interface InscriptionLocationResponse
 */
export interface InscriptionLocationResponse {
    /**
     * 
     * @type {number}
     * @memberof InscriptionLocationResponse
     */
    block_height: number;
    /**
     * 
     * @type {string}
     * @memberof InscriptionLocationResponse
     */
    block_hash: string;
    /**
     * 
     * @type {string | null}
     * @memberof InscriptionLocationResponse
     */
    address: string | null;
    /**
     * 
     * @type {string}
     * @memberof InscriptionLocationResponse
     */
    tx_id: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionLocationResponse
     */
    location: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionLocationResponse
     */
    output: string;
    /**
     * 
     * @type {string | null}
     * @memberof InscriptionLocationResponse
     */
    value: string | null;
    /**
     * 
     * @type {string | null}
     * @memberof InscriptionLocationResponse
     */
    offset: string | null;
    /**
     * 
     * @type {number}
     * @memberof InscriptionLocationResponse
     */
    timestamp: number;
}
/**
 * 
 * @export
 * @interface InscriptionResponse
 */
export interface InscriptionResponse {
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    id: string;
    /**
     * 
     * @type {number}
     * @memberof InscriptionResponse
     */
    number: number;
    /**
     * 
     * @type {string | null}
     * @memberof InscriptionResponse
     */
    address: string | null;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    genesis_address: string;
    /**
     * 
     * @type {number}
     * @memberof InscriptionResponse
     */
    genesis_block_height: number;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    genesis_block_hash: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    genesis_tx_id: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    genesis_fee: string;
    /**
     * 
     * @type {number}
     * @memberof InscriptionResponse
     */
    genesis_timestamp: number;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    tx_id: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    location: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    output: string;
    /**
     * 
     * @type {string | null}
     * @memberof InscriptionResponse
     */
    value: string | null;
    /**
     * 
     * @type {string | null}
     * @memberof InscriptionResponse
     */
    offset: string | null;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    sat_ordinal: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    sat_rarity: string;
    /**
     * 
     * @type {number}
     * @memberof InscriptionResponse
     */
    sat_coinbase_height: number;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    mime_type: string;
    /**
     * 
     * @type {string}
     * @memberof InscriptionResponse
     */
    content_type: string;
    /**
     * 
     * @type {number}
     * @memberof InscriptionResponse
     */
    content_length: number;
    /**
     * 
     * @type {number}
     * @memberof InscriptionResponse
     */
    timestamp: number;
}
/**
 * 
 * @export
 * @interface NotFoundResponse
 */
export interface NotFoundResponse {
    /**
     * 
     * @type {string}
     * @memberof NotFoundResponse
     */
    error: NotFoundResponse.ErrorEnum;
}

/**
 * @export
 * @namespace NotFoundResponse
 */
export namespace NotFoundResponse {
    /**
     * @export
     * @enum {string}
     */
    export enum ErrorEnum {
        NotFound = <any> 'Not found'
    }
}
/**
 * 
 * @export
 * @interface Order
 */
export interface Order {
}
/**
 * 
 * @export
 * @interface OrderBy
 */
export interface OrderBy {
}
/**
 * 
 * @export
 * @interface PaginatedInscriptionLocationsResponse
 */
export interface PaginatedInscriptionLocationsResponse {
    /**
     * 
     * @type {number}
     * @memberof PaginatedInscriptionLocationsResponse
     */
    limit: number;
    /**
     * 
     * @type {number}
     * @memberof PaginatedInscriptionLocationsResponse
     */
    offset: number;
    /**
     * 
     * @type {number}
     * @memberof PaginatedInscriptionLocationsResponse
     */
    total: number;
    /**
     * 
     * @type {Array<InscriptionLocationResponse>}
     * @memberof PaginatedInscriptionLocationsResponse
     */
    results: Array<InscriptionLocationResponse>;
}
/**
 * 
 * @export
 * @interface PaginatedInscriptionsResponse
 */
export interface PaginatedInscriptionsResponse {
    /**
     * 
     * @type {number}
     * @memberof PaginatedInscriptionsResponse
     */
    limit: number;
    /**
     * 
     * @type {number}
     * @memberof PaginatedInscriptionsResponse
     */
    offset: number;
    /**
     * 
     * @type {number}
     * @memberof PaginatedInscriptionsResponse
     */
    total: number;
    /**
     * 
     * @type {Array<InscriptionResponse>}
     * @memberof PaginatedInscriptionsResponse
     */
    results: Array<InscriptionResponse>;
}
/**
 * 
 * @export
 * @interface SatoshiResponse
 */
export interface SatoshiResponse {
    /**
     * 
     * @type {number}
     * @memberof SatoshiResponse
     */
    coinbase_height: number;
    /**
     * 
     * @type {number}
     * @memberof SatoshiResponse
     */
    cycle: number;
    /**
     * 
     * @type {string}
     * @memberof SatoshiResponse
     */
    decimal: string;
    /**
     * 
     * @type {string}
     * @memberof SatoshiResponse
     */
    degree: string;
    /**
     * 
     * @type {string}
     * @memberof SatoshiResponse
     */
    inscription_id?: string;
    /**
     * 
     * @type {number}
     * @memberof SatoshiResponse
     */
    epoch: number;
    /**
     * 
     * @type {string}
     * @memberof SatoshiResponse
     */
    name: string;
    /**
     * 
     * @type {number}
     * @memberof SatoshiResponse
     */
    offset: number;
    /**
     * 
     * @type {string}
     * @memberof SatoshiResponse
     */
    percentile: string;
    /**
     * 
     * @type {number}
     * @memberof SatoshiResponse
     */
    period: number;
    /**
     * 
     * @type {string}
     * @memberof SatoshiResponse
     */
    rarity: string;
}
/**
 * InscriptionsApi - fetch parameter creator
 * @export
 */
export const InscriptionsApiFetchParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Retrieves a single inscription
         * @summary Inscription
         * @param {string} id Inscription unique identifier (number or ID)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscription(id: string, options: any = {}): FetchArgs {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id','Required parameter id was null or undefined when calling getInscription.');
            }
            const localVarPath = `/ordinals/v1/inscriptions/{id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            const localVarUrlObj = url.parse(localVarPath, true);
            const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

            return {
                url: url.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieves the contents of a single inscription
         * @summary Inscription content
         * @param {string1} id Inscription unique identifier (number or ID)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptionContent(id: string, options: any = {}): FetchArgs {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id','Required parameter id was null or undefined when calling getInscriptionContent.');
            }
            const localVarPath = `/ordinals/v1/inscriptions/{id}/content`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            const localVarUrlObj = url.parse(localVarPath, true);
            const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

            return {
                url: url.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieves all transfers for a single inscription
         * @summary Inscription transfers
         * @param {string2} id Inscription unique identifier (number or ID)
         * @param {number} [offset] Result offset
         * @param {number} [limit] Results per page
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptionTransfers(id: string, offset?: number, limit?: number, options: any = {}): FetchArgs {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id','Required parameter id was null or undefined when calling getInscriptionTransfers.');
            }
            const localVarPath = `/ordinals/v1/inscriptions/{id}/transfers`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            const localVarUrlObj = url.parse(localVarPath, true);
            const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

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

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

            localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

            return {
                url: url.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieves a list of inscriptions with options to filter and sort results
         * @summary Inscriptions
         * @param {string} [genesis_block] Bitcoin block identifier (height or hash)
         * @param {string} [from_genesis_block_height] Bitcoin block height
         * @param {string} [to_genesis_block_height] Bitcoin block height
         * @param {number} [from_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
         * @param {number} [to_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
         * @param {number} [from_sat_ordinal] Ordinal number that uniquely identifies a satoshi
         * @param {number} [to_sat_ordinal] Ordinal number that uniquely identifies a satoshi
         * @param {string} [from_sat_coinbase_height] Bitcoin block height
         * @param {string} [to_sat_coinbase_height] Bitcoin block height
         * @param {number} [from_number] Inscription number
         * @param {number} [to_number] Inscription number
         * @param {Array<string>} [id] Array of inscription IDs
         * @param {Array<number>} [number] Array of inscription numbers
         * @param {string} [output] An UTXO for a Bitcoin transaction
         * @param {Array<string>} [address] Array of Bitcoin addresses
         * @param {Array<string>} [mime_type] Array of inscription MIME types
         * @param {Array<string>} [rarity] Array of satoshi rarity values
         * @param {number} [offset] Result offset
         * @param {number} [limit] Results per page
         * @param {OrderBy} [order_by] Parameter to order results by
         * @param {Order} [order] Results order
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptions(genesis_block?: string, from_genesis_block_height?: string, to_genesis_block_height?: string, from_genesis_timestamp?: number, to_genesis_timestamp?: number, from_sat_ordinal?: number, to_sat_ordinal?: number, from_sat_coinbase_height?: string, to_sat_coinbase_height?: string, from_number?: number, to_number?: number, id?: Array<string>, number?: Array<number>, output?: string, address?: Array<string>, mime_type?: Array<string>, rarity?: Array<string>, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options: any = {}): FetchArgs {
            const localVarPath = `/ordinals/v1/inscriptions`;
            const localVarUrlObj = url.parse(localVarPath, true);
            const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

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

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

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

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

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

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

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

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

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

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

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

            if (id) {
                localVarQueryParameter['id'] = id;
            }

            if (number) {
                localVarQueryParameter['number'] = number;
            }

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

            if (address) {
                localVarQueryParameter['address'] = address;
            }

            if (mime_type) {
                localVarQueryParameter['mime_type'] = mime_type;
            }

            if (rarity) {
                localVarQueryParameter['rarity'] = rarity;
            }

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

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

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

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

            localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

            return {
                url: url.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * InscriptionsApi - functional programming interface
 * @export
 */
export const InscriptionsApiFp = function(configuration?: Configuration) {
    return {
        /**
         * Retrieves a single inscription
         * @summary Inscription
         * @param {string} id Inscription unique identifier (number or ID)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscription(id: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<InscriptionResponse> {
            const localVarFetchArgs = InscriptionsApiFetchParamCreator(configuration).getInscription(id, options);
            return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
                return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                    if (response.status >= 200 && response.status < 300) {
                        return response.json();
                    } else {
                        throw response;
                    }
                });
            };
        },
        /**
         * Retrieves the contents of a single inscription
         * @summary Inscription content
         * @param {string1} id Inscription unique identifier (number or ID)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptionContent(id: string, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<any> {
            const localVarFetchArgs = InscriptionsApiFetchParamCreator(configuration).getInscriptionContent(id, options);
            return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
                return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                    if (response.status >= 200 && response.status < 300) {
                        return response.blob();
                    } else {
                        throw response;
                    }
                });
            };
        },
        /**
         * Retrieves all transfers for a single inscription
         * @summary Inscription transfers
         * @param {string2} id Inscription unique identifier (number or ID)
         * @param {number} [offset] Result offset
         * @param {number} [limit] Results per page
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptionTransfers(id: string, offset?: number, limit?: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<PaginatedInscriptionLocationsResponse> {
            const localVarFetchArgs = InscriptionsApiFetchParamCreator(configuration).getInscriptionTransfers(id, offset, limit, options);
            return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
                return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                    if (response.status >= 200 && response.status < 300) {
                        return response.json();
                    } else {
                        throw response;
                    }
                });
            };
        },
        /**
         * Retrieves a list of inscriptions with options to filter and sort results
         * @summary Inscriptions
         * @param {string} [genesis_block] Bitcoin block identifier (height or hash)
         * @param {string} [from_genesis_block_height] Bitcoin block height
         * @param {string} [to_genesis_block_height] Bitcoin block height
         * @param {number} [from_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
         * @param {number} [to_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
         * @param {number} [from_sat_ordinal] Ordinal number that uniquely identifies a satoshi
         * @param {number} [to_sat_ordinal] Ordinal number that uniquely identifies a satoshi
         * @param {string} [from_sat_coinbase_height] Bitcoin block height
         * @param {string} [to_sat_coinbase_height] Bitcoin block height
         * @param {number} [from_number] Inscription number
         * @param {number} [to_number] Inscription number
         * @param {Array<string>} [id] Array of inscription IDs
         * @param {Array<number>} [number] Array of inscription numbers
         * @param {string} [output] An UTXO for a Bitcoin transaction
         * @param {Array<string>} [address] Array of Bitcoin addresses
         * @param {Array<string>} [mime_type] Array of inscription MIME types
         * @param {Array<string>} [rarity] Array of satoshi rarity values
         * @param {number} [offset] Result offset
         * @param {number} [limit] Results per page
         * @param {OrderBy} [order_by] Parameter to order results by
         * @param {Order} [order] Results order
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptions(genesis_block?: string, from_genesis_block_height?: string, to_genesis_block_height?: string, from_genesis_timestamp?: number, to_genesis_timestamp?: number, from_sat_ordinal?: number, to_sat_ordinal?: number, from_sat_coinbase_height?: string, to_sat_coinbase_height?: string, from_number?: number, to_number?: number, id?: Array<string>, number?: Array<number>, output?: string, address?: Array<string>, mime_type?: Array<string>, rarity?: Array<string>, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<PaginatedInscriptionsResponse> {
            const localVarFetchArgs = InscriptionsApiFetchParamCreator(configuration).getInscriptions(genesis_block, from_genesis_block_height, to_genesis_block_height, from_genesis_timestamp, to_genesis_timestamp, from_sat_ordinal, to_sat_ordinal, from_sat_coinbase_height, to_sat_coinbase_height, from_number, to_number, id, number, output, address, mime_type, rarity, offset, limit, order_by, order, options);
            return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
                return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                    if (response.status >= 200 && response.status < 300) {
                        return response.json();
                    } else {
                        throw response;
                    }
                });
            };
        },
    }
};

/**
 * InscriptionsApi - factory interface
 * @export
 */
export const InscriptionsApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
    return {
        /**
         * Retrieves a single inscription
         * @summary Inscription
         * @param {string} id Inscription unique identifier (number or ID)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscription(id: string, options?: any) {
            return InscriptionsApiFp(configuration).getInscription(id, options)(fetch, basePath);
        },
        /**
         * Retrieves the contents of a single inscription
         * @summary Inscription content
         * @param {string1} id Inscription unique identifier (number or ID)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptionContent(id: string, options?: any) {
            return InscriptionsApiFp(configuration).getInscriptionContent(id, options)(fetch, basePath);
        },
        /**
         * Retrieves all transfers for a single inscription
         * @summary Inscription transfers
         * @param {string2} id Inscription unique identifier (number or ID)
         * @param {number} [offset] Result offset
         * @param {number} [limit] Results per page
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptionTransfers(id: string, offset?: number, limit?: number, options?: any) {
            return InscriptionsApiFp(configuration).getInscriptionTransfers(id, offset, limit, options)(fetch, basePath);
        },
        /**
         * Retrieves a list of inscriptions with options to filter and sort results
         * @summary Inscriptions
         * @param {string} [genesis_block] Bitcoin block identifier (height or hash)
         * @param {string} [from_genesis_block_height] Bitcoin block height
         * @param {string} [to_genesis_block_height] Bitcoin block height
         * @param {number} [from_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
         * @param {number} [to_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
         * @param {number} [from_sat_ordinal] Ordinal number that uniquely identifies a satoshi
         * @param {number} [to_sat_ordinal] Ordinal number that uniquely identifies a satoshi
         * @param {string} [from_sat_coinbase_height] Bitcoin block height
         * @param {string} [to_sat_coinbase_height] Bitcoin block height
         * @param {number} [from_number] Inscription number
         * @param {number} [to_number] Inscription number
         * @param {Array<string>} [id] Array of inscription IDs
         * @param {Array<number>} [number] Array of inscription numbers
         * @param {string} [output] An UTXO for a Bitcoin transaction
         * @param {Array<string>} [address] Array of Bitcoin addresses
         * @param {Array<string>} [mime_type] Array of inscription MIME types
         * @param {Array<string>} [rarity] Array of satoshi rarity values
         * @param {number} [offset] Result offset
         * @param {number} [limit] Results per page
         * @param {OrderBy} [order_by] Parameter to order results by
         * @param {Order} [order] Results order
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getInscriptions(genesis_block?: string, from_genesis_block_height?: string, to_genesis_block_height?: string, from_genesis_timestamp?: number, to_genesis_timestamp?: number, from_sat_ordinal?: number, to_sat_ordinal?: number, from_sat_coinbase_height?: string, to_sat_coinbase_height?: string, from_number?: number, to_number?: number, id?: Array<string>, number?: Array<number>, output?: string, address?: Array<string>, mime_type?: Array<string>, rarity?: Array<string>, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any) {
            return InscriptionsApiFp(configuration).getInscriptions(genesis_block, from_genesis_block_height, to_genesis_block_height, from_genesis_timestamp, to_genesis_timestamp, from_sat_ordinal, to_sat_ordinal, from_sat_coinbase_height, to_sat_coinbase_height, from_number, to_number, id, number, output, address, mime_type, rarity, offset, limit, order_by, order, options)(fetch, basePath);
        },
    };
};

/**
 * InscriptionsApi - object-oriented interface
 * @export
 * @class InscriptionsApi
 * @extends {BaseAPI}
 */
export class InscriptionsApi extends BaseAPI {
    /**
     * Retrieves a single inscription
     * @summary Inscription
     * @param {string} id Inscription unique identifier (number or ID)
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof InscriptionsApi
     */
    public getInscription(id: string, options?: any) {
        return InscriptionsApiFp(this.configuration).getInscription(id, options)(this.fetch, this.basePath);
    }

    /**
     * Retrieves the contents of a single inscription
     * @summary Inscription content
     * @param {string1} id Inscription unique identifier (number or ID)
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof InscriptionsApi
     */
    public getInscriptionContent(id: string, options?: any) {
        return InscriptionsApiFp(this.configuration).getInscriptionContent(id, options)(this.fetch, this.basePath);
    }

    /**
     * Retrieves all transfers for a single inscription
     * @summary Inscription transfers
     * @param {string2} id Inscription unique identifier (number or ID)
     * @param {number} [offset] Result offset
     * @param {number} [limit] Results per page
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof InscriptionsApi
     */
    public getInscriptionTransfers(id: string, offset?: number, limit?: number, options?: any) {
        return InscriptionsApiFp(this.configuration).getInscriptionTransfers(id, offset, limit, options)(this.fetch, this.basePath);
    }

    /**
     * Retrieves a list of inscriptions with options to filter and sort results
     * @summary Inscriptions
     * @param {string} [genesis_block] Bitcoin block identifier (height or hash)
     * @param {string} [from_genesis_block_height] Bitcoin block height
     * @param {string} [to_genesis_block_height] Bitcoin block height
     * @param {number} [from_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
     * @param {number} [to_genesis_timestamp] Block UNIX epoch timestamp (milliseconds)
     * @param {number} [from_sat_ordinal] Ordinal number that uniquely identifies a satoshi
     * @param {number} [to_sat_ordinal] Ordinal number that uniquely identifies a satoshi
     * @param {string} [from_sat_coinbase_height] Bitcoin block height
     * @param {string} [to_sat_coinbase_height] Bitcoin block height
     * @param {number} [from_number] Inscription number
     * @param {number} [to_number] Inscription number
     * @param {Array<string>} [id] Array of inscription IDs
     * @param {Array<number>} [number] Array of inscription numbers
     * @param {string} [output] An UTXO for a Bitcoin transaction
     * @param {Array<string>} [address] Array of Bitcoin addresses
     * @param {Array<string>} [mime_type] Array of inscription MIME types
     * @param {Array<string>} [rarity] Array of satoshi rarity values
     * @param {number} [offset] Result offset
     * @param {number} [limit] Results per page
     * @param {OrderBy} [order_by] Parameter to order results by
     * @param {Order} [order] Results order
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof InscriptionsApi
     */
    public getInscriptions(genesis_block?: string, from_genesis_block_height?: string, to_genesis_block_height?: string, from_genesis_timestamp?: number, to_genesis_timestamp?: number, from_sat_ordinal?: number, to_sat_ordinal?: number, from_sat_coinbase_height?: string, to_sat_coinbase_height?: string, from_number?: number, to_number?: number, id?: Array<string>, number?: Array<number>, output?: string, address?: Array<string>, mime_type?: Array<string>, rarity?: Array<string>, offset?: number, limit?: number, order_by?: OrderBy, order?: Order, options?: any) {
        return InscriptionsApiFp(this.configuration).getInscriptions(genesis_block, from_genesis_block_height, to_genesis_block_height, from_genesis_timestamp, to_genesis_timestamp, from_sat_ordinal, to_sat_ordinal, from_sat_coinbase_height, to_sat_coinbase_height, from_number, to_number, id, number, output, address, mime_type, rarity, offset, limit, order_by, order, options)(this.fetch, this.basePath);
    }

}
/**
 * SatoshisApi - fetch parameter creator
 * @export
 */
export const SatoshisApiFetchParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Retrieves ordinal information for a single satoshi
         * @summary Satoshi Ordinal
         * @param {number} ordinal Ordinal number that uniquely identifies a satoshi
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSatoshi(ordinal: number, options: any = {}): FetchArgs {
            // verify required parameter 'ordinal' is not null or undefined
            if (ordinal === null || ordinal === undefined) {
                throw new RequiredError('ordinal','Required parameter ordinal was null or undefined when calling getSatoshi.');
            }
            const localVarPath = `/ordinals/v1/sats/{ordinal}`
                .replace(`{${"ordinal"}}`, encodeURIComponent(String(ordinal)));
            const localVarUrlObj = url.parse(localVarPath, true);
            const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

            return {
                url: url.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * SatoshisApi - functional programming interface
 * @export
 */
export const SatoshisApiFp = function(configuration?: Configuration) {
    return {
        /**
         * Retrieves ordinal information for a single satoshi
         * @summary Satoshi Ordinal
         * @param {number} ordinal Ordinal number that uniquely identifies a satoshi
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSatoshi(ordinal: number, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<SatoshiResponse> {
            const localVarFetchArgs = SatoshisApiFetchParamCreator(configuration).getSatoshi(ordinal, options);
            return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
                return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                    if (response.status >= 200 && response.status < 300) {
                        return response.json();
                    } else {
                        throw response;
                    }
                });
            };
        },
    }
};

/**
 * SatoshisApi - factory interface
 * @export
 */
export const SatoshisApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
    return {
        /**
         * Retrieves ordinal information for a single satoshi
         * @summary Satoshi Ordinal
         * @param {number} ordinal Ordinal number that uniquely identifies a satoshi
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSatoshi(ordinal: number, options?: any) {
            return SatoshisApiFp(configuration).getSatoshi(ordinal, options)(fetch, basePath);
        },
    };
};

/**
 * SatoshisApi - object-oriented interface
 * @export
 * @class SatoshisApi
 * @extends {BaseAPI}
 */
export class SatoshisApi extends BaseAPI {
    /**
     * Retrieves ordinal information for a single satoshi
     * @summary Satoshi Ordinal
     * @param {number} ordinal Ordinal number that uniquely identifies a satoshi
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SatoshisApi
     */
    public getSatoshi(ordinal: number, options?: any) {
        return SatoshisApiFp(this.configuration).getSatoshi(ordinal, options)(this.fetch, this.basePath);
    }

}
/**
 * StatusApi - fetch parameter creator
 * @export
 */
export const StatusApiFetchParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Displays the status of the API
         * @summary API Status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getApiStatus(options: any = {}): FetchArgs {
            const localVarPath = `/ordinals/v1/`;
            const localVarUrlObj = url.parse(localVarPath, true);
            const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);

            return {
                url: url.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * StatusApi - functional programming interface
 * @export
 */
export const StatusApiFp = function(configuration?: Configuration) {
    return {
        /**
         * Displays the status of the API
         * @summary API Status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getApiStatus(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise<ApiStatusResponse> {
            const localVarFetchArgs = StatusApiFetchParamCreator(configuration).getApiStatus(options);
            return (fetch: FetchAPI = isomorphicFetch, basePath: string = BASE_PATH) => {
                return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
                    if (response.status >= 200 && response.status < 300) {
                        return response.json();
                    } else {
                        throw response;
                    }
                });
            };
        },
    }
};

/**
 * StatusApi - factory interface
 * @export
 */
export const StatusApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
    return {
        /**
         * Displays the status of the API
         * @summary API Status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getApiStatus(options?: any) {
            return StatusApiFp(configuration).getApiStatus(options)(fetch, basePath);
        },
    };
};

/**
 * StatusApi - object-oriented interface
 * @export
 * @class StatusApi
 * @extends {BaseAPI}
 */
export class StatusApi extends BaseAPI {
    /**
     * Displays the status of the API
     * @summary API Status
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StatusApi
     */
    public getApiStatus(options?: any) {
        return StatusApiFp(this.configuration).getApiStatus(options)(this.fetch, this.basePath);
    }

}
