feat(bchjs.Price.current): Removing dead endpoint

This commit is contained in:
Chris Troutner
2022-10-06 17:58:00 -07:00
parent 6ef5ac0f7c
commit 66253ed5a6
2 changed files with 21 additions and 21 deletions
+13 -13
View File
@@ -30,19 +30,19 @@ class Price {
} }
// This endpoint is deprecated. Documentation removed. // This endpoint is deprecated. Documentation removed.
async current (currency = 'usd') { // async current (currency = 'usd') {
try { // try {
const response = await this.axios.get( // const response = await this.axios.get(
`https://index-api.bitcoin.com/api/v0/cash/price/${currency.toLowerCase()}` // `https://index-api.bitcoin.com/api/v0/cash/price/${currency.toLowerCase()}`
) // )
// console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`) // // console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`)
//
return response.data.price // return response.data.price
} catch (err) { // } catch (err) {
if (err.response && err.response.data) throw err.response.data // if (err.response && err.response.data) throw err.response.data
else throw err // else throw err
} // }
} // }
/** /**
* @api price.getUsd() getUsd() * @api price.getUsd() getUsd()
+8 -8
View File
@@ -7,14 +7,14 @@ describe('#price', () => {
if (process.env.IS_USING_FREE_TIER) await sleep(1500) if (process.env.IS_USING_FREE_TIER) await sleep(1500)
}) })
describe('#current', () => { // describe('#current', () => {
describe('#single currency', () => { // describe('#single currency', () => {
it('should get current price for single currency', async () => { // it('should get current price for single currency', async () => {
const result = await bchjs.Price.current('usd') // const result = await bchjs.Price.current('usd')
assert.notEqual(0, result) // assert.notEqual(0, result)
}) // })
}) // })
}) // })
describe('#getUsd', () => { describe('#getUsd', () => {
it('should get the USD price of BCH', async () => { it('should get the USD price of BCH', async () => {