Blockchain
April 16, 2015 ยท View on GitHub
Events
error
Errorerror
syncStart
syncStop
newBlock
stringhashnumberheight
* may be emitted only between syncStart and syncStop events
touchAddress
stringaddressstringtxid
Methods
constructor
ConnectorconnectorObjectoptsstringopts.networkNamenumberopts.txCacheSize
isSyncing
return: boolean
getSnapshot
return: Promise<Snapshot>
getHeader
(number|string)idhash,height
return: Promise<Object> Object is HeaderObject
return: Promise<errors.Blockchain.HeaderNotFound> if couldn't find block
getTx
stringtxid
return: Promise<string> Raw transaction as hex string
return: Promise<errors.Blockchain.TxNotFound> if couldn't find transaction for txid
getTxBlockHash
stringtxid
return: Promise<Object> Object is TxBlockHashObject
return: Promise<errors.Blockchain.TxNotFound> if couldn't find transaction for txid
sendTx
stringrawtx
return: Promise
return: Promise<errors.Blockchain.TxSendError>
addressesQuery
* half-close interval for (from-to]
string[]addressesObject[opts]string[source]blocksormempool(string|number)[from]hashorheight(string|number)[to]hashorheightstring[status]unspentfor affected transactions with unspent outputs
return: Promise<Object> Object is AddressesQueryObject
return: Promise<errors.Blockchain.HeaderNotFound>
subscribeAddress
stringaddress
return: Promise
Naive
Verified
- Properties
- compactMode
- storage
constructor
ConnectorconnectorObjectoptsstringnetworkNameStoragestoragenumbertxCacheSizebooleanisTestnetbooleancompactModebooleanchunkHashes
Snapshot
Snapshot is a proxy object. It memorize latest block and return InconsistentSnapshot error in promise if latest block was changed.
Methods
constructor
Blockchainblockchain
isValid
return: boolean
destroy
remove newBlock listener from snapshot
Objects
HeaderObject
stringhashnumberheightnumberversionstringhashPrevBlockstringhashMerkleRootnumbertimenumberbitsnumbernonce
TxBlockHashObject
stringsourceblocksormempoolObject[block] defined only for confirmed transactions (source isblocks)stringhashnumberheight
AddressesQueryObject
Array.<{txid: string, height: ?number}>transactionsObjectlateststringhashnumberheight