Migrate plugins to lib directory
This commit is contained in:
parent
09b29bba56
commit
e7ab8223c2
27 changed files with 869 additions and 858 deletions
26
lib/plugins/ticker/bitstamp/bitstamp.js
Normal file
26
lib/plugins/ticker/bitstamp/bitstamp.js
Normal 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
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue