feat: add galoy config and UI safeguards
This commit is contained in:
parent
355434ced3
commit
12a7ed0bd6
6 changed files with 11 additions and 10 deletions
|
|
@ -153,7 +153,7 @@ const mapLanguage = lang => {
|
|||
|
||||
const supportedLanguages = languageRec.supported
|
||||
const languages = supportedLanguages.map(mapLanguage).filter(r => r)
|
||||
const ALL_CRYPTOS = ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH']
|
||||
const ALL_CRYPTOS = ['BTC', 'ETH', 'LTC', 'DASH', 'ZEC', 'BCH', 'LN']
|
||||
|
||||
const filterAccounts = (data, isDevMode) => {
|
||||
const notAllowed = ['mock-ticker', 'mock-wallet', 'mock-exchange', 'mock-sms', 'mock-id-verify', 'mock-zero-conf']
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ const _ = require('lodash/fp')
|
|||
|
||||
const { ALL } = require('../../plugins/common/ccxt')
|
||||
|
||||
const { BTC, BCH, DASH, ETH, LTC, USDT, ZEC, XMR, TRX, USDT_TRON } = COINS
|
||||
const { BTC, BCH, DASH, ETH, LTC, USDT, ZEC, XMR, LN, TRX, USDT_TRON } = COINS
|
||||
const { bitpay, coinbase, itbit, bitstamp, kraken, binanceus, cex, binance } = ALL
|
||||
|
||||
const TICKER = 'ticker'
|
||||
|
|
@ -37,6 +37,7 @@ const ALL_ACCOUNTS = [
|
|||
{ 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 },
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ const reflect = p => p.then(value => ({ value, status: 'fulfilled' }), error =>
|
|||
|
||||
function getFunding () {
|
||||
return settingsLoader.loadLatest().then(settings => {
|
||||
const cryptoCodes = configManager.getAllCryptoCurrencies(settings.config)
|
||||
const cryptoCodes = _.filter(code => coinUtils.getExternalCryptoCode(code) === code)(configManager.getAllCryptoCurrencies(settings.config))
|
||||
const fiatCode = configManager.getGlobalLocale(settings.config).fiatCurrency
|
||||
const pareCoins = c => _.includes(c.cryptoCode, cryptoCodes)
|
||||
const cryptoCurrencies = coinUtils.cryptoCurrencies()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
const BN = require('../../../bn')
|
||||
|
||||
const NAME = 'LN'
|
||||
const SUPPORTED_COINS = ['BTC']
|
||||
const SUPPORTED_COINS = ['LN']
|
||||
|
||||
function checkCryptoCode (cryptoCode) {
|
||||
if (!SUPPORTED_COINS.includes(cryptoCode)) {
|
||||
|
|
@ -23,7 +21,6 @@ function sendCoins (account, tx, settings, operatorId) {
|
|||
function balance (account, cryptoCode, settings, operatorId) {
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => getWallet(account, cryptoCode))
|
||||
.then(wallet => new BN(wallet._wallet.spendableBalanceString))
|
||||
}
|
||||
|
||||
function newAddress (account, info, tx, settings, operatorId) {
|
||||
|
|
@ -41,7 +38,7 @@ function newFunding (account, cryptoCode, settings, operatorId) {
|
|||
|
||||
function cryptoNetwork (account, cryptoCode, settings, operatorId) {
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => account.environment === 'test' ? 'test' : 'main')
|
||||
.then(() => {})
|
||||
}
|
||||
|
||||
function checkBlockchainStatus (cryptoCode) {
|
||||
|
|
@ -142,8 +142,9 @@ const Blacklist = () => {
|
|||
const classes = useStyles()
|
||||
|
||||
const blacklistData = R.path(['blacklist'])(blacklistResponse) ?? []
|
||||
const availableCurrencies =
|
||||
R.path(['cryptoCurrencies'], blacklistResponse) ?? []
|
||||
const availableCurrencies = R.filter(
|
||||
coin => coinUtils.getExternalCryptoCode(coin.code) === coin.code
|
||||
)(R.path(['cryptoCurrencies'], blacklistResponse) ?? [])
|
||||
|
||||
const formattedData = groupByCode(blacklistData)
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ const getLogo = code => {
|
|||
return MoneroLogo
|
||||
case 'TRX':
|
||||
return TronLogo
|
||||
case 'LN':
|
||||
return BitcoinLogo
|
||||
default:
|
||||
return null
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue