MiningApi
public protocol MiningApi : BaseApi
Undocumented
-
get(byAccountId:)Default implementationGet miner by account id.
Throws
DCoreException.Network.notFoundif account does not exist.Default Implementation
Declaration
Swift
func get(byAccountId id: AccountObjectIdConvertible) -> Single<Miner>Parameters
idAccount id as
AccountObjectIdorStringformat.Return Value
An
Minerif exist. -
getAll()Default implementationGet first 1000 miners by their name to miner account.
Default Implementation
Declaration
Swift
func getAll() -> Single<[String : Miner]>Return Value
Map
[String: Miner]of miners. -
getAll(byIds:)Default implementationGet list of miners by their ids.
Default Implementation
Declaration
Swift
func getAll(byIds ids: [ObjectIdConvertible]) -> Single<[Miner]>Parameters
idsMiner ids as
MinerObjectIdorStringformat.Return Value
Array
[Miner]of miners. -
findAllRelative(byLower:limit:)Default implementationGet names and ids for registered miners.
Default Implementation
Declaration
Swift
func findAllRelative(byLower bound: String, limit: Int) -> Single<[MinerId]>Parameters
boundLower bound of the first name.
limitMax/default
1000.Return Value
List of found miner ids.
-
countAllMiners()Default implementationGet the total number of miners registered in DCore.
Default Implementation
Declaration
Swift
func countAllMiners() -> Single<UInt64>Return Value
Number of miners.
-
getAllFeeds(byAccountId:limit:)Default implementationGet a list of published price feeds by a miner.
Default Implementation
Declaration
Swift
func getAllFeeds(byAccountId id: AccountObjectIdConvertible, limit: UInt64) -> Single<AnyValue>Parameters
idAccount id as
AccountObjectIdorStringformat.limitMaximum number of price feeds to fetch, max/default
100.Return Value
Array of price feeds published by the miner.
-
getAllActualVotes()Default implementationGet the number of votes each miner actually has.
Default Implementation
Declaration
Swift
func getAllActualVotes() -> Single<[MinerVotes]>Return Value
Array of
[MinerVotes], mapping account names to the number of votes. -
findAllVotes(byVoteIds:)Default implementationGiven 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.
Default Implementation
Parameters
idsSet of votes.
Return Value
Array of
[Miners], mapping account names to the number of votes. -
findAllVotingInfos(by:order:id:accountName:onlyMyVotes:limit:)Default implementationGet miner voting info list by account that match search expression.
Default Implementation
Declaration
Swift
func findAllVotingInfos(by expression: String, order: SearchOrder.MinerVoting, id: ObjectIdConvertible?, accountName: String?, onlyMyVotes: Bool, limit: Int) -> Single<[MinerVotingInfo]>Parameters
expressionSet of votes.
orderOrder, default
SearchOrder.MinerVoting.nameDesc.idThe object id of the miner to start searching from, 1.4.* or null when start from beginning, default
nil, asMinerObjectIdorStringformat.accountNameAccount name or null when searching without account.
onlyMyVotesWhen true it selects only votes given by account.
limitMaximum number of miners info to fetch, max/default
1000.Return Value
Array
[MinerVotingInfo]of miner voting info. -
getNewAssetPerBlock()Default implementationGet a reward for a miner from the most recent block.
Default Implementation
Declaration
Swift
func getNewAssetPerBlock() -> Single<BigInt>Parameters
numBlock number.
Return Value
Amount of newlgenerated DCT.
-
getAssetPerBlock(byBlockNum:)Default implementationGet a reward for a miner from a specified block.
Default Implementation
Declaration
Swift
func getAssetPerBlock(byBlockNum num: UInt64) -> Single<BigInt>Parameters
numBlock number.
Return Value
Amount of generated DCT.
-
createVote(forMinerIds:credentials:)Default implementationCreate vote for miner operation.
Default Implementation
Declaration
Swift
func createVote(forMinerIds ids: [ObjectIdConvertible], credentials: Credentials) -> Single<AccountUpdateOperation>Parameters
idsThe object ids of the miners, eg. 1.4.*, as
MinerObjectIdorStringformat.credentialsAccount credentials.
Return Value
-
vote(forMinerIds:credentials:)Default implementationMake vote for miner.
Default Implementation
Declaration
Swift
func vote(forMinerIds ids: [ObjectIdConvertible], credentials: Credentials) -> Single<TransactionConfirmation>Parameters
idsThe object ids of the miners, eg. 1.4.*, as
MinerObjectIdorStringformat.credentialsAccount credentials.
Return Value
View on GitHub
Install in Dash
MiningApi Protocol Reference