mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
feat(bchjs.Price.current): Removing dead endpoint
This commit is contained in:
+13
-13
@@ -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()
|
||||||
|
|||||||
@@ -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 () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user