WIP
This commit is contained in:
parent
78df2f7582
commit
da88243db0
2 changed files with 12 additions and 6 deletions
|
|
@ -18,7 +18,7 @@ Error.prototype.toJSON = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
var poll = function(req, res) {
|
var poll = function(req, res) {
|
||||||
var rateRec = _trader.rate(req.params.currency);
|
var rateRec = _trader.rate();
|
||||||
var satoshiBalanceRec = _trader.balance;
|
var satoshiBalanceRec = _trader.balance;
|
||||||
|
|
||||||
// `rateRec` and `satoshiBalanceRec` are both objects, so there's no danger
|
// `rateRec` and `satoshiBalanceRec` are both objects, so there's no danger
|
||||||
|
|
@ -40,8 +40,14 @@ var poll = function(req, res) {
|
||||||
res.json({
|
res.json({
|
||||||
err: null,
|
err: null,
|
||||||
rate: rate * _trader.config.exchanges.settings.commission,
|
rate: rate * _trader.config.exchanges.settings.commission,
|
||||||
fiat: _trader.fiatBalance(0, 0),
|
fiat: _trader.fiatBalance(0, 0) + 100,
|
||||||
currency: req.params.currency,
|
locale: {
|
||||||
|
currency: 'CHF',
|
||||||
|
localeInfo: {
|
||||||
|
primaryLocale: 'en-CA',
|
||||||
|
primaryLocales: ['en-CA']
|
||||||
|
}
|
||||||
|
},
|
||||||
txLimit: parseInt(_trader.config.exchanges.settings.compliance.maximum.limit, 10)
|
txLimit: parseInt(_trader.config.exchanges.settings.compliance.maximum.limit, 10)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -81,7 +87,7 @@ exports.init = function(app, config, trader, authMiddleware) {
|
||||||
_lamassuConfig = config;
|
_lamassuConfig = config;
|
||||||
_trader = trader;
|
_trader = trader;
|
||||||
|
|
||||||
app.get('/poll/:currency', authMiddleware, poll);
|
app.get('/poll', authMiddleware, poll);
|
||||||
app.post('/send', authMiddleware, send);
|
app.post('/send', authMiddleware, send);
|
||||||
app.post('/trade', authMiddleware, trade);
|
app.post('/trade', authMiddleware, trade);
|
||||||
app.post('/pair', pair);
|
app.post('/pair', pair);
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,6 @@ Trader.prototype.pollRate = function (callback) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Trader.prototype.rate = function (currency) {
|
Trader.prototype.rate = function () {
|
||||||
return this.rates[currency];
|
return this.rates[this.config.exchanges.settings.currency];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue