Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cycle

Cycles are segments of sequential blocks. Cycles used as a measure of time on the Tezos blockchain where cycles are made up of 4096 blocks. For more information see the Cycles API documentation on tzKT.

remark

phases in amendment voting are defined in cycles.

Hierarchy

  • Cycle

Index

Constructors

constructor

  • new Cycle(index: number, firstLevel: number, startTime: Date, lastLevel: number, endTime: Date, snapshotIndex: number, snapshotLevel: number, randomSeed: null | string, totalBakers: number, totalRolls: number, totalStaking: number, totalDelegators: number, totalDelegated: number, quote: null | BalanceShort): Cycle
  • internal

    Parameters

    • index: number
    • firstLevel: number
    • startTime: Date
    • lastLevel: number
    • endTime: Date
    • snapshotIndex: number
    • snapshotLevel: number
    • randomSeed: null | string
    • totalBakers: number
    • totalRolls: number
    • totalStaking: number
    • totalDelegators: number
    • totalDelegated: number
    • quote: null | BalanceShort

    Returns Cycle

Properties

endTime

endTime: Date

firstLevel

firstLevel: number

index

index: number

lastLevel

lastLevel: number

quote

quote: null | BalanceShort

randomSeed

randomSeed: null | string

snapshotIndex

snapshotIndex: number

snapshotLevel

snapshotLevel: number

startTime

startTime: Date

totalBakers

totalBakers: number

totalDelegated

totalDelegated: number

totalDelegators

totalDelegators: number

totalRolls

totalRolls: number

totalStaking

totalStaking: number

Methods

Static byIndex

  • byIndex(index: number, quote: null | string, domain?: string): Promise<Cycle>
  • Fetches a cycle at the specified index from tzKT.

    see

    get cycles by index.

    example

    Fetch a Cycle by Index

    Usage

    Filter by Index

    let cycle: Cycle = await Cycle.byIndex(370);
    

    Parameters

    • index: number
    • quote: null | string
    • domain: string = 'https://api.tzkt.io'

    Returns Promise<Cycle>

    Returns a cycle at the specified index.

Static count

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

    see

    get cycles count.

    example

    Fetch Cycle Count

    Usage

    let cycleCount: number = await Cycle.count();
    

    Parameters

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

    Returns Promise<number>

    Returns the total number of cycles, including future cycles.

Static fromAPI

  • fromAPI(data: any): Cycle

Static get

Generated using TypeDoc