Skip to content

Blockchain Class v1.0 Spec

Gabriel Cardona edited this page Jun 18, 2018 · 1 revision

Blockchain

getBestBlockHash

Arguments

  • None

Return Value

  • bestBlockHash: String

getBlock

Arguments

  1. blockhash: String
  2. verbose: Boolean. Default: true

Return Value

Async

  1. for verbose = true: Object
  2. for verbose = false: String

getBlockchainInfo

Arguments

  • None

Return Value

Async

  1. blockchainInfo: Object

getBlockCount

Arguments

  • None

Return Value

Async

  1. blockchainCount: Object

getBlockHash

Arguments

  1. height: Number. Default: 1

Return Value

Async

  1. blockHeight: Number

getBlockHeader

Arguments

  1. hash: String
  2. verbose: Boolean. Default: true

Return Value

Async

  1. for verbose = true: Object
  2. for verbose = false: String

getChainTips() {

Arguments

  • None

Return Value

Async

  1. chainTips: Object

getDifficulty

Arguments

  • None

Return Value

Async

  1. difficulty: Number

getMempoolAncestors

Arguments

  1. txid: String
  2. verbose: Boolean. Default: false

Return Value

Async

  1. for verbose = true: Object
  2. for verbose = false: Array

getMempoolDescendants(txid, verbose = false) {

Arguments

  1. txid: String
  2. verbose: Boolean. Default: false

Return Value

Async

  1. for verbose = true: Object
  2. for verbose = false: Array

getMempoolEntry

Arguments

  1. txid: String

Return Value

  1. mempoolEntry: Object

getMempoolInfo

Arguments

  • None

Return Value

Async

  1. mempoolInfo: Object

getRawMempool

Arguments

  1. verbose: Boolean. Default: false

Return Value

Async

  1. for verbose = true: Object
  2. for verbose = false: Array

getTxOut

Arguments

  1. txid: String required.
  2. n numeric required.
  3. include_mempool: Boolean optional. Default: true

Return Value

Async

  1. for verbose = true: Object
  2. for verbose = false: Array

getTxOutProof

  1. txids: Array required.
  2. blockhash String optional.

Arguments

  1. data: String

Return Value

preciousBlock

Arguments

  1. blockhash: String

Return Value

  • None

pruneBlockchain

Arguments

  1. height: Number

Return Value

  • None

verifyChain(checklevel = 3, nblocks = 6) {

Arguments

  1. checklevel: Number optional. Default: 3
  2. nblocks: Number optional. Default: 6

Return Value

  1. verified: Boolean

verifyTxOutProof

Arguments

  1. proof: String

Return Value

  1. txids: Array