Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Fixing summaries api call, refs #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Genar Trias Ortiz committed Dec 7, 2017
1 parent 2da7a57 commit ca1fe41
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"babel-node": "babel-node server/server.js",
"nodemon": "nodemon --exec npm run babel-node",
"start": "node .",
"dev": "DEBUG=gaby-api* NODE_ENV=development DB_HOST=localhost npm run nodemon",
"dev": "DEBUG=goby-api* NODE_ENV=development DB_HOST=localhost npm run nodemon",
"ci-test": "NODE_ENV=test npm test -- --no-color",
"test": "node scripts/test.js",
"posttest": "npm run lint && nsp check",
Expand Down
9 changes: 8 additions & 1 deletion server/exchanges/bittrex.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import debug from 'debug'

module.exports = class BittrexExchange {
constructor (bitrexOpts) {
this.marketBlacklist = [
'BTC'
]
this.bittrexOps = bitrexOpts
bittrex.options(bitrexOpts)
}
Expand All @@ -25,7 +28,7 @@ module.exports = class BittrexExchange {

bittrex.getorderhistory(options, function (data, err) {
if (err) {
debug('goby-api:bittrex')('An error getting orderhistory happened')
debug('goby-api:bittrex')('An error getting orderhistory happened for market: ', market)
return cb(err)
}

Expand Down Expand Up @@ -63,6 +66,10 @@ module.exports = class BittrexExchange {
const orderHistories = []

balances.forEach((balance) => {
if (this.marketBlacklist.indexOf(balance.Currency) !== -1) {
return
}

const balanceSummary = new Promise((resolve, reject) => {
const market = 'BTC-' + balance.Currency
this.getOrders(market, (err, data) => {
Expand Down
7 changes: 7 additions & 0 deletions server/exchanges/bittrex.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
describe('exchanges', () => {
describe('bittrex', () => {
it('should bla bla', (done) => {
done()
})
})
})

0 comments on commit ca1fe41

Please sign in to comment.