Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • MiningApi

Index

Constructors

constructor

Properties

Private api

Methods

createVoteOperation

  • Create vote for miner operation.

    Parameters

    • account: AccountRef

      account name or object id, 1.2.*

    • minerIds: ChainObject[]

      list of miner account ids

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<AccountUpdateOperation>

    a create vote operation

findAllVotingInfo

  • Get miner voting info list by account that match search term.

    Parameters

    • searchTerm: string

      miner name

    • Default value order: SearchMinerVotingOrder = SearchMinerVotingOrder.NameDesc

      available options are defined in [SearchMinerVotingOrder]

    • Optional id: ChainObject

      the object id of the miner to start searching from, 1.4.* or null when start from beginning

    • Optional accountName: undefined | string

      account name or null when searching without account

    • Default value onlyMyVotes: boolean = false

      when true it selects only votes given by account

    • Default value limit: number = 1000

      maximum number of miners info to fetch (must not exceed 1000)

    Returns Promise<MinerVotingInfo[]>

    a list of miner voting info

findVotedMiners

  • Given a set of votes, return the objects they are voting for. The results will be in the same order as the votes. null will be returned for any vote ids that are not found.

    Parameters

    • voteIds: VoteId[]

      set of votes

    Returns Promise<Miner[]>

    a list of miners

getActualVotes

  • Get the number of votes each miner actually has.

    Returns Promise<MinerVotes[]>

    a list mapping account names to the number of votes

getAssetPerBlock

  • getAssetPerBlock(blockNum: Long): Promise<Long>
  • Returns a reward for a miner from a specified block.

    Parameters

    • blockNum: Long

      block number

    Returns Promise<Long>

    amount of generated DCT

getFeedsByMiner

  • getFeedsByMiner(account: ChainObject, count?: number): Promise<object>
  • Get a list of published price feeds by a miner.

    Parameters

    • account: ChainObject

      account object id, 1.2.*

    • Default value count: number = 100

      maximum number of price feeds to fetch (must not exceed 100)

    Returns Promise<object>

    a list of price feeds published by the miner

getMinerByAccount

  • Get the miner owned by a given account.

    Parameters

    • account: ChainObject

      the account object id, 1.2.*, whose miner should be retrieved

    Returns Promise<Miner>

    the miner object, or ObjectNotFoundError if the account does not have a miner

getMinerCount

  • getMinerCount(): Promise<Long>
  • Get the total number of miners registered in DCore.

    Returns Promise<Long>

    number of miners

getMiners

  • Returns list of miners by their Ids

    Parameters

    Returns Promise<Miner[]>

    a list of miners

getMinersToName

  • getMinersToName(): Promise<Map<string, Miner>>
  • Returns map of the first 1000 miners by their name to miner account

    Returns Promise<Map<string, Miner>>

    a map of miner name to miner account

getNewAssetPerBlock

  • getNewAssetPerBlock(): Promise<Long>
  • Returns a reward for a miner from the most recent block.

    Returns Promise<Long>

    amount of newly generated DCT

listMinersRelative

  • listMinersRelative(lowerBound?: string, limit?: number): Promise<MinerId[]>
  • lookup names and IDs for registered miners

    Parameters

    • Default value lowerBound: string = ""

      lower bound of the first name

    • Default value limit: number = 1000

      max 1000

    Returns Promise<MinerId[]>

    list of found miner ids

vote

  • Vote for miner.

    Parameters

    • credentials: Credentials

      account credentials

    • minerIds: ChainObject[]

      list of miner account ids

    • Optional fee: Fee

      fee for the operation or asset id, if left undefined the fee will be computed in DCT asset. When set, the request might fail if the asset is not convertible to DCT or conversion pool is not large enough

    Returns Promise<TransactionConfirmation>

    a transaction confirmation

Generated using TypeDoc