Skip to content

Commit

Permalink
fix delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
HoangNDM6 committed Aug 24, 2023
1 parent e03f43d commit 53ec85a
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/pages/Staking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,19 @@ function Staking(props): ReactElement {
setDataDelegateOfUser(null)

const validatorsRes: any = await getAllValidators()
const validator = validatorsRes.validator
.map((val) => ({
commission: val.commission.commission_rates.rate * 100,
delegators: val.delegators_count,
operatorAddress: val.operator_address,
votingPower: {
percent_voting_power: val.percent_voting_power,
tokens: {
amount: val.tokens,
denom: nativeCurrency.symbol,
},
const validatorItem = validatorsRes.validator.find((item) => item.operator_address === address)
const validator = {
commission: validatorItem.commission.commission_rates.rate * 100,
delegators: validatorItem.delegators_count,
operatorAddress: validatorItem.operator_address,
votingPower: {
percent_voting_power: validatorItem.percent_voting_power,
tokens: {
amount: validatorItem.tokens,
denom: nativeCurrency.symbol,
},
}))
?.find((item) => item.operatorAddress === address)
},
}

const delegation = {
claimedReward: {
Expand Down

0 comments on commit 53ec85a

Please sign in to comment.