Skip to content

Commit

Permalink
re delegate gas fee fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SrikanthSoparla committed Nov 20, 2023
1 parent 0e123ff commit 5e898fc
Show file tree
Hide file tree
Showing 3 changed files with 14,077 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/containers/Home/TokenDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ReDelegateButton from './ReDelegateButton';
import ClaimButton from './ClaimButton';
// import Compound from './Compound';
import { config } from '../../../config';
import { gas } from '../../../defaultGasValues';
// import { gas } from '../../../defaultGasValues';

const TokenDetails = (props) => {
const staked = props.delegations && props.delegations.reduce((accumulator, currentValue) => {
Expand All @@ -33,13 +33,13 @@ const TokenDetails = (props) => {
return null;
});

const gasValue = (gas.claim_reward + gas.delegate) * config.GAS_PRICE_STEP_AVERAGE;
// const gasValue = (gas.claim_reward + gas.delegate) * config.GAS_PRICE_STEP_AVERAGE;
let rewards = props.rewards && props.rewards.total && props.rewards.total.length &&
props.rewards.total.find((val) => val.denom === config.COIN_MINIMAL_DENOM);
rewards = rewards && rewards.amount ? rewards.amount / 10 ** config.COIN_DECIMALS : 0;
let tokens = props.rewards && props.rewards.total && props.rewards.total.length &&
props.rewards.total.find((val) => val.amount > gasValue);
tokens = tokens && tokens.amount ? tokens.amount / 10 ** config.COIN_DECIMALS : 0;
// let tokens = props.rewards && props.rewards.total && props.rewards.total.length &&
// props.rewards.total.find((val) => val.amount > gasValue);
// tokens = tokens && tokens.amount ? tokens.amount / 10 ** config.COIN_DECIMALS : 0;

return (
<div className="token_details">
Expand Down
2 changes: 1 addition & 1 deletion src/defaultGasValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ export const gas = {
vote: 150000,
delegate: 350000,
un_delegate: 350000,
re_delegate: 500000,
re_delegate: 600000,
claim_reward: 300000,
};
Loading

0 comments on commit 5e898fc

Please sign in to comment.