diff --git a/src/utils/vote.js b/src/utils/vote.js index 69d61b53f..ad5ff327f 100644 --- a/src/utils/vote.js +++ b/src/utils/vote.js @@ -2,7 +2,7 @@ import get from 'lodash/get'; import parseToken from './parseToken'; import { vestsToRshares } from './conversions'; -export const getEstimatedAmount = (account, globalProps, value = 100) => { +export const getEstimatedAmount = (account, globalProps, value = 1) => { const { fundRecentClaims, fundRewardBalance, base, quote } = globalProps; const votingPower = account.voting_power; const totalVests = diff --git a/src/utils/wallet.js b/src/utils/wallet.js index 3882f0773..19ec30712 100644 --- a/src/utils/wallet.js +++ b/src/utils/wallet.js @@ -221,14 +221,32 @@ export const groomingWalletData = async (user, globalProps, userCurrency) => { const timeDiff = Math.abs(parseDate(user.next_vesting_withdrawal) - new Date()); walletData.nextVestingWithdrawal = Math.round(timeDiff / (1000 * 3600)); - const { transfer_history: transferHistory } = get(accounts, user.name, []); - walletData.transactions = transferHistory - ? transferHistory.slice(Math.max(transferHistory.length - 20, 0)).reverse() + const { transfer_history: transferHistory, other_history: virtualHistory } = get( + accounts, + user.name, + [], + ); + const realHistory = transferHistory + ? transferHistory.slice(Math.max(transferHistory.length - 50, 0)) : []; + realHistory.push(...virtualHistory); //concat + realHistory.sort(compare); //sort desc + + walletData.transactions = realHistory; return walletData; }; +function compare(a, b) { + if (a[1].block < b[1].block) { + return 1; + } + if (a[1].block > b[1].block) { + return -1; + } + return 0; +} + export const groomingPointsTransactionData = transaction => { if (!transaction) { return null;