feat: add blockchain status getter to all daemons
This commit is contained in:
parent
75cb094476
commit
2819b8a519
11 changed files with 107 additions and 16 deletions
|
|
@ -32,7 +32,8 @@ module.exports = {
|
|||
privateKey,
|
||||
isStrictAddress,
|
||||
connect,
|
||||
supportsBatching
|
||||
supportsBatching,
|
||||
checkBlockchainStatus
|
||||
}
|
||||
|
||||
function connect (url) {
|
||||
|
|
@ -230,3 +231,9 @@ function supportsBatching (cryptoCode) {
|
|||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => SUPPORTS_BATCHING)
|
||||
}
|
||||
|
||||
function checkBlockchainStatus (cryptoCode) {
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(pify(web3.eth.isSyncing))
|
||||
.then(res => _.isObject(res) ? 'syncing' : 'ready')
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue