fix: revert old admin code changes
This commit is contained in:
parent
688ec0bcbc
commit
76774a7d4f
2 changed files with 15 additions and 39 deletions
|
|
@ -13,6 +13,7 @@ const settingsLoader = require('./settings-loader')
|
|||
const configValidate = require('./config-validate')
|
||||
const jsonSchema = require('./lamassu-schema.json')
|
||||
|
||||
|
||||
function fetchSchema () {
|
||||
return _.cloneDeep(jsonSchema)
|
||||
}
|
||||
|
|
@ -147,18 +148,18 @@ const mapLanguage = lang => {
|
|||
const langNameArr = languageRec.lang[code]
|
||||
if (!langNameArr) return null
|
||||
const langName = langNameArr[0]
|
||||
if (!country) return { code: lang, display: langName }
|
||||
return { code: lang, display: `${langName} [${country}]` }
|
||||
if (!country) return {code: lang, display: langName}
|
||||
return {code: lang, display: `${langName} [${country}]`}
|
||||
}
|
||||
|
||||
const supportedLanguages = languageRec.supported
|
||||
const languages = supportedLanguages.map(mapLanguage).filter(r => r)
|
||||
const ALL_CRYPTOS = ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH', 'LN']
|
||||
const ALL_CRYPTOS = ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH']
|
||||
|
||||
const filterAccounts = (data, isDevMode) => {
|
||||
const notAllowed = ['mock-ticker', 'mock-wallet', 'mock-exchange', 'mock-sms', 'mock-id-verify', 'mock-zero-conf']
|
||||
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 () {
|
||||
|
|
@ -171,17 +172,16 @@ function fetchData () {
|
|||
{ crypto: 'LTC', display: 'Litecoin' },
|
||||
{ crypto: 'DASH', display: 'Dash' },
|
||||
{ crypto: 'ZEC', display: 'Zcash' },
|
||||
{ crypto: 'BCH', display: 'Bitcoin Cash' },
|
||||
{ crypto: 'LN', display: 'Lightning Network' }
|
||||
{ crypto: 'BCH', display: 'Bitcoin Cash' }
|
||||
],
|
||||
languages: languages,
|
||||
countries,
|
||||
accounts: [
|
||||
{ code: 'bitpay', display: 'Bitpay', class: 'ticker', cryptos: ['BTC', 'BCH', 'LN'] },
|
||||
{ code: 'kraken', display: 'Kraken', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH', 'LN'] },
|
||||
{ code: 'bitstamp', display: 'Bitstamp', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH', 'LN'] },
|
||||
{ code: 'coinbase', display: 'Coinbase', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH', 'ZEC', 'DASH', 'LN'] },
|
||||
{ code: 'itbit', display: 'itBit', class: 'ticker', cryptos: ['BTC', 'ETH', 'LN'] },
|
||||
{ code: 'bitpay', display: 'Bitpay', class: 'ticker', cryptos: ['BTC', '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: 'coinbase', display: 'Coinbase', class: 'ticker', cryptos: ['BTC', 'ETH', 'LTC', 'BCH', 'ZEC', 'DASH'] },
|
||||
{ code: 'itbit', display: 'itBit', class: 'ticker', cryptos: ['BTC', 'ETH'] },
|
||||
{ code: 'mock-ticker', display: 'Mock (Caution!)', class: 'ticker', cryptos: ALL_CRYPTOS },
|
||||
{ code: 'bitcoind', display: 'bitcoind', class: 'wallet', cryptos: ['BTC'] },
|
||||
{ code: 'no-layer2', display: 'No Layer 2', class: 'layer2', cryptos: ALL_CRYPTOS },
|
||||
|
|
@ -192,10 +192,9 @@ function fetchData () {
|
|||
{ code: 'dashd', display: 'dashd', class: 'wallet', cryptos: ['DASH'] },
|
||||
{ code: 'bitcoincashd', display: 'bitcoincashd', class: 'wallet', cryptos: ['BCH'] },
|
||||
{ code: 'bitgo', display: 'BitGo', class: 'wallet', cryptos: ['BTC', 'ZEC', 'LTC', 'BCH', 'DASH'] },
|
||||
{ code: 'galoy', display: 'Galoy', class: 'wallet', cryptos: ['LN'] },
|
||||
{ code: 'bitstamp', display: 'Bitstamp', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'BCH', 'LN'] },
|
||||
{ code: 'itbit', display: 'itBit', class: 'exchange', cryptos: ['BTC', 'ETH', 'LN'] },
|
||||
{ code: 'kraken', display: 'Kraken', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH', 'LN'] },
|
||||
{ code: 'bitstamp', display: 'Bitstamp', class: 'exchange', cryptos: ['BTC', 'ETH', 'LTC', 'BCH'] },
|
||||
{ code: 'itbit', display: 'itBit', class: 'exchange', cryptos: ['BTC', 'ETH'] },
|
||||
{ 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: 'no-exchange', display: 'No exchange', class: 'exchange', cryptos: ALL_CRYPTOS },
|
||||
{ code: 'mock-exchange', display: 'Mock exchange', class: 'exchange', cryptos: ALL_CRYPTOS },
|
||||
|
|
@ -208,7 +207,7 @@ function fetchData () {
|
|||
{ 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'] }
|
||||
],
|
||||
machines: machineList.map(machine => ({ machine: machine.deviceId, display: machine.name }))
|
||||
machines: machineList.map(machine => ({machine: machine.deviceId, display: machine.name}))
|
||||
}))
|
||||
.then((data) => {
|
||||
return filterAccounts(data, devMode)
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"code": "galoy",
|
||||
"display": "Galoy",
|
||||
"fields": [
|
||||
{
|
||||
"code": "apiKey",
|
||||
"display": "API Key",
|
||||
"fieldType": "string",
|
||||
"secret": true,
|
||||
"required": true,
|
||||
"value": ""
|
||||
},
|
||||
{
|
||||
"code": "walletId",
|
||||
"display": "Wallet ID",
|
||||
"fieldType": "password",
|
||||
"secret": true,
|
||||
"required": true,
|
||||
"value": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue