transaction filters

This commit is contained in:
feruz 2019-12-09 21:35:25 +02:00
parent ed7a238b1e
commit c4e683a951
6 changed files with 42 additions and 3 deletions

View File

@ -65,6 +65,17 @@
"power_down": "Power Down", "power_down": "Power Down",
"withdraw_steem": "Withdraw Steem", "withdraw_steem": "Withdraw Steem",
"withdraw_sbd": "Withdraw Steem Dollar", "withdraw_sbd": "Withdraw Steem Dollar",
"transfer_to_savings": "Transfer To Savings",
"convert": "Convert",
"escrow_transfer": "Escrow Transfer",
"escrow_dispute": "Escrow Dispute",
"escrow_release": "Escrow Release",
"escrow_approve": "Escrow Approve",
"cancel_transfer_from_savings": "Cancel Transfer from Savings",
"delegate_vesting_shares": "Delegation",
"fill_convert_request": "Convert request executed",
"fill_transfer_from_savings": "From Savings executed",
"fill_vesting_withdraw": "Power Down executed",
"estm": { "estm": {
"title": "eSteem Points", "title": "eSteem Points",
"buy": "GET ESTM" "buy": "GET ESTM"

View File

@ -47,6 +47,7 @@ const WalletContainer = ({
const [steemBalance, setSteemBalance] = useState(0); const [steemBalance, setSteemBalance] = useState(0);
const [spBalance, setSpBalance] = useState(0); const [spBalance, setSpBalance] = useState(0);
const [steemSavingBalance, setSteemSavingBalance] = useState(0); const [steemSavingBalance, setSteemSavingBalance] = useState(0);
const [sbdSavingBalance, setSbdSavingBalance] = useState(0);
const [estimatedValue, setEstimatedValue] = useState(0); const [estimatedValue, setEstimatedValue] = useState(0);
const [estimatedSteemValue, setEstimatedSteemValue] = useState(0); const [estimatedSteemValue, setEstimatedSteemValue] = useState(0);
const [estimatedSbdValue, setEstimatedSbdValue] = useState(0); const [estimatedSbdValue, setEstimatedSbdValue] = useState(0);
@ -71,13 +72,30 @@ const WalletContainer = ({
useEffect(() => { useEffect(() => {
const _transferHistory = userActivities.filter( const _transferHistory = userActivities.filter(
item => get(item, 'textKey') === 'transfer' || get(item, 'textKey') === 'transfer_to_vesting', item =>
get(item, 'textKey') === 'transfer' ||
get(item, 'textKey') === 'transfer_to_vesting' ||
get(item, 'textKey') === 'transfer_to_savings' ||
get(item, 'textKey') === 'withdraw_vesting' ||
get(item, 'textKey') === 'transfer_from_savings' ||
get(item, 'textKey') === 'convert' ||
get(item, 'textKey') === 'escrow_transfer' ||
get(item, 'textKey') === 'escrow_dispute' ||
get(item, 'textKey') === 'escrow_release' ||
get(item, 'textKey') === 'escrow_approve' ||
get(item, 'textKey') === 'cancel_transfer_from_savings' ||
get(item, 'textKey') === 'delegate_vesting_shares' ||
get(item, 'textKey') === 'fill_convert_request' ||
get(item, 'textKey') === 'fill_transfer_from_savings' ||
get(item, 'textKey') === 'fill_vesting_withdraw' ||
get(item, 'textKey') === 'fill_order',
); );
setTransferHistory(_transferHistory); setTransferHistory(_transferHistory);
setSbdBalance(Math.round(get(walletData, 'sbdBalance', 0) * 1000) / 1000); setSbdBalance(Math.round(get(walletData, 'sbdBalance', 0) * 1000) / 1000);
setSteemBalance(Math.round(get(walletData, 'balance', 0) * 1000) / 1000); setSteemBalance(Math.round(get(walletData, 'balance', 0) * 1000) / 1000);
setSteemSavingBalance(Math.round(get(walletData, 'savingBalance', 0) * 1000) / 1000); setSteemSavingBalance(Math.round(get(walletData, 'savingBalance', 0) * 1000) / 1000);
setSbdSavingBalance(Math.round(get(walletData, 'savingBalanceSbd', 0) * 1000) / 1000);
setSpBalance( setSpBalance(
Math.round( Math.round(
vestsToSp(get(walletData, 'vestingShares', 0), get(walletData, 'steemPerMVests', 0)) * 1000, vestsToSp(get(walletData, 'vestingShares', 0), get(walletData, 'steemPerMVests', 0)) * 1000,
@ -258,6 +276,7 @@ const WalletContainer = ({
spBalance, spBalance,
sbdBalance, sbdBalance,
steemSavingBalance, steemSavingBalance,
sbdSavingBalance,
estimatedValue, estimatedValue,
estimatedSteemValue, estimatedSteemValue,
estimatedSbdValue, estimatedSbdValue,

View File

@ -127,7 +127,7 @@ class TransferContainer extends Component {
} }
data.amount = `${data.amount} ${fundType}`; data.amount = `${data.amount} ${fundType}`;
console.log(transferType);
switch (transferType) { switch (transferType) {
case 'transfer_token': case 'transfer_token':
func = transferToken; func = transferToken;
@ -138,7 +138,11 @@ class TransferContainer extends Component {
case 'powerUp': case 'powerUp':
func = transferToVesting; func = transferToVesting;
break; break;
case 'withdraw_to_saving': case 'withdraw_steem':
func = transferFromSavings;
data.requestId = new Date().getTime() >>> 0;
break;
case 'withdraw_sbd':
func = transferFromSavings; func = transferFromSavings;
data.requestId = new Date().getTime() >>> 0; data.requestId = new Date().getTime() >>> 0;
break; break;

View File

@ -116,3 +116,4 @@ const WalletScreen = () => {
}; };
export default WalletScreen; export default WalletScreen;
/* eslint-enable */

View File

@ -20,6 +20,8 @@ export const groomingTransactionData = (transaction, steemPerMVests, formatNumbe
result.created = timestamp; result.created = timestamp;
result.icon = 'local-activity'; result.icon = 'local-activity';
//TODO: Format other wallet related operations
switch (result.textKey) { switch (result.textKey) {
case 'curation_reward': case 'curation_reward':
const { reward } = opData; const { reward } = opData;
@ -81,6 +83,8 @@ export const groomingTransactionData = (transaction, steemPerMVests, formatNumbe
} ${rewardVests > 0 ? `${rewardVests} SP` : ''}`; } ${rewardVests > 0 ? `${rewardVests} SP` : ''}`;
break; break;
case 'transfer': case 'transfer':
case 'transfer_to_savings':
case 'transfer_from_savings':
case 'transfer_to_vesting': case 'transfer_to_vesting':
const { amount, memo, from, to } = opData; const { amount, memo, from, to } = opData;