Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VotingEpoch

VotingEpoch for fetching VotingPeriod. For more information see the Voting API documentation on tzKT.

Hierarchy

  • VotingEpoch

Index

Constructors

constructor

  • new VotingEpoch(index: number, firstLevel: number, startTime: Date, lastLevel: number, endTime: Date, status: null | string, periods: null | VotingPeriod[], proposals: null | Proposal[]): VotingEpoch
  • internal

    Parameters

    • index: number
    • firstLevel: number
    • startTime: Date
    • lastLevel: number
    • endTime: Date
    • status: null | string
    • periods: null | VotingPeriod[]
    • proposals: null | Proposal[]

    Returns VotingEpoch

Properties

endTime

endTime: Date

firstLevel

firstLevel: number

index

index: number

lastLevel

lastLevel: number

periods

periods: null | VotingPeriod[]

proposals

proposals: null | Proposal[]

startTime

startTime: Date

status

status: null | string

Methods

Static byIndex

  • byIndex(index: number, domain?: string): Promise<VotingEpoch>
  • Fetches a voting epoch at a specified index from tzKT.

    see

    get voting epoch by index.

    example

    Fetch Voting Epoch by Index

    let index: number = 27;
    let epoch: VotingEpoch = await VotingEpoch.byIndex(index);
    

    Parameters

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

    Returns Promise<VotingEpoch>

    Returns a voting epoch at the specified index.

Static current

  • Fetches the current voting epoch from tzKT.

    see

    get current voting epoch.

    example

    Fetch current Voting Epoch

    let currentEpoch: VotingEpoch = await VotingEpoch.current();
    

    Parameters

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

    Returns Promise<VotingEpoch>

    Returns the current voting epoch

Static fromAPI

Static get

Static latest

  • Fetches the latest voting from tzKT.

    see

    get latest voting.

    example

    Fetch latest voting

    let latestVoting: any = await VotingEpoch.latest();
    

    Parameters

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

    Returns Promise<VotingEpoch>

    Returns the latest voting.

Generated using TypeDoc