Implement remaining non-subscribe methods

This commit is contained in:
Colin Atkinson 2018-01-12 04:58:22 -05:00
parent b49886885b
commit 9277fda4e8
No known key found for this signature in database
GPG Key ID: 5E5635D5498F3950
2 changed files with 16 additions and 6 deletions

View File

@ -10,6 +10,10 @@ const main = async () => {
console.log(balance)
const unspent = await ecl.blockchainScripthash_listunspent("676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c")
console.log(unspent)
const history = await ecl.blockchainScripthash_getHistory("676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c")
console.log(history)
const mempool = await ecl.blockchainScripthash_getMempool("676ca8550e249787290b987e12cebdb2e9b26d88c003d836ffb1cb03ffcbea7c")
console.log(mempool)
}catch(e){
console.log(e)
}

View File

@ -40,14 +40,20 @@ class ElectrumClient extends Client{
blockchainAddress_listunspent(address){
return this.request('blockchain.address.listunspent', [address])
}
blockchainScripthash_getBalance(scripthash) {
return this.request('blockchain.scripthash.get_balance', [scripthash]);
blockchainScripthash_getBalance(scripthash){
return this.request('blockchain.scripthash.get_balance', [scripthash])
}
blockchainScripthash_listunspent(scripthash) {
return this.request('blockchain.scripthash.listunspent', [scripthash]);
blockchainScripthash_getHistory(scripthash){
return this.request('blockchain.scripthash.get_history', [scripthash])
}
blockchainScripthash_getHistory(scripthash) {
return this.request('blockchain.scripthash.get_history', [scripthash]);
blockchainScripthash_getMempool(scripthash){
return this.request('blockchain.scripthash.get_mempool', [scripthash])
}
blockchainScripthash_getProof(scripthash){
return this.request('blockchain.scripthash.get_proof', [scripthash])
}
blockchainScripthash_listunspent(scripthash){
return this.request('blockchain.scripthash.listunspent', [scripthash])
}
blockchainBlock_getHeader(height){
return this.request('blockchain.block.get_header', [height])