diff --git a/lib/route-helpers.js b/lib/route-helpers.js index d008fac6..eff676d6 100644 --- a/lib/route-helpers.js +++ b/lib/route-helpers.js @@ -1,5 +1,4 @@ const _ = require('lodash/fp') -const R = require('ramda') const db = require('./db') const dbm = require('./postgresql_interface') @@ -57,11 +56,13 @@ function fetchPhoneTx (phone) { return db.any(sql, values) .then(_.map(toCashOutTx)) .then(txs => { - const confirmedTxs = txs.filter(tx => R.contains(tx.status, ['instant', 'confirmed'])) + const confirmedTxs = txs.filter(tx => _.includes(tx.status, ['instant', 'confirmed'])) if (confirmedTxs.length > 0) { - const maxTx = R.reduce((acc, val) => { + const reducer = (acc, val) => { return !acc || val.cryptoAtoms.gt(acc.cryptoAtoms) ? val : acc - }, null, confirmedTxs) + } + + const maxTx = _.reduce(reducer, null, confirmedTxs) return maxTx } diff --git a/package.json b/package.json index 6b0584c0..ef2e5390 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "pify": "^3.0.0", "pretty-ms": "^2.1.0", "promise-sequential": "^1.1.1", - "ramda": "^0.22.1", "serve-static": "^1.12.4", "socket.io": "^2.0.3", "socket.io-client": "^2.0.3", diff --git a/tools/currencies.js b/tools/currencies.js index 9acf407d..9afb2d68 100644 --- a/tools/currencies.js +++ b/tools/currencies.js @@ -1,7 +1,6 @@ // Pull latest from: http://www.currency-iso.org/en/home/tables/table-a1.html // Convert to JSON at: http://www.csvjson.com/csv2json -const R = require('ramda') const currencies = require('../currencies.json') function goodCurrency (currency) {