Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Blockchain

Hierarchy

  • Blockchain

Index

Constructors

constructor

Properties

Private apiV1URL

apiV1URL: string

Private logger

logger: (arg: string) => void

Type declaration

    • (arg: string): void
    • Parameters

      • arg: string

      Returns void

Methods

Private _get

  • _get(url: string): Promise<any>

getBlockByHash

  • getBlockByHash(blockHash: string): Promise<Block>
  • Parameters

    • blockHash: string

      block hash for block to be fetched getBlockByHash returns a given block by a given block hash

    Returns Promise<Block>

getBlockByHeight

  • getBlockByHeight(blockHeight: number): Promise<Block>

getBlockDataByDate

  • getBlockDataByDate(date: string): Promise<Array<BlockData>>
  • Parameters

    • date: string

      in YYYYDDMM format getBlockDataByDate gets block data by data for a given block

    Returns Promise<Array<BlockData>>

getBlockDataForBlocksToday

  • getBlockDataForBlocksToday(): Promise<BlockData>
  • getBlockDataForBlocksToday fetches blockdata of all blocks mined

    Returns Promise<BlockData>

getBlockDataLastNBlocks

  • getBlockDataLastNBlocks(blockCount: number): Promise<Array<BlockData>>
  • Parameters

    • blockCount: number

      is the last number of blocks to query getBlockDataLastNBlocks fetch block data by last n blocks of data

    Returns Promise<Array<BlockData>>

getBlockDataLastNHours

  • getBlockDataLastNHours(hours: number): Promise<Array<BlockData>>
  • getBlockDataLastNHours get blockdata for blocks mine in the last n {hours}

    Parameters

    • hours: number

    Returns Promise<Array<BlockData>>

getBlockHeaders

  • getBlockHeaders(blockHeight: number, count?: number): Promise<BlockHeader>

getBlockStatsByHeight

  • getBlockStatsByHeight(blockHeight: number): Promise<BlockData>
  • Parameters

    • blockHeight: number

      height of the block to fetch getBlockByHeight fetches a block at given Height

    Returns Promise<BlockData>

getBlockTransactions

  • getBlockTransactions(blockHeight: number, blockHash?: string): Promise<Transactions>
  • Parameters

    • blockHeight: number

      | blockHash getBlockTransactions fetches block transactions

    • Optional blockHash: string

    Returns Promise<Transactions>

getBlockUTXO

  • getBlockUTXO(blockHeight: number): Promise<UTXOs>

getBlocksByDate

  • getBlocksByDate(date: string): Promise<Array<Block>>
  • Parameters

    • date: string

      YYYYMMDD getBlocksByDate fetches blocks by date in the format YYYYMMDD

    Returns Promise<Array<Block>>

getBlocksByLastNHours

  • getBlocksByLastNHours(hours: number): Promise<Array<Block>>
  • Parameters

    • hours: number

      time in hours to fetch blocks since then getBlocksByLastNHours fetches blocks mined from last n hours

    Returns Promise<Array<Block>>

    Array

getBlocksToday

  • getBlocksToday(): Promise<Array<Block>>

getLastBlocksByCount

  • getLastBlocksByCount(blockCount: number): Promise<Array<Block>>
  • Parameters

    • blockCount: number

      number of blocks to fetch eg. last 10 blocks etc. getBlockHeight returns block at a given blockcount/blockheight

    Returns Promise<Array<Block>>

Generated using TypeDoc