UNPKG

burst-whale-watch

Version:

An account watcher for Burstcoin

34 lines 1.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selectCurrentAccountIndex = (state) => state.app.currentAccountIndex; exports.selectGetAccountBalances = (state) => state.balances.accounts; exports.selectGetTotalBalance = (state) => state.balances.total.toFixed(3); exports.selectIsLoadingBalances = (state) => state.balances.isLoading; exports.selectGetAccountTransactions = (state) => state.transactions.accounts; exports.selectIsLoadingTransactions = (state) => state.transactions.isLoading; exports.selectGetUsdBurst = (state) => Number.parseFloat(state.market.price_usd).toFixed(3); exports.selectGetBtcBurst = (state) => state.market.price_btc; exports.selectGetBtcBurstChange = (state) => Number.parseFloat(state.market.percent_change_24h).toFixed(4); exports.selectIsLoadingMarketInfo = (state) => state.market.isLoading; exports.selectInfoSourceName = (state) => state.market.name; exports.selectGetBalanceInBtc = (state) => { if (exports.selectIsLoadingMarketInfo(state) || exports.selectIsLoadingBalances(state)) { return null; } const totalBurstString = exports.selectGetTotalBalance(state); const totalBurst = Number.parseFloat(totalBurstString); const btcBurst = Number.parseFloat(exports.selectGetBtcBurst(state)); return (totalBurst * btcBurst).toFixed(4); }; exports.selectGetBalanceInUsd = (state) => { if (exports.selectIsLoadingMarketInfo(state) || exports.selectIsLoadingBalances(state)) { return null; } const totalBurstString = exports.selectGetTotalBalance(state); const totalBurst = Number.parseFloat(totalBurstString); const usdBurst = Number.parseFloat(exports.selectGetUsdBurst(state)); return (totalBurst * usdBurst).toFixed(4); }; //# sourceMappingURL=selectors.js.map