From f6a7e1143531eed72732f198371770f77229639f Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Tue, 5 Sep 2017 18:30:08 +0200 Subject: [PATCH] fix cashOut bug --- connect.txt | 1 + lib/tx.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 connect.txt diff --git a/connect.txt b/connect.txt new file mode 100644 index 00000000..f57b1651 --- /dev/null +++ b/connect.txt @@ -0,0 +1 @@ +http://192.168.1.108:8070?otp=faa31556ce0d7c3f11315a7d58a3b009274087de4078bc55f07b58d784cc25a5 diff --git a/lib/tx.js b/lib/tx.js index fcc49b58..32c0bc70 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -23,13 +23,18 @@ function massage (tx) { const transformDates = r => mapValuesWithKey(transformDate, r) const mapBN = r => { - const update = { + const update = r.direction === 'cashIn' + ? { cryptoAtoms: BN(r.cryptoAtoms), fiat: BN(r.fiat), cashInFee: BN(r.cashInFee), cashInFeeCrypto: BN(r.cashInFeeCrypto), minimumTx: BN(r.minimumTx) } + : { + cryptoAtoms: BN(r.cryptoAtoms), + fiat: BN(r.fiat) + } return _.assign(r, update) }