diff --git a/apps/explorer/src/components/top-validators-card/TopValidatorsCard.tsx b/apps/explorer/src/components/top-validators-card/TopValidatorsCard.tsx index d82b00bfe04d9..4b0e15ab9e692 100644 --- a/apps/explorer/src/components/top-validators-card/TopValidatorsCard.tsx +++ b/apps/explorer/src/components/top-validators-card/TopValidatorsCard.tsx @@ -20,18 +20,20 @@ import { PlaceholderTable } from '~/ui/PlaceholderTable'; import { TableCard } from '~/ui/TableCard'; import { Text } from '~/ui/Text'; import { getName } from '~/utils/getName'; -import { getStakedPercent } from '~/utils/getStakedPercent'; const NUMBER_OF_VALIDATORS = 10; -export function processValidators(set: ActiveValidator[], totalStake: bigint) { +export function processValidators(set: ActiveValidator[]) { return set.map((av) => { const rawName = av.fields.metadata.fields.name; + const delegatedStake = + +av.fields.delegation_staking_pool.fields.sui_balance; + const selfStake = +av.fields.stake_amount; + const totalValidatorStake = selfStake + delegatedStake; return { name: getName(rawName), address: av.fields.metadata.fields.sui_address, - stake: av.fields.stake_amount, - stakePercent: getStakedPercent(av.fields.stake_amount, totalStake), + stake: totalValidatorStake, logo: typeof av.fields.metadata.fields.image_url === 'string' ? av.fields.metadata.fields.image_url @@ -45,13 +47,8 @@ const validatorsTable = ( limit?: number, showIcon?: boolean ) => { - const totalStake = BigInt( - validatorsData.validators.fields.total_validator_stake - ); - const validators = processValidators( - validatorsData.validators.fields.active_validators, - totalStake + validatorsData.validators.fields.active_validators ).sort((a, b) => a.name.localeCompare(b.name, 'en', { sensitivity: 'base',