chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -3,26 +3,25 @@ const axios = require('axios').create({
|
|||
// TODO: get rejectUnauthorized true to work
|
||||
baseURL: `${process.env.TICKER_URL}/api/rates/`,
|
||||
httpsAgent: new https.Agent({
|
||||
rejectUnauthorized: false
|
||||
})
|
||||
rejectUnauthorized: false,
|
||||
}),
|
||||
})
|
||||
|
||||
const BN = require('../../../bn')
|
||||
|
||||
function ticker (account, fiatCode, cryptoCode) {
|
||||
return axios.get(`${cryptoCode}/${fiatCode}`)
|
||||
.then(({ data }) => {
|
||||
if (data.error) throw new Error(JSON.stringify(data.error))
|
||||
return {
|
||||
rates: {
|
||||
ask: BN(data.ask),
|
||||
bid: BN(data.bid),
|
||||
signature: data.signature
|
||||
}
|
||||
}
|
||||
})
|
||||
function ticker(account, fiatCode, cryptoCode) {
|
||||
return axios.get(`${cryptoCode}/${fiatCode}`).then(({ data }) => {
|
||||
if (data.error) throw new Error(JSON.stringify(data.error))
|
||||
return {
|
||||
rates: {
|
||||
ask: BN(data.ask),
|
||||
bid: BN(data.bid),
|
||||
signature: data.signature,
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ticker
|
||||
ticker,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue