Skip to content

Commit

Permalink
FIX: deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Aug 29, 2020
1 parent 0945300 commit 99c7538
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
41 changes: 3 additions & 38 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ class ElectrumClient extends Client {
onClose() {
super.onClose();
const list = [
'server.peers.subscribe',
'blockchain.numblocks.subscribe',
'blockchain.headers.subscribe',
'blockchain.address.subscribe',
'blockchain.scripthash.subscribe',
];
list.forEach(event => this.subscribe.removeAllListeners(event));
setTimeout(() => {
Expand Down Expand Up @@ -136,17 +134,14 @@ class ElectrumClient extends Client {
blockchainScripthash_subscribe(scripthash) {
return this.request('blockchain.scripthash.subscribe', [scripthash]);
}
blockchainBlock_getHeader(height) {
return this.request('blockchain.block.get_header', [height]);
}
blockchainBlock_headers(start_height, count) {
return this.request('blockchain.block.headeres', [start_height, count]);
}
blockchainEstimatefee(number) {
return this.request('blockchain.estimatefee', [number]);
}
blockchainHeaders_subscribe(raw) {
return this.request('blockchain.headers.subscribe', [raw || false]);
blockchainHeaders_subscribe() {
return this.request('blockchain.headers.subscribe', []);
}
blockchain_relayfee() {
return this.request('blockchain.relayfee', []);
Expand All @@ -166,36 +161,6 @@ class ElectrumClient extends Client {
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;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electrum-client",
"version": "1.1.4",
"version": "1.2.0",
"description": "Electrum protocol client for React Native & Node.js",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 99c7538

Please sign in to comment.