feat: format config file
This commit is contained in:
parent
434e3623b0
commit
4697c89064
3 changed files with 40 additions and 40 deletions
|
|
@ -13,7 +13,6 @@ const settingsLoader = require('./settings-loader')
|
||||||
const configValidate = require('./config-validate')
|
const configValidate = require('./config-validate')
|
||||||
const jsonSchema = require('./lamassu-schema.json')
|
const jsonSchema = require('./lamassu-schema.json')
|
||||||
|
|
||||||
|
|
||||||
function fetchSchema () {
|
function fetchSchema () {
|
||||||
return _.cloneDeep(jsonSchema)
|
return _.cloneDeep(jsonSchema)
|
||||||
}
|
}
|
||||||
|
|
@ -148,8 +147,8 @@ const mapLanguage = lang => {
|
||||||
const langNameArr = languageRec.lang[code]
|
const langNameArr = languageRec.lang[code]
|
||||||
if (!langNameArr) return null
|
if (!langNameArr) return null
|
||||||
const langName = langNameArr[0]
|
const langName = langNameArr[0]
|
||||||
if (!country) return {code: lang, display: langName}
|
if (!country) return { code: lang, display: langName }
|
||||||
return {code: lang, display: `${langName} [${country}]`}
|
return { code: lang, display: `${langName} [${country}]` }
|
||||||
}
|
}
|
||||||
|
|
||||||
const supportedLanguages = languageRec.supported
|
const supportedLanguages = languageRec.supported
|
||||||
|
|
@ -159,7 +158,7 @@ const ALL_CRYPTOS = ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH']
|
||||||
const filterAccounts = (data, isDevMode) => {
|
const filterAccounts = (data, isDevMode) => {
|
||||||
const notAllowed = ['mock-ticker', 'mock-wallet', 'mock-exchange', 'mock-sms', 'mock-id-verify', 'mock-zero-conf']
|
const notAllowed = ['mock-ticker', 'mock-wallet', 'mock-exchange', 'mock-sms', 'mock-id-verify', 'mock-zero-conf']
|
||||||
const filterOut = o => _.includes(o.code, notAllowed)
|
const filterOut = o => _.includes(o.code, notAllowed)
|
||||||
return isDevMode ? data : {...data, accounts: _.filter(a => !filterOut(a), data.accounts)}
|
return isDevMode ? data : { ...data, accounts: _.filter(a => !filterOut(a), data.accounts) }
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchData () {
|
function fetchData () {
|
||||||
|
|
@ -167,47 +166,48 @@ function fetchData () {
|
||||||
.then(machineList => ({
|
.then(machineList => ({
|
||||||
currencies: massageCurrencies(currencies),
|
currencies: massageCurrencies(currencies),
|
||||||
cryptoCurrencies: [
|
cryptoCurrencies: [
|
||||||
{crypto: 'BTC', display: 'Bitcoin'},
|
{ crypto: 'BTC', display: 'Bitcoin' },
|
||||||
{crypto: 'ETH', display: 'Ethereum'},
|
{ crypto: 'ETH', display: 'Ethereum' },
|
||||||
{crypto: 'LTC', display: 'Litecoin'},
|
{ crypto: 'LTC', display: 'Litecoin' },
|
||||||
{crypto: 'DASH', display: 'Dash'},
|
{ crypto: 'DASH', display: 'Dash' },
|
||||||
{crypto: 'ZEC', display: 'Zcash'},
|
{ crypto: 'ZEC', display: 'Zcash' },
|
||||||
{crypto: 'BCH', display: 'Bitcoin Cash'}
|
{ crypto: 'BCH', display: 'Bitcoin Cash' },
|
||||||
|
{ crypto: 'LN', display: 'Lightning Network' }
|
||||||
],
|
],
|
||||||
languages: languages,
|
languages: languages,
|
||||||
countries,
|
countries,
|
||||||
accounts: [
|
accounts: [
|
||||||
{code: 'bitpay', display: 'Bitpay', class: 'ticker', cryptos: ['BTC', 'BCH']},
|
{ code: 'bitpay', display: 'Bitpay', class: 'ticker', cryptos: ['BTC', 'BCH'] },
|
||||||
{code: 'kraken', display: 'Kraken', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH']},
|
{ code: 'kraken', display: 'Kraken', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH'] },
|
||||||
{code: 'bitstamp', display: 'Bitstamp', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH']},
|
{ code: 'bitstamp', display: 'Bitstamp', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH'] },
|
||||||
{code: 'coinbase', display: 'Coinbase', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH', 'ZEC', 'DASH']},
|
{ code: 'coinbase', display: 'Coinbase', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH', 'ZEC', 'DASH'] },
|
||||||
{code: 'itbit', display: 'itBit', class: 'ticker', cryptos: ['BTC', 'ETH']},
|
{ code: 'itbit', display: 'itBit', class: 'ticker', cryptos: ['BTC', 'ETH'] },
|
||||||
{code: 'mock-ticker', display: 'Mock (Caution!)', class: 'ticker', cryptos: ALL_CRYPTOS},
|
{ code: 'mock-ticker', display: 'Mock (Caution!)', class: 'ticker', cryptos: ALL_CRYPTOS },
|
||||||
{code: 'bitcoind', display: 'bitcoind', class: 'wallet', cryptos: ['BTC']},
|
{ code: 'bitcoind', display: 'bitcoind', class: 'wallet', cryptos: ['BTC'] },
|
||||||
{code: 'no-layer2', display: 'No Layer 2', class: 'layer2', cryptos: ALL_CRYPTOS},
|
{ code: 'no-layer2', display: 'No Layer 2', class: 'layer2', cryptos: ALL_CRYPTOS },
|
||||||
{code: 'infura', display: 'Infura', class: 'wallet', cryptos: ['ETH']},
|
{ code: 'infura', display: 'Infura', class: 'wallet', cryptos: ['ETH'] },
|
||||||
{code: 'geth', display: 'geth', class: 'wallet', cryptos: ['ETH']},
|
{ code: 'geth', display: 'geth', class: 'wallet', cryptos: ['ETH'] },
|
||||||
{code: 'zcashd', display: 'zcashd', class: 'wallet', cryptos: ['ZEC']},
|
{ code: 'zcashd', display: 'zcashd', class: 'wallet', cryptos: ['ZEC'] },
|
||||||
{code: 'litecoind', display: 'litecoind', class: 'wallet', cryptos: ['LTC']},
|
{ code: 'litecoind', display: 'litecoind', class: 'wallet', cryptos: ['LTC'] },
|
||||||
{code: 'dashd', display: 'dashd', class: 'wallet', cryptos: ['DASH']},
|
{ code: 'dashd', display: 'dashd', class: 'wallet', cryptos: ['DASH'] },
|
||||||
{code: 'bitcoincashd', display: 'bitcoincashd', class: 'wallet', cryptos: ['BCH']},
|
{ code: 'bitcoincashd', display: 'bitcoincashd', class: 'wallet', cryptos: ['BCH'] },
|
||||||
{code: 'bitgo', display: 'BitGo', class: 'wallet', cryptos: ['BTC', 'ZEC', 'LTC', 'BCH', 'DASH']},
|
{ code: 'bitgo', display: 'BitGo', class: 'wallet', cryptos: ['BTC', 'ZEC', 'LTC', 'BCH', 'DASH'] },
|
||||||
{code: 'bitstamp', display: 'Bitstamp', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'BCH']},
|
{ code: 'bitstamp', display: 'Bitstamp', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'BCH'] },
|
||||||
{code: 'itbit', display: 'itBit', class: 'exchange', cryptos: ['BTC', 'ETH']},
|
{ code: 'itbit', display: 'itBit', class: 'exchange', cryptos: ['BTC', 'ETH'] },
|
||||||
{code: 'kraken', display: 'Kraken', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH']},
|
{ code: 'kraken', display: 'Kraken', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH'] },
|
||||||
{code: 'mock-wallet', display: 'Mock (Caution!)', class: 'wallet', cryptos: ALL_CRYPTOS},
|
{ code: 'mock-wallet', display: 'Mock (Caution!)', class: 'wallet', cryptos: ALL_CRYPTOS },
|
||||||
{code: 'no-exchange', display: 'No exchange', class: 'exchange', cryptos: ALL_CRYPTOS},
|
{ code: 'no-exchange', display: 'No exchange', class: 'exchange', cryptos: ALL_CRYPTOS },
|
||||||
{code: 'mock-exchange', display: 'Mock exchange', class: 'exchange', cryptos: ALL_CRYPTOS},
|
{ code: 'mock-exchange', display: 'Mock exchange', class: 'exchange', cryptos: ALL_CRYPTOS },
|
||||||
{code: 'mock-sms', display: 'Mock SMS', class: 'sms'},
|
{ code: 'mock-sms', display: 'Mock SMS', class: 'sms' },
|
||||||
{code: 'mock-id-verify', display: 'Mock ID verifier', class: 'idVerifier'},
|
{ code: 'mock-id-verify', display: 'Mock ID verifier', class: 'idVerifier' },
|
||||||
{code: 'twilio', display: 'Twilio', class: 'sms'},
|
{ code: 'twilio', display: 'Twilio', class: 'sms' },
|
||||||
{code: 'mailgun', display: 'Mailgun', class: 'email'},
|
{ code: 'mailgun', display: 'Mailgun', class: 'email' },
|
||||||
{code: 'all-zero-conf', display: 'Always 0-conf', class: 'zeroConf', cryptos: ['BTC', 'ZEC', 'LTC', 'DASH', 'BCH']},
|
{ code: 'all-zero-conf', display: 'Always 0-conf', class: 'zeroConf', cryptos: ['BTC', 'ZEC', 'LTC', 'DASH', 'BCH'] },
|
||||||
{code: 'no-zero-conf', display: 'Always 1-conf', class: 'zeroConf', cryptos: ALL_CRYPTOS},
|
{ code: 'no-zero-conf', display: 'Always 1-conf', class: 'zeroConf', cryptos: ALL_CRYPTOS },
|
||||||
{code: 'blockcypher', display: 'Blockcypher', class: 'zeroConf', cryptos: ['BTC']},
|
{ code: 'blockcypher', display: 'Blockcypher', class: 'zeroConf', cryptos: ['BTC'] },
|
||||||
{code: 'mock-zero-conf', display: 'Mock 0-conf', class: 'zeroConf', cryptos: ['BTC', 'ZEC', 'LTC', 'DASH', 'BCH', 'ETH']}
|
{ code: 'mock-zero-conf', display: 'Mock 0-conf', class: 'zeroConf', cryptos: ['BTC', 'ZEC', 'LTC', 'DASH', 'BCH', 'ETH'] }
|
||||||
],
|
],
|
||||||
machines: machineList.map(machine => ({machine: machine.deviceId, display: machine.name}))
|
machines: machineList.map(machine => ({ machine: machine.deviceId, display: machine.name }))
|
||||||
}))
|
}))
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
return filterAccounts(data, devMode)
|
return filterAccounts(data, devMode)
|
||||||
|
|
|
||||||
0
lib/blockchain/lightning.js
Normal file
0
lib/blockchain/lightning.js
Normal file
0
lib/plugins/wallet/lightning/lightning.js
Normal file
0
lib/plugins/wallet/lightning/lightning.js
Normal file
Loading…
Add table
Add a link
Reference in a new issue