diff --git a/lib/admin/config.js b/lib/admin/config.js index b669d0be..4ad3c96d 100644 --- a/lib/admin/config.js +++ b/lib/admin/config.js @@ -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'] diff --git a/lib/new-admin/config/accounts.js b/lib/new-admin/config/accounts.js index 05ab6089..199b96bc 100644 --- a/lib/new-admin/config/accounts.js +++ b/lib/new-admin/config/accounts.js @@ -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 }, diff --git a/lib/new-admin/services/funding.js b/lib/new-admin/services/funding.js index 5b425d82..8f748696 100644 --- a/lib/new-admin/services/funding.js +++ b/lib/new-admin/services/funding.js @@ -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() diff --git a/lib/plugins/wallet/lightning/galoy.js b/lib/plugins/wallet/galoy/galoy.js similarity index 86% rename from lib/plugins/wallet/lightning/galoy.js rename to lib/plugins/wallet/galoy/galoy.js index 459675df..49c849c5 100644 --- a/lib/plugins/wallet/lightning/galoy.js +++ b/lib/plugins/wallet/galoy/galoy.js @@ -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) { diff --git a/new-lamassu-admin/src/pages/Blacklist/Blacklist.js b/new-lamassu-admin/src/pages/Blacklist/Blacklist.js index e0ac4f42..a7d6e0a9 100644 --- a/new-lamassu-admin/src/pages/Blacklist/Blacklist.js +++ b/new-lamassu-admin/src/pages/Blacklist/Blacklist.js @@ -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) diff --git a/new-lamassu-admin/src/pages/Wallet/WizardSplash.js b/new-lamassu-admin/src/pages/Wallet/WizardSplash.js index 48692da2..925cbdf2 100644 --- a/new-lamassu-admin/src/pages/Wallet/WizardSplash.js +++ b/new-lamassu-admin/src/pages/Wallet/WizardSplash.js @@ -60,6 +60,8 @@ const getLogo = code => { return MoneroLogo case 'TRX': return TronLogo + case 'LN': + return BitcoinLogo default: return null }