diff --git a/src/electrumx.js b/src/electrumx.js index 5bdc3d8..3279b91 100644 --- a/src/electrumx.js +++ b/src/electrumx.js @@ -289,12 +289,12 @@ class ElectrumX { * } * */ - async transactions (address, usrObj = null) { + async transactions (address, usrObj = null, allTxs = false) { try { // Handle single address. if (typeof address === 'string') { const response = await axios.get( - `${this.restURL}electrumx/transactions/${address}`, + `${this.restURL}electrumx/transactions/${address}/${allTxs}`, this.axiosOptions ) return response.data @@ -305,7 +305,8 @@ class ElectrumX { `${this.restURL}electrumx/transactions`, { addresses: address, - usrObj // pass user data when making an internal call. + usrObj, // pass user data when making an internal call. + allTxs }, this.axiosOptions ) @@ -315,6 +316,7 @@ class ElectrumX { throw new Error('Input address must be a string or array of strings.') } catch (error) { + // console.log('Error in transactions(): ', error) if (error.response && error.response.data) throw error.response.data else throw error } diff --git a/test/integration/blockchain.js b/test/integration/blockchain.js index 462067a..d1a7d1f 100644 --- a/test/integration/blockchain.js +++ b/test/integration/blockchain.js @@ -318,7 +318,9 @@ describe('#blockchain', () => { it('should get info about the blockchain', async () => { const result = await bchjs.Blockchain.getBlockchainInfo() - console.log(`blockchain info: ${JSON.stringify(result, null, 2)}`) + // console.log(`blockchain info: ${JSON.stringify(result, null, 2)}`) + + assert.property(result, 'blocks') }) }) }) diff --git a/test/integration/control.js b/test/integration/control.js index bbae59f..e49c467 100644 --- a/test/integration/control.js +++ b/test/integration/control.js @@ -15,7 +15,7 @@ describe('#control', () => { describe('#getNetworkInfo', () => { it('should get info on the full node', async () => { const result = await bchjs.Control.getNetworkInfo() - console.log(`result: ${JSON.stringify(result, null, 2)}`) + // console.log(`result: ${JSON.stringify(result, null, 2)}`) assert.property(result, 'version') }) diff --git a/test/integration/rawtransaction.js b/test/integration/rawtransaction.js index 1ac6c84..49cbc4c 100644 --- a/test/integration/rawtransaction.js +++ b/test/integration/rawtransaction.js @@ -204,7 +204,9 @@ describe('#rawtransaction', () => { const result = await bchjs.RawTransactions.decodeScript(hex) // console.log(`result ${JSON.stringify(result, null, 2)}`) - assert.hasAllKeys(result, ['asm', 'type', 'p2sh']) + assert.property(result, 'asm') + assert.property(result, 'type') + assert.property(result, 'p2sh') }) // CT 2/20/19 - Waiting for this PR to be merged complete the test: