WIP -- running with BTC only
This commit is contained in:
parent
f03151d670
commit
d6ec60db55
3 changed files with 20 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
var BigNumber = require('bignumber.js')
|
||||
var logger = require('./logger')
|
||||
|
||||
var mock = false
|
||||
|
|
@ -101,14 +102,20 @@ function poll (req, res) {
|
|||
}
|
||||
|
||||
function trade (req, res) {
|
||||
plugins.trade(session(req), req.body, function (err) {
|
||||
var tx = req.body
|
||||
tx.cryptoAtoms = new BigNumber(tx.cryptoAtoms)
|
||||
|
||||
plugins.trade(session(req), tx, function (err) {
|
||||
var statusCode = err ? 500 : 201
|
||||
res.json(statusCode, {err: err})
|
||||
})
|
||||
}
|
||||
|
||||
function send (req, res) {
|
||||
plugins.sendCoins(session(req), req.body, function (err, status) {
|
||||
var tx = req.body
|
||||
tx.cryptoAtoms = new BigNumber(tx.cryptoAtoms)
|
||||
|
||||
plugins.sendCoins(session(req), tx, function (err, status) {
|
||||
// TODO: use status.statusCode here after confirming machine compatibility
|
||||
// FIX: (joshm) set txHash to status.txId instead of previous status.txHash which wasn't being set
|
||||
// Need to clean up txHash vs txId
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue