/* tslint:disable */
/* eslint-disable */
/**
 * Stacks 2.0 Blockchain API
 * This is the documentation for the Stacks 2.0 Blockchain API.  It is comprised of two parts; the Stacks Blockchain API and the Stacks Core API.  [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/614feab5c108d292bffa#?env%5BStacks%20Blockchain%20API%5D=W3sia2V5Ijoic3R4X2FkZHJlc3MiLCJ2YWx1ZSI6IlNUMlRKUkhESE1ZQlE0MTdIRkIwQkRYNDMwVFFBNVBYUlg2NDk1RzFWIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJibG9ja19pZCIsInZhbHVlIjoiMHgiLCJlbmFibGVkIjp0cnVlfSx7ImtleSI6Im9mZnNldCIsInZhbHVlIjoiMCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoibGltaXRfdHgiLCJ2YWx1ZSI6IjIwMCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoibGltaXRfYmxvY2siLCJ2YWx1ZSI6IjMwIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJ0eF9pZCIsInZhbHVlIjoiMHg1NDA5MGMxNmE3MDJiNzUzYjQzMTE0ZTg4NGJjMTlhODBhNzk2MzhmZDQ0OWE0MGY4MDY4Y2RmMDAzY2RlNmUwIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9pZCIsInZhbHVlIjoiU1RKVFhFSlBKUFBWRE5BOUIwNTJOU1JSQkdRQ0ZOS1ZTMTc4VkdIMS5oZWxsb193b3JsZFxuIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJidGNfYWRkcmVzcyIsInZhbHVlIjoiYWJjIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9hZGRyZXNzIiwidmFsdWUiOiJTVEpUWEVKUEpQUFZETkE5QjA1Mk5TUlJCR1FDRk5LVlMxNzhWR0gxIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJjb250cmFjdF9uYW1lIiwidmFsdWUiOiJoZWxsb193b3JsZCIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoiY29udHJhY3RfbWFwIiwidmFsdWUiOiJzdG9yZSIsImVuYWJsZWQiOnRydWV9LHsia2V5IjoiY29udHJhY3RfbWV0aG9kIiwidmFsdWUiOiJnZXQtdmFsdWUiLCJlbmFibGVkIjp0cnVlfV0=) 
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
/**
 * GET request that core node information
 * @export
 * @interface CoreNodeInfoResponse
 */
export interface CoreNodeInfoResponse {
    /**
     * identifies the version number for the networking communication, this should not change while a node is running, and will only change if there's an upgrade
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    peer_version: number;
    /**
     * is a hash used to identify the burnchain view for a node. it incorporates bitcoin chain information and PoX information. nodes that disagree on this value will appear to each other as forks. this value will change after every block
     * @type {string}
     * @memberof CoreNodeInfoResponse
     */
    pox_consensus: string;
    /**
     * latest bitcoin chain height
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    burn_block_height: number;
    /**
     * same as burn_consensus, but evaluated at stable_burn_block_height
     * @type {string}
     * @memberof CoreNodeInfoResponse
     */
    stable_pox_consensus: string;
    /**
     * leftover from stacks 1.0, basically always burn_block_height - 1
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    stable_burn_block_height: number;
    /**
     * is a version descriptor
     * @type {string}
     * @memberof CoreNodeInfoResponse
     */
    server_version: string;
    /**
     * is similar to peer_version and will be used to differentiate between different testnets. this value will be different between mainnet and testnet. once launched, this value will not change
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    network_id: number;
    /**
     * same as network_id, but for bitcoin
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    parent_network_id: number;
    /**
     * the latest Stacks chain height. Stacks forks can occur independent of the Bitcoin chain, that height doesn't increase 1-to-1 with the Bitcoin height
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    stacks_tip_height: number;
    /**
     * the best known block hash for the Stack chain (not including any pending microblocks)
     * @type {string}
     * @memberof CoreNodeInfoResponse
     */
    stacks_tip: string;
    /**
     * the burn chain (i.e., bitcoin) consensus hash at the time that stacks_tip was mined
     * @type {string}
     * @memberof CoreNodeInfoResponse
     */
    stacks_tip_consensus_hash: string;
    /**
     * the latest microblock hash if any microblocks were processed. if no microblock has been processed for the current block, a 000.., hex array is returned
     * @type {string}
     * @memberof CoreNodeInfoResponse
     */
    unanchored_tip: string;
    /**
     * the block height at which the testnet network will be reset. not applicable for mainnet
     * @type {number}
     * @memberof CoreNodeInfoResponse
     */
    exit_at_block_height: number;
}

export function CoreNodeInfoResponseFromJSON(json: any): CoreNodeInfoResponse {
    return CoreNodeInfoResponseFromJSONTyped(json, false);
}

export function CoreNodeInfoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CoreNodeInfoResponse {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'peer_version': json['peer_version'],
        'pox_consensus': json['pox_consensus'],
        'burn_block_height': json['burn_block_height'],
        'stable_pox_consensus': json['stable_pox_consensus'],
        'stable_burn_block_height': json['stable_burn_block_height'],
        'server_version': json['server_version'],
        'network_id': json['network_id'],
        'parent_network_id': json['parent_network_id'],
        'stacks_tip_height': json['stacks_tip_height'],
        'stacks_tip': json['stacks_tip'],
        'stacks_tip_consensus_hash': json['stacks_tip_consensus_hash'],
        'unanchored_tip': json['unanchored_tip'],
        'exit_at_block_height': json['exit_at_block_height'],
    };
}

export function CoreNodeInfoResponseToJSON(value?: CoreNodeInfoResponse | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'peer_version': value.peer_version,
        'pox_consensus': value.pox_consensus,
        'burn_block_height': value.burn_block_height,
        'stable_pox_consensus': value.stable_pox_consensus,
        'stable_burn_block_height': value.stable_burn_block_height,
        'server_version': value.server_version,
        'network_id': value.network_id,
        'parent_network_id': value.parent_network_id,
        'stacks_tip_height': value.stacks_tip_height,
        'stacks_tip': value.stacks_tip,
        'stacks_tip_consensus_hash': value.stacks_tip_consensus_hash,
        'unanchored_tip': value.unanchored_tip,
        'exit_at_block_height': value.exit_at_block_height,
    };
}


