Skip to content

Commit

Permalink
Merge pull request #311 from aura-nw/dev
Browse files Browse the repository at this point in the history
fix delegate
  • Loading branch information
hoangndm3139 authored Aug 24, 2023
2 parents 6327705 + 53ec85a commit 8433fe5
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 8433fe5

Please sign in to comment.