From e0d8f7c24d0c836ea99229239f351dfc3810966b Mon Sep 17 00:00:00 2001 From: siiky Date: Mon, 10 Oct 2022 16:05:37 +0100 Subject: [PATCH] fix: DB doesn't like bn.js numbers --- lib/cash-out/cash-out-helper.js | 2 +- lib/tx.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cash-out/cash-out-helper.js b/lib/cash-out/cash-out-helper.js index a98f7a31..cae14a0d 100644 --- a/lib/cash-out/cash-out-helper.js +++ b/lib/cash-out/cash-out-helper.js @@ -51,7 +51,7 @@ const mapValuesWithKey = _.mapValues.convert({cap: false}) function convertBigNumFields (obj) { const convert = (value, key) => { - if (_.includes(key, [ 'cryptoAtoms', 'receivedCryptoAtoms', 'fiat' ])) { + if (_.includes(key, [ 'cryptoAtoms', 'receivedCryptoAtoms', 'fiat', 'fixedFee', 'fixedFeeCrypto' ])) { return value.toString() } diff --git a/lib/tx.js b/lib/tx.js index 3e3dc27e..2e777c51 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -40,7 +40,7 @@ function massage (tx, pi) { : { cryptoAtoms: new BN(r.cryptoAtoms), fiat: new BN(r.fiat), - cashOutFee: new BN(r.cashOutFee), + fixedFee: new BN(r.fixedFee), rawTickerPrice: r.rawTickerPrice ? new BN(r.rawTickerPrice) : null, commissionPercentage: new BN(r.commissionPercentage) }