Migrate plugins to lib directory

This commit is contained in:
Josh Harvey 2017-04-15 19:12:29 +03:00
parent 09b29bba56
commit e7ab8223c2
27 changed files with 869 additions and 858 deletions

View file

@ -0,0 +1,26 @@
const BN = require('../../../bn')
const common = require('../common/bitstamp')
function ticker (account, fiatCode, cryptoCode) {
return Promise.resolve()
.then(() => {
if (cryptoCode !== 'BTC') {
throw new Error('Unsupported crypto: ' + cryptoCode)
}
})
.then(() => {
const market = common.buildMarket(fiatCode, cryptoCode)
return common.request('/ticker/' + market, 'GET')
})
.then(r => ({
rates: {
ask: BN(r.ask),
bid: BN(r.bid)
}
}))
}
module.exports = {
ticker
}