WIP
This commit is contained in:
parent
f62e65fe93
commit
bd3441adfb
4 changed files with 43 additions and 21 deletions
|
|
@ -9,19 +9,31 @@ exports.connect = connect
|
|||
|
||||
function load () {
|
||||
var db = connect()
|
||||
return db.one('select data from user_config where type=$1', 'exchanges')
|
||||
return db.one('select data from user_config where type=$1', 'config')
|
||||
.then(function (data) {
|
||||
pgp.end()
|
||||
return data.data
|
||||
})
|
||||
}
|
||||
|
||||
function loadAccounts () {
|
||||
const toFields = fieldArr => R.fromPairs(R.map(r => [r.code, r.value], fieldArr))
|
||||
const toPairs = r => [r.code, toFields(r.fields)]
|
||||
var db = connect()
|
||||
return db.one('select data from user_config where type=$1', 'accounts')
|
||||
.then(function (data) {
|
||||
pgp.end()
|
||||
return R.fromPairs(R.map(toPairs, data.data.accounts))
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
load,
|
||||
unscoped,
|
||||
cryptoScoped,
|
||||
machineScoped,
|
||||
scoped
|
||||
scoped,
|
||||
loadAccounts
|
||||
}
|
||||
|
||||
function matchesValue (crypto, machine, instance) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue