chore: replace imports to point to lamassu-coins module
This commit is contained in:
parent
70495deb67
commit
3423e2ddd0
30 changed files with 230 additions and 175 deletions
|
|
@ -1,7 +1,7 @@
|
|||
const { COINS, ALL_CRYPTOS } = require('lamassu-coins')
|
||||
const _ = require('lodash/fp')
|
||||
|
||||
const { ALL } = require('../../plugins/common/ccxt')
|
||||
const { COINS, ALL_CRYPTOS } = require('./coins')
|
||||
|
||||
const { BTC, BCH, DASH, ETH, LTC, ZEC } = COINS
|
||||
const { bitpay, coinbase, itbit, bitstamp, kraken } = ALL
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
const _ = require('lodash/fp')
|
||||
|
||||
const { COIN_LIST: coins } = require('./coins')
|
||||
const { COIN_LIST: coins } = require('lamassu-coins')
|
||||
// const { COIN_LIST: coins } = require('./coins')
|
||||
const { ACCOUNT_LIST: accounts } = require('./accounts')
|
||||
|
||||
const countries = require('../../../data/countries.json')
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@ const settingsLoader = require('../../new-settings-loader')
|
|||
const configManager = require('../../new-config-manager')
|
||||
const wallet = require('../../wallet')
|
||||
const ticker = require('../../ticker')
|
||||
const coinUtils = require('../../coin-utils')
|
||||
const { utils } = require('lamassu-coins')
|
||||
|
||||
function computeCrypto (cryptoCode, _balance) {
|
||||
const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode)
|
||||
const cryptoRec = utils.getCryptoCurrency(cryptoCode)
|
||||
const unitScale = cryptoRec.unitScale
|
||||
|
||||
return BN(_balance).shift(-unitScale).round(5)
|
||||
}
|
||||
|
||||
function computeFiat (rate, cryptoCode, _balance) {
|
||||
const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode)
|
||||
const cryptoRec = utils.getCryptoCurrency(cryptoCode)
|
||||
const unitScale = cryptoRec.unitScale
|
||||
|
||||
return BN(_balance).shift(-unitScale).mul(rate).round(5)
|
||||
|
|
@ -35,7 +35,7 @@ function getSingleCoinFunding (settings, fiatCode, cryptoCode) {
|
|||
const pending = fundingRec.fundingPendingBalance
|
||||
const fiatPending = computeFiat(rate, cryptoCode, pending)
|
||||
const fundingAddress = fundingRec.fundingAddress
|
||||
const fundingAddressUrl = coinUtils.buildUrl(cryptoCode, fundingAddress)
|
||||
const fundingAddressUrl = utils.buildUrl(cryptoCode, fundingAddress)
|
||||
|
||||
return {
|
||||
cryptoCode,
|
||||
|
|
@ -58,7 +58,7 @@ function getFunding () {
|
|||
const cryptoCodes = configManager.getAllCryptoCurrencies(settings.config)
|
||||
const fiatCode = configManager.getGlobalLocale(settings.config).fiatCurrency
|
||||
const pareCoins = c => _.includes(c.cryptoCode, cryptoCodes)
|
||||
const cryptoCurrencies = coinUtils.cryptoCurrencies()
|
||||
const cryptoCurrencies = utils.cryptoCurrencies()
|
||||
const cryptoDisplays = _.filter(pareCoins, cryptoCurrencies)
|
||||
|
||||
const promises = cryptoDisplays.map(it => getSingleCoinFunding(settings, fiatCode, it.cryptoCode))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue