From 66253ed5a609881b0df25dfc20113411bbb52f7c Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Thu, 6 Oct 2022 17:58:00 -0700 Subject: [PATCH] feat(bchjs.Price.current): Removing dead endpoint --- src/price.js | 26 +++++++++++++------------- test/integration/price.js | 16 ++++++++-------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/price.js b/src/price.js index c571132..d8ef010 100644 --- a/src/price.js +++ b/src/price.js @@ -30,19 +30,19 @@ class Price { } // This endpoint is deprecated. Documentation removed. - async current (currency = 'usd') { - try { - const response = await this.axios.get( - `https://index-api.bitcoin.com/api/v0/cash/price/${currency.toLowerCase()}` - ) - // console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`) - - return response.data.price - } catch (err) { - if (err.response && err.response.data) throw err.response.data - else throw err - } - } + // async current (currency = 'usd') { + // try { + // const response = await this.axios.get( + // `https://index-api.bitcoin.com/api/v0/cash/price/${currency.toLowerCase()}` + // ) + // // console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`) + // + // return response.data.price + // } catch (err) { + // if (err.response && err.response.data) throw err.response.data + // else throw err + // } + // } /** * @api price.getUsd() getUsd() diff --git a/test/integration/price.js b/test/integration/price.js index 17b4e85..3d0832a 100644 --- a/test/integration/price.js +++ b/test/integration/price.js @@ -7,14 +7,14 @@ describe('#price', () => { if (process.env.IS_USING_FREE_TIER) await sleep(1500) }) - describe('#current', () => { - describe('#single currency', () => { - it('should get current price for single currency', async () => { - const result = await bchjs.Price.current('usd') - assert.notEqual(0, result) - }) - }) - }) + // describe('#current', () => { + // describe('#single currency', () => { + // it('should get current price for single currency', async () => { + // const result = await bchjs.Price.current('usd') + // assert.notEqual(0, result) + // }) + // }) + // }) describe('#getUsd', () => { it('should get the USD price of BCH', async () => {