chore: use monorepo organization
This commit is contained in:
parent
deaf7d6ecc
commit
a687827f7e
1099 changed files with 8184 additions and 11535 deletions
74
packages/server/lib/new-admin/config/accounts.js
Normal file
74
packages/server/lib/new-admin/config/accounts.js
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
const { COINS, ALL_CRYPTOS } = require('@lamassu/coins')
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const { ALL } = require('../../plugins/common/ccxt')
|
||||
|
||||
const { BTC, BCH, DASH, ETH, LTC, USDT, ZEC, XMR, LN, TRX, USDT_TRON, USDC } = COINS
|
||||
const { bitpay, itbit, bitstamp, kraken, binanceus, cex, binance, bitfinex } = ALL
|
||||
|
||||
const TICKER = 'ticker'
|
||||
const WALLET = 'wallet'
|
||||
const LAYER_2 = 'layer2'
|
||||
const EXCHANGE = 'exchange'
|
||||
const SMS = 'sms'
|
||||
const ID_VERIFIER = 'idVerifier'
|
||||
const EMAIL = 'email'
|
||||
const ZERO_CONF = 'zeroConf'
|
||||
const WALLET_SCORING = 'wallet_scoring'
|
||||
const COMPLIANCE = 'compliance'
|
||||
|
||||
const ALL_ACCOUNTS = [
|
||||
{ code: 'bitfinex', display: 'Bitfinex', class: TICKER, cryptos: bitfinex.CRYPTO },
|
||||
{ code: 'bitfinex', display: 'Bitfinex', class: EXCHANGE, cryptos: bitfinex.CRYPTO },
|
||||
{ code: 'binance', display: 'Binance', class: TICKER, cryptos: binance.CRYPTO },
|
||||
{ code: 'binanceus', display: 'Binance.us', class: TICKER, cryptos: binanceus.CRYPTO },
|
||||
{ code: 'cex', display: 'CEX.IO', class: TICKER, cryptos: cex.CRYPTO },
|
||||
{ code: 'bitpay', display: 'Bitpay', class: TICKER, cryptos: bitpay.CRYPTO },
|
||||
{ code: 'kraken', display: 'Kraken', class: TICKER, cryptos: kraken.CRYPTO },
|
||||
{ code: 'bitstamp', display: 'Bitstamp', class: TICKER, cryptos: bitstamp.CRYPTO },
|
||||
{ code: 'itbit', display: 'itBit', class: TICKER, cryptos: itbit.CRYPTO },
|
||||
{ code: 'mock-ticker', display: 'Mock (Caution!)', class: TICKER, cryptos: ALL_CRYPTOS, dev: true },
|
||||
{ code: 'bitcoind', display: 'bitcoind', class: WALLET, cryptos: [BTC] },
|
||||
{ code: 'no-layer2', display: 'No Layer 2', class: LAYER_2, cryptos: ALL_CRYPTOS },
|
||||
{ code: 'infura', display: 'Infura/Alchemy', class: WALLET, cryptos: [ETH, USDT, USDC] },
|
||||
{ code: 'trongrid', display: 'Trongrid', class: WALLET, cryptos: [TRX, USDT_TRON] },
|
||||
{ code: 'geth', display: 'geth (deprecated)', class: WALLET, cryptos: [ETH, USDT, USDC] },
|
||||
{ code: 'zcashd', display: 'zcashd', class: WALLET, cryptos: [ZEC] },
|
||||
{ code: 'litecoind', display: 'litecoind', class: WALLET, cryptos: [LTC] },
|
||||
{ code: 'dashd', display: 'dashd', class: WALLET, cryptos: [DASH] },
|
||||
{ code: 'monerod', display: 'monerod', class: WALLET, cryptos: [XMR] },
|
||||
{ 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: bitstamp.CRYPTO },
|
||||
{ code: 'itbit', display: 'itBit', class: EXCHANGE, cryptos: itbit.CRYPTO },
|
||||
{ code: 'kraken', display: 'Kraken', class: EXCHANGE, cryptos: kraken.CRYPTO },
|
||||
{ code: 'binance', display: 'Binance', class: EXCHANGE, cryptos: binance.CRYPTO },
|
||||
{ code: 'binanceus', display: 'Binance.us', class: EXCHANGE, cryptos: binanceus.CRYPTO },
|
||||
{ code: 'cex', display: 'CEX.IO', class: EXCHANGE, cryptos: cex.CRYPTO },
|
||||
{ code: 'mock-wallet', display: 'Mock (Caution!)', class: WALLET, cryptos: ALL_CRYPTOS, dev: true },
|
||||
{ code: 'no-exchange', display: 'No exchange', class: EXCHANGE, cryptos: ALL_CRYPTOS },
|
||||
{ code: 'mock-exchange', display: 'Mock exchange', class: EXCHANGE, cryptos: ALL_CRYPTOS, dev: true },
|
||||
{ code: 'mock-sms', display: 'Mock SMS', class: SMS, dev: true },
|
||||
{ code: 'mock-id-verify', display: 'Mock ID verifier', class: ID_VERIFIER, dev: true },
|
||||
{ code: 'twilio', display: 'Twilio', class: SMS },
|
||||
{ code: 'telnyx', display: 'Telnyx', class: SMS },
|
||||
{ code: 'vonage', display: 'Vonage', class: SMS },
|
||||
{ code: 'inforu', display: 'InforU', class: SMS },
|
||||
{ code: 'mailgun', display: 'Mailgun', class: EMAIL },
|
||||
{ code: 'mock-email', display: 'Mock Email', class: EMAIL, dev: true },
|
||||
{ code: 'none', display: 'None', class: ZERO_CONF, cryptos: ALL_CRYPTOS },
|
||||
{ code: 'blockcypher', display: 'Blockcypher', class: ZERO_CONF, cryptos: [BTC] },
|
||||
{ code: 'mock-zero-conf', display: 'Mock 0-conf', class: ZERO_CONF, cryptos: ALL_CRYPTOS, dev: true },
|
||||
{ code: 'scorechain', display: 'Scorechain', class: WALLET_SCORING, cryptos: [BTC, ETH, LTC, BCH, DASH, USDT, USDC, USDT_TRON, TRX] },
|
||||
{ code: 'elliptic', display: 'Elliptic', class: WALLET_SCORING, cryptos: [BTC, ETH, LTC, BCH, USDT, USDC, USDT_TRON, TRX, ZEC] },
|
||||
{ code: 'mock-scoring', display: 'Mock scoring', class: WALLET_SCORING, cryptos: ALL_CRYPTOS, dev: true },
|
||||
{ code: 'sumsub', display: 'Sumsub', class: COMPLIANCE },
|
||||
{ code: 'mock-compliance', display: 'Mock Compliance', class: COMPLIANCE, dev: true },
|
||||
]
|
||||
|
||||
const flags = require('minimist')(process.argv.slice(2))
|
||||
const devMode = flags.dev || flags.lamassuDev
|
||||
const ACCOUNT_LIST = devMode ? ALL_ACCOUNTS : _.filter(it => !it.dev)(ALL_ACCOUNTS)
|
||||
|
||||
module.exports = { ACCOUNT_LIST }
|
||||
1
packages/server/lib/new-admin/config/data/countries.json
Normal file
1
packages/server/lib/new-admin/config/data/countries.json
Normal file
File diff suppressed because one or more lines are too long
2423
packages/server/lib/new-admin/config/data/currencies.json
Normal file
2423
packages/server/lib/new-admin/config/data/currencies.json
Normal file
File diff suppressed because it is too large
Load diff
255
packages/server/lib/new-admin/config/data/languages.json
Normal file
255
packages/server/lib/new-admin/config/data/languages.json
Normal file
|
|
@ -0,0 +1,255 @@
|
|||
{
|
||||
"attribute": {"name":0, "nativeName":1},
|
||||
"rtl": {"ar":1,"dv":1,"fa":1,"ha":1,"he":1,"ks":1,"ku":1,"ps":1,"ur":1,"yi":1},
|
||||
"lang": {
|
||||
"aa":["Afar","Afar"],
|
||||
"ab":["Abkhazian","Аҧсуа"],
|
||||
"af":["Afrikaans","Afrikaans"],
|
||||
"ak":["Akan","Akana"],
|
||||
"am":["Amharic","አማርኛ"],
|
||||
"an":["Aragonese","Aragonés"],
|
||||
"ar":["Arabic","العربية"],
|
||||
"as":["Assamese","অসমীয়া"],
|
||||
"av":["Avar","Авар"],
|
||||
"ay":["Aymara","Aymar"],
|
||||
"az":["Azerbaijani","Azərbaycanca / آذربايجان"],
|
||||
"ba":["Bashkir","Башҡорт"],
|
||||
"be":["Belarusian","Беларуская"],
|
||||
"bg":["Bulgarian","Български"],
|
||||
"bh":["Bihari","भोजपुरी"],
|
||||
"bi":["Bislama","Bislama"],
|
||||
"bm":["Bambara","Bamanankan"],
|
||||
"bn":["Bengali","বাংলা"],
|
||||
"bo":["Tibetan","བོད་ཡིག / Bod skad"],
|
||||
"br":["Breton","Brezhoneg"],
|
||||
"bs":["Bosnian","Bosanski"],
|
||||
"ca":["Catalan","Català"],
|
||||
"ce":["Chechen","Нохчийн"],
|
||||
"ch":["Chamorro","Chamoru"],
|
||||
"co":["Corsican","Corsu"],
|
||||
"cr":["Cree","Nehiyaw"],
|
||||
"cs":["Czech","Česky"],
|
||||
"cu":["Old Church Slavonic / Old Bulgarian","словѣньскъ / slověnĭskŭ"],
|
||||
"cv":["Chuvash","Чăваш"],
|
||||
"cy":["Welsh","Cymraeg"],
|
||||
"da":["Danish","Dansk"],
|
||||
"de":["German","Deutsch"],
|
||||
"dv":["Divehi","ދިވެހިބަސް"],
|
||||
"dz":["Dzongkha","ཇོང་ཁ"],
|
||||
"ee":["Ewe","Ɛʋɛ"],
|
||||
"el":["Greek","Ελληνικά"],
|
||||
"en":["English","English"],
|
||||
"eo":["Esperanto","Esperanto"],
|
||||
"es":["Spanish","Español"],
|
||||
"et":["Estonian","Eesti"],
|
||||
"eu":["Basque","Euskara"],
|
||||
"fa":["Persian","فارسی"],
|
||||
"ff":["Peul","Fulfulde"],
|
||||
"fi":["Finnish","Suomi"],
|
||||
"fj":["Fijian","Na Vosa Vakaviti"],
|
||||
"fo":["Faroese","Føroyskt"],
|
||||
"fr":["French","Français"],
|
||||
"fy":["West Frisian","Frysk"],
|
||||
"ga":["Irish","Gaeilge"],
|
||||
"gd":["Scottish Gaelic","Gàidhlig"],
|
||||
"gl":["Galician","Galego"],
|
||||
"gn":["Guarani","Avañe'ẽ"],
|
||||
"gu":["Gujarati","ગુજરાતી"],
|
||||
"gv":["Manx","Gaelg"],
|
||||
"ha":["Hausa","هَوُسَ"],
|
||||
"he":["Hebrew","עברית"],
|
||||
"hi":["Hindi","हिन्दी"],
|
||||
"ho":["Hiri Motu","Hiri Motu"],
|
||||
"hr":["Croatian","Hrvatski"],
|
||||
"ht":["Haitian","Krèyol ayisyen"],
|
||||
"hu":["Hungarian","Magyar"],
|
||||
"hy":["Armenian","Հայերեն"],
|
||||
"hz":["Herero","Otsiherero"],
|
||||
"ia":["Interlingua","Interlingua"],
|
||||
"id":["Indonesian","Bahasa Indonesia"],
|
||||
"ie":["Interlingue","Interlingue"],
|
||||
"ig":["Igbo","Igbo"],
|
||||
"ii":["Sichuan Yi","ꆇꉙ / 四川彝语"],
|
||||
"ik":["Inupiak","Iñupiak"],
|
||||
"io":["Ido","Ido"],
|
||||
"is":["Icelandic","Íslenska"],
|
||||
"it":["Italian","Italiano"],
|
||||
"iu":["Inuktitut","ᐃᓄᒃᑎᑐᑦ"],
|
||||
"ja":["Japanese","日本語"],
|
||||
"jv":["Javanese","Basa Jawa"],
|
||||
"ka":["Georgian","ქართული"],
|
||||
"kg":["Kongo","KiKongo"],
|
||||
"ki":["Kikuyu","Gĩkũyũ"],
|
||||
"kj":["Kuanyama","Kuanyama"],
|
||||
"kk":["Kazakh","Қазақша"],
|
||||
"kl":["Greenlandic","Kalaallisut"],
|
||||
"km":["Cambodian","ភាសាខ្មែរ"],
|
||||
"kn":["Kannada","ಕನ್ನಡ"],
|
||||
"ko":["Korean","한국어"],
|
||||
"kr":["Kanuri","Kanuri"],
|
||||
"ks":["Kashmiri","कश्मीरी / كشميري"],
|
||||
"ku":["Kurdish","Kurdî / كوردی"],
|
||||
"kv":["Komi","Коми"],
|
||||
"kw":["Cornish","Kernewek"],
|
||||
"ky":["Kirghiz","Kırgızca / Кыргызча"],
|
||||
"la":["Latin","Latina"],
|
||||
"lb":["Luxembourgish","Lëtzebuergesch"],
|
||||
"lg":["Ganda","Luganda"],
|
||||
"li":["Limburgian","Limburgs"],
|
||||
"ln":["Lingala","Lingála"],
|
||||
"lo":["Laotian","ລາວ / Pha xa lao"],
|
||||
"lt":["Lithuanian","Lietuvių"],
|
||||
"lv":["Latvian","Latviešu"],
|
||||
"mg":["Malagasy","Malagasy"],
|
||||
"mh":["Marshallese","Kajin Majel / Ebon"],
|
||||
"mi":["Maori","Māori"],
|
||||
"mk":["Macedonian","Македонски"],
|
||||
"ml":["Malayalam","മലയാളം"],
|
||||
"mn":["Mongolian","Монгол"],
|
||||
"mo":["Moldovan","Moldovenească"],
|
||||
"mr":["Marathi","मराठी"],
|
||||
"ms":["Malay","Bahasa Melayu"],
|
||||
"mt":["Maltese","bil-Malti"],
|
||||
"my":["Burmese","Myanmasa"],
|
||||
"na":["Nauruan","Dorerin Naoero"],
|
||||
"nd":["North Ndebele","Sindebele"],
|
||||
"ne":["Nepali","नेपाली"],
|
||||
"ng":["Ndonga","Oshiwambo"],
|
||||
"nl":["Dutch","Nederlands"],
|
||||
"nn":["Norwegian Nynorsk","Norsk (nynorsk)"],
|
||||
"no":["Norwegian","Norsk (bokmål / riksmål)"],
|
||||
"nr":["South Ndebele","isiNdebele"],
|
||||
"nv":["Navajo","Diné bizaad"],
|
||||
"ny":["Chichewa","Chi-Chewa"],
|
||||
"oc":["Occitan","Occitan"],
|
||||
"oj":["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ / Anishinaabemowin"],
|
||||
"om":["Oromo","Oromoo"],
|
||||
"or":["Oriya","ଓଡ଼ିଆ"],
|
||||
"os":["Ossetian / Ossetic","Иронау"],
|
||||
"pa":["Panjabi / Punjabi","ਪੰਜਾਬੀ / पंजाबी / پنجابي"],
|
||||
"pi":["Pali","Pāli / पाऴि"],
|
||||
"pl":["Polish","Polski"],
|
||||
"ps":["Pashto","پښتو"],
|
||||
"pt":["Portuguese","Português"],
|
||||
"qu":["Quechua","Runa Simi"],
|
||||
"rm":["Raeto Romance","Rumantsch"],
|
||||
"rn":["Kirundi","Kirundi"],
|
||||
"ro":["Romanian","Română"],
|
||||
"ru":["Russian","Русский"],
|
||||
"rw":["Rwandi","Kinyarwandi"],
|
||||
"sa":["Sanskrit","संस्कृतम्"],
|
||||
"sc":["Sardinian","Sardu"],
|
||||
"sd":["Sindhi","सिनधि"],
|
||||
"se":["Northern Sami","Sámegiella"],
|
||||
"sg":["Sango","Sängö"],
|
||||
"sh":["Serbo-Croatian","Srpskohrvatski / Српскохрватски"],
|
||||
"si":["Sinhalese","සිංහල"],
|
||||
"sk":["Slovak","Slovenčina"],
|
||||
"sl":["Slovenian","Slovenščina"],
|
||||
"sm":["Samoan","Gagana Samoa"],
|
||||
"sn":["Shona","chiShona"],
|
||||
"so":["Somalia","Soomaaliga"],
|
||||
"sq":["Albanian","Shqip"],
|
||||
"sr":["Serbian","Српски"],
|
||||
"ss":["Swati","SiSwati"],
|
||||
"st":["Southern Sotho","Sesotho"],
|
||||
"su":["Sundanese","Basa Sunda"],
|
||||
"sv":["Swedish","Svenska"],
|
||||
"sw":["Swahili","Kiswahili"],
|
||||
"ta":["Tamil","தமிழ்"],
|
||||
"te":["Telugu","తెలుగు"],
|
||||
"tg":["Tajik","Тоҷикӣ"],
|
||||
"th":["Thai","ไทย / Phasa Thai"],
|
||||
"ti":["Tigrinya","ትግርኛ"],
|
||||
"tk":["Turkmen","Туркмен / تركمن"],
|
||||
"tl":["Tagalog / Filipino","Tagalog"],
|
||||
"tn":["Tswana","Setswana"],
|
||||
"to":["Tonga","Lea Faka-Tonga"],
|
||||
"tr":["Turkish","Türkçe"],
|
||||
"ts":["Tsonga","Xitsonga"],
|
||||
"tt":["Tatar","Tatarça"],
|
||||
"tw":["Twi","Twi"],
|
||||
"ty":["Tahitian","Reo Mā`ohi"],
|
||||
"ug":["Uyghur","Uyƣurqə / ئۇيغۇرچە"],
|
||||
"uk":["Ukrainian","Українська"],
|
||||
"ur":["Urdu","اردو"],
|
||||
"uz":["Uzbek","Ўзбек"],
|
||||
"ve":["Venda","Tshivenḓa"],
|
||||
"vi":["Vietnamese","Tiếng Việt"],
|
||||
"vo":["Volapük","Volapük"],
|
||||
"wa":["Walloon","Walon"],
|
||||
"wo":["Wolof","Wollof"],
|
||||
"xh":["Xhosa","isiXhosa"],
|
||||
"yi":["Yiddish","ייִדיש"],
|
||||
"yo":["Yoruba","Yorùbá"],
|
||||
"za":["Zhuang","Cuengh / Tôô / 壮语"],
|
||||
"zh":["Chinese","中文"],
|
||||
"zu":["Zulu","isiZulu"]
|
||||
},
|
||||
"supported": [
|
||||
"en-US",
|
||||
"en-CA",
|
||||
"fr-QC",
|
||||
"ach-UG",
|
||||
"af-ZA",
|
||||
"ar-SA",
|
||||
"bg-BG",
|
||||
"ca-ES",
|
||||
"cs-CZ",
|
||||
"cy-GB",
|
||||
"de-DE",
|
||||
"de-AT",
|
||||
"de-CH",
|
||||
"da-DK",
|
||||
"el-GR",
|
||||
"en-GB",
|
||||
"en-AU",
|
||||
"en-HK",
|
||||
"en-IE",
|
||||
"en-NZ",
|
||||
"en-PR",
|
||||
"es-ES",
|
||||
"es-MX",
|
||||
"et-EE",
|
||||
"fi-FI",
|
||||
"fr-FR",
|
||||
"fr-CH",
|
||||
"fur-IT",
|
||||
"ga-IE",
|
||||
"gd-GB",
|
||||
"he-IL",
|
||||
"hr-HR",
|
||||
"hu-HU",
|
||||
"hy-AM",
|
||||
"id-ID",
|
||||
"it-CH",
|
||||
"it-IT",
|
||||
"ja-JP",
|
||||
"ka-GE",
|
||||
"ko-KR",
|
||||
"ky-KG",
|
||||
"lt-LT",
|
||||
"nb-NO",
|
||||
"nl-BE",
|
||||
"nl-NL",
|
||||
"pt-PT",
|
||||
"pt-BR",
|
||||
"pl-PL",
|
||||
"ro-RO",
|
||||
"ru-RU",
|
||||
"sco-GB",
|
||||
"sh-HR",
|
||||
"sk-SK",
|
||||
"sl-SI",
|
||||
"sr-SP",
|
||||
"sv-SE",
|
||||
"th-TH",
|
||||
"tr-TR",
|
||||
"uk-UA",
|
||||
"vi-VN",
|
||||
"zh-CN",
|
||||
"zh-HK",
|
||||
"zh-SG",
|
||||
"zh-TW"
|
||||
]
|
||||
}
|
||||
52
packages/server/lib/new-admin/config/index.js
Normal file
52
packages/server/lib/new-admin/config/index.js
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
const _ = require('lodash/fp')
|
||||
|
||||
const { CRYPTO_CURRENCIES } = require('@lamassu/coins')
|
||||
const { ACCOUNT_LIST: accounts } = require('./accounts')
|
||||
|
||||
const countries = require('./data/countries.json')
|
||||
const currenciesRec = require('./data/currencies.json')
|
||||
const languageRec = require('./data/languages.json')
|
||||
|
||||
function massageCurrencies (currencies) {
|
||||
const convert = r => ({
|
||||
code: r['Alphabetic Code'],
|
||||
display: r['Currency']
|
||||
})
|
||||
const top5Codes = ['USD', 'EUR', 'GBP', 'CAD', 'AUD']
|
||||
const mapped = _.map(convert, currencies)
|
||||
const codeToRec = code => _.find(_.matchesProperty('code', code), mapped)
|
||||
const top5 = _.map(codeToRec, top5Codes)
|
||||
const raw = _.uniqBy(_.get('code'), _.concat(top5, mapped))
|
||||
return raw.filter(r => r.code !== '' && r.display.indexOf('(') === -1)
|
||||
}
|
||||
|
||||
const mapLanguage = lang => {
|
||||
const arr = lang.split('-')
|
||||
const code = arr[0]
|
||||
const country = arr[1]
|
||||
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}]` }
|
||||
}
|
||||
|
||||
const massageCryptos = cryptos => {
|
||||
const betaList = ['LN']
|
||||
const convert = crypto => ({
|
||||
code: crypto['cryptoCode'],
|
||||
display: crypto['display'],
|
||||
codeDisplay: crypto['cryptoCodeDisplay'] ?? crypto['cryptoCode'],
|
||||
isBeta: betaList.includes(crypto.cryptoCode)
|
||||
})
|
||||
|
||||
return _.map(convert, cryptos)
|
||||
}
|
||||
|
||||
const supportedLanguages = languageRec.supported
|
||||
|
||||
const languages = supportedLanguages.map(mapLanguage).filter(r => r)
|
||||
const currencies = massageCurrencies(currenciesRec)
|
||||
const coins = massageCryptos(CRYPTO_CURRENCIES)
|
||||
|
||||
module.exports = { coins, accounts, countries, currencies, languages }
|
||||
Loading…
Add table
Add a link
Reference in a new issue