Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Block

Blocks are sets of multiple Operations on the Tezos blockchain. Block headers consists of generic information such as the block predecessor’s hash and the block’s timestamp. For more information see the Block API documentation on tzKT.

Hierarchy

  • Block

Index

Constructors

constructor

Properties

Readonly activations

activations: Operation[]

Readonly baker

baker: any

Readonly ballots

ballots: Operation[]

Readonly delegations

delegations: Operation[]

Readonly deposit

deposit: number

Readonly doubleBaking

doubleBaking: Operation[]

Readonly doubleEndorsing

doubleEndorsing: Operation[]

Readonly endorsements

endorsements: Operation[]

Readonly fees

fees: number

Readonly hash

hash: null | string

Readonly level

level: number

Readonly nonceRevealed

nonceRevealed: boolean

Readonly nonceRevelations

nonceRevelations: Operation[]

Readonly originations

originations: Operation[]

Readonly priority

priority: number

Readonly proposals

proposals: Operation[]

Readonly proto

proto: number

Readonly quote

Readonly reveals

reveals: Operation[]

Readonly reward

reward: number

Readonly software

software: any

Readonly timestamp

timestamp: Date

Readonly transactions

transactions: Operation[]

Readonly validations

validations: number

Methods

Static byHash

  • byHash(hash: string, domain?: string): Promise<Block>
  • Fetches a block with the specified hash from tzKT.

    see

    get block by hash.

    example

    Fetch Blocks by Hash

    Usage

    let hash: string = 'BLtBd1Jbv4KttVdYjGeA22qDwUZk9AWKgP13MpGgkfE3FFHbumW'
    let block: Block = await Block.byHash(hash);
    

    Parameters

    • hash: string
    • domain: string = 'https://api.tzkt.io'

    Returns Promise<Block>

    Returns a block with the specified hash.

Static byLevel

  • byLevel(level: number, domain?: string): Promise<Block>
  • Fetches a block at the specified level from tzKT.

    see

    get block by level.

    example

    Fetch Block by Level

    Usage

    let level: number = 1000001;
    let block: Block = await Block.byLevel(level);
    

    Parameters

    • level: number
    • domain: string = 'https://api.tzkt.io'

    Returns Promise<Block>

    Returns a block with the specified hash.

Static count

  • count(domain?: string): Promise<number>
  • Fetches the total number of blocks from tzKT.

    see

    get blocks count.

    example

    Fetch Block count

    Usage

    let bakerAddress: string = 'tz3S6BBeKgJGXxvLyZ1xzXzMPn11nnFtq5L9';
    let level: number = 1000001;
    let block: Block = await Block.count({'level.gt': level, 'baker': bakerAddress});
    

    Parameters

    • domain: string = 'https://api.tzkt.io'

    Returns Promise<number>

    Returns the total number of blocks.

Static fromAPI

  • fromAPI(data: any): Block

Static get

  • Fetches blocks from tzKT.

    see

    get blocks.

    example

    Fetch list of Blocks

    Usage

    let blocks: Block[] = await Block.get({'level.gt': 1000000, 'level.lt': 1000050});
    

    Parameters

    Returns Promise<Block[]>

    Returns a list of blocks.

Generated using TypeDoc