fix: massage coins from l-c
This commit is contained in:
parent
bb433164ab
commit
c94d043506
1 changed files with 11 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
const _ = require('lodash/fp')
|
const _ = require('lodash/fp')
|
||||||
|
|
||||||
const { COIN_LIST: coins } = require('lamassu-coins')
|
const { CRYPTO_CURRENCIES } = require('lamassu-coins')
|
||||||
const { ACCOUNT_LIST: accounts } = require('./accounts')
|
const { ACCOUNT_LIST: accounts } = require('./accounts')
|
||||||
|
|
||||||
const countries = require('../../../data/countries.json')
|
const countries = require('../../../data/countries.json')
|
||||||
|
|
@ -31,9 +31,19 @@ const mapLanguage = lang => {
|
||||||
return { code: lang, display: `${langName} [${country}]` }
|
return { code: lang, display: `${langName} [${country}]` }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const massageCryptos = cryptos => {
|
||||||
|
const convert = crypto => ({
|
||||||
|
code: crypto['cryptoCode'],
|
||||||
|
display: crypto['display']
|
||||||
|
})
|
||||||
|
|
||||||
|
return _.map(convert, cryptos)
|
||||||
|
}
|
||||||
|
|
||||||
const supportedLanguages = languageRec.supported
|
const supportedLanguages = languageRec.supported
|
||||||
|
|
||||||
const languages = supportedLanguages.map(mapLanguage).filter(r => r)
|
const languages = supportedLanguages.map(mapLanguage).filter(r => r)
|
||||||
const currencies = massageCurrencies(currenciesRec)
|
const currencies = massageCurrencies(currenciesRec)
|
||||||
|
const coins = massageCryptos(CRYPTO_CURRENCIES)
|
||||||
|
|
||||||
module.exports = { coins, accounts, countries, currencies, languages }
|
module.exports = { coins, accounts, countries, currencies, languages }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue