update protocol ver 1.2
This commit is contained in:
parent
e57244914c
commit
5fb46ad687
@ -19,30 +19,21 @@ class ElectrumClient extends Client{
|
||||
server_banner(){
|
||||
return this.request('server.banner', [])
|
||||
}
|
||||
server_ping(){
|
||||
return this.request('server.ping', [])
|
||||
}
|
||||
server_addPeer(features){
|
||||
return this.request('server.add_peer', [features])
|
||||
}
|
||||
serverDonation_address(){
|
||||
return this.request('server.donation_address', [])
|
||||
}
|
||||
serverPeers_subscribe(){
|
||||
return this.request('server.peers.subscribe', [])
|
||||
}
|
||||
blockchainAddress_getBalance(address){
|
||||
return this.request('blockchain.address.get_balance', [address])
|
||||
}
|
||||
blockchainAddress_getHistory(address){
|
||||
return this.request('blockchain.address.get_history', [address])
|
||||
}
|
||||
blockchainAddress_getMempool(address){
|
||||
return this.request('blockchain.address.get_mempool', [address])
|
||||
}
|
||||
blockchainAddress_getProof(address){
|
||||
return this.request('blockchain.address.get_proof', [address])
|
||||
}
|
||||
blockchainAddress_listunspent(address){
|
||||
return this.request('blockchain.address.listunspent', [address])
|
||||
}
|
||||
blockchainAddress_subscribe(address){
|
||||
return this.request('blockchain.address.subscribe', [address])
|
||||
}
|
||||
blockchainScripthash_getBalance(scripthash){
|
||||
return this.request('blockchain.scripthash.get_balance', [scripthash])
|
||||
}
|
||||
@ -61,17 +52,14 @@ class ElectrumClient extends Client{
|
||||
blockchainBlock_getHeader(height){
|
||||
return this.request('blockchain.block.get_header', [height])
|
||||
}
|
||||
blockchainBlock_getChunk(index){
|
||||
return this.request('blockchain.block.get_chunk', [index])
|
||||
blockchainBlock_headers(start_height, count){
|
||||
return this.request('blockchain.block.headeres', [start_height, count])
|
||||
}
|
||||
blockchainEstimatefee(number){
|
||||
return this.request('blockchain.estimatefee', [number])
|
||||
}
|
||||
blockchainHeaders_subscribe(){
|
||||
return this.request('blockchain.headers.subscribe', [])
|
||||
}
|
||||
blockchainNumblocks_subscribe(){
|
||||
return this.request('blockchain.numblocks.subscribe', [])
|
||||
blockchainHeaders_subscribe(raw){
|
||||
return this.request('blockchain.headers.subscribe', [raw ? raw : false])
|
||||
}
|
||||
blockchain_relayfee(){
|
||||
return this.request('blockchain.relayfee', [])
|
||||
@ -79,15 +67,45 @@ class ElectrumClient extends Client{
|
||||
blockchainTransaction_broadcast(rawtx){
|
||||
return this.request('blockchain.transaction.broadcast', [rawtx])
|
||||
}
|
||||
blockchainTransaction_get(tx_hash, height){
|
||||
return this.request('blockchain.transaction.get', [tx_hash])
|
||||
blockchainTransaction_get(tx_hash, verbose){
|
||||
return this.request('blockchain.transaction.get', [tx_hash, verbose ? verbose : false])
|
||||
}
|
||||
blockchainTransaction_getMerkle(tx_hash, height){
|
||||
return this.request('blockchain.transaction.get_merkle', [tx_hash, height])
|
||||
}
|
||||
mempool_getFeeHistogram(){
|
||||
return this.request('mempool.get_fee_histogram', [])
|
||||
}
|
||||
// ---------------------------------
|
||||
// protocol 1.1 deprecated method
|
||||
// ---------------------------------
|
||||
blockchainUtxo_getAddress(tx_hash, index){
|
||||
return this.request('blockchain.utxo.get_address', [tx_hash, index])
|
||||
}
|
||||
blockchainNumblocks_subscribe(){
|
||||
return this.request('blockchain.numblocks.subscribe', [])
|
||||
}
|
||||
// ---------------------------------
|
||||
// protocol 1.2 deprecated method
|
||||
// ---------------------------------
|
||||
blockchainBlock_getChunk(index){
|
||||
return this.request('blockchain.block.get_chunk', [index])
|
||||
}
|
||||
blockchainAddress_getBalance(address){
|
||||
return this.request('blockchain.address.get_balance', [address])
|
||||
}
|
||||
blockchainAddress_getHistory(address){
|
||||
return this.request('blockchain.address.get_history', [address])
|
||||
}
|
||||
blockchainAddress_getMempool(address){
|
||||
return this.request('blockchain.address.get_mempool', [address])
|
||||
}
|
||||
blockchainAddress_listunspent(address){
|
||||
return this.request('blockchain.address.listunspent', [address])
|
||||
}
|
||||
blockchainAddress_subscribe(address){
|
||||
return this.request('blockchain.address.subscribe', [address])
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ElectrumClient
|
||||
|
||||
Loading…
Reference in New Issue
Block a user