/* 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';
/**
 * A block
 * @export
 * @interface Block
 */
export interface Block {
    /**
     * Set to `true` if block corresponds to the canonical chain tip
     * @type {boolean}
     * @memberof Block
     */
    canonical: boolean;
    /**
     * Height of the block
     * @type {number}
     * @memberof Block
     */
    height: number;
    /**
     * Hash representing the block
     * @type {string}
     * @memberof Block
     */
    hash: string;
    /**
     * Hash of the parent block
     * @type {string}
     * @memberof Block
     */
    parent_block_hash: string;
    /**
     * Unix timestamp (in seconds) indicating when this block was mined.
     * @type {number}
     * @memberof Block
     */
    burn_block_time: number;
    /**
     * An ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) indicating when this block was mined.
     * @type {string}
     * @memberof Block
     */
    burn_block_time_iso: string;
    /**
     * Hash of the anchor chain block
     * @type {string}
     * @memberof Block
     */
    burn_block_hash: string;
    /**
     * Height of the anchor chain block
     * @type {number}
     * @memberof Block
     */
    burn_block_height: number;
    /**
     * Anchor chain transaction ID
     * @type {string}
     * @memberof Block
     */
    miner_txid: string;
    /**
     * List of transactions included in the block
     * @type {Array<string>}
     * @memberof Block
     */
    txs: Array<string>;
}

export function BlockFromJSON(json: any): Block {
    return BlockFromJSONTyped(json, false);
}

export function BlockFromJSONTyped(json: any, ignoreDiscriminator: boolean): Block {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'canonical': json['canonical'],
        'height': json['height'],
        'hash': json['hash'],
        'parent_block_hash': json['parent_block_hash'],
        'burn_block_time': json['burn_block_time'],
        'burn_block_time_iso': json['burn_block_time_iso'],
        'burn_block_hash': json['burn_block_hash'],
        'burn_block_height': json['burn_block_height'],
        'miner_txid': json['miner_txid'],
        'txs': json['txs'],
    };
}

export function BlockToJSON(value?: Block | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'canonical': value.canonical,
        'height': value.height,
        'hash': value.hash,
        'parent_block_hash': value.parent_block_hash,
        'burn_block_time': value.burn_block_time,
        'burn_block_time_iso': value.burn_block_time_iso,
        'burn_block_hash': value.burn_block_hash,
        'burn_block_height': value.burn_block_height,
        'miner_txid': value.miner_txid,
        'txs': value.txs,
    };
}


