Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Proposal

Proposals are potential changes to the Tezos blockchain. For more information see the Voting API documentation on tzKT.

Hierarchy

  • Proposal

Index

Constructors

constructor

  • new Proposal(hash: null | string, initiator: null | string, firstPeriod: number, lastPeriod: number, epoch: number, upvotes: number, rolls: number, status: null | string, metadata: any): Proposal
  • internal

    Parameters

    • hash: null | string
    • initiator: null | string
    • firstPeriod: number
    • lastPeriod: number
    • epoch: number
    • upvotes: number
    • rolls: number
    • status: null | string
    • metadata: any

    Returns Proposal

Properties

epoch

epoch: number

firstPeriod

firstPeriod: number

hash

hash: null | string

initiator

initiator: null | string

lastPeriod

lastPeriod: number

metadata

metadata: any

rolls

rolls: number

status

status: null | string

upvotes

upvotes: number

Methods

Static byHash

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

    see

    get proposals count.

    example

    Fetch Proposal by Hash

    let hash: string = 'Pt24m4xiPbLDhVgVfABUjirbmda3yohdN82Sp9FeuAXJ4eV9otd';
    let proposal: Proposal = await Proposal.byHash(hash);
    

    Parameters

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

    Returns Promise<Proposal>

    Returns a protocol proposal with the specified hash.

Static count

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

    see

    get proposals count.

    example

    Fetch Proposal Count

    let proposalCount: number = await Proposal.count();
    

    Parameters

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

    Returns Promise<number>

    Returns the total number of protocol proposals.

Static fromAPI

Static get

Static suggestions

  • suggestions(query: string, domain?: string): Promise<any[]>
  • Suggests known proposals by part of alias. This endpoint is useful for autocomplete.

    see

    Suggest proposals

    example

    Fetch Proposal Suggestions

    let query: string = 'Gran'
    let suggestions: any[] = await Proposal.suggestions(query);
    

    Parameters

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

    Returns Promise<any[]>

    proposal suggestions.

Generated using TypeDoc