Feat: implement per operator settings cache

Fix: fix linter-found issues

Chore: move findOperatorId to own middleware file

Chore: delete old routes.js file and rename new-routes.js to routes.js

Fix: PR fixes
This commit is contained in:
Cesar 2021-01-13 19:04:40 +00:00 committed by Josh Harvey
parent 85235eaa13
commit 558317e9f3
30 changed files with 232 additions and 860 deletions

View file

@ -10,22 +10,15 @@ const mnemonicHelpers = require('./mnemonic-helpers')
const options = require('./options')
const ph = require('./plugin-helper')
const layer2 = require('./layer2')
const httpError = require('./route-helpers').httpError
const FETCH_INTERVAL = 5000
const INSUFFICIENT_FUNDS_CODE = 570
const INSUFFICIENT_FUNDS_NAME = 'InsufficientFunds'
const ZERO_CONF_EXPIRATION = 60000
function httpError (msg, code) {
const err = new Error(msg)
err.name = 'HTTPError'
err.code = code || 500
return err
}
function computeSeed (masterSeed) {
return hkdf(masterSeed, 32, {salt: 'lamassu-server-salt', info: 'wallet-seed'})
return hkdf(masterSeed, 32, { salt: 'lamassu-server-salt', info: 'wallet-seed' })
}
function fetchWallet (settings, cryptoCode) {