diff --git a/explorer/gql/types/staking.ts b/explorer/gql/types/staking.ts index 9dbc6891e..b9c733b4c 100644 --- a/explorer/gql/types/staking.ts +++ b/explorer/gql/types/staking.ts @@ -5159,7 +5159,7 @@ export type OperatorByIdQueryVariables = Exact<{ }>; -export type OperatorByIdQuery = { __typename?: 'query_root', operator_by_pk?: { __typename?: 'operator', id: string, account_id: string, domain_id: string, current_epoch_rewards: any, current_total_stake: any, current_total_shares: any, minimum_nominator_stake: any, nomination_tax: number, signing_key: string, status: string, raw_status?: string | null, updated_at?: number | null, domain?: { __typename?: 'domain', id: string, sort_id: number } | null } | null }; +export type OperatorByIdQuery = { __typename?: 'query_root', operator_by_pk?: { __typename?: 'operator', id: string, account_id: string, domain_id: string, bundle_count: number, current_epoch_rewards: any, current_total_stake: any, current_total_shares: any, current_storage_fee_deposit: any, minimum_nominator_stake: any, total_rewards_collected: any, total_consensus_storage_fee: any, total_domain_execution_fee: any, total_burned_balance: any, total_tax_collected: any, nomination_tax: number, signing_key: string, status: string, raw_status?: string | null, last_bundle_at: number, updated_at?: number | null, domain?: { __typename?: 'domain', id: string, sort_id: number } | null, nominators_aggregate: { __typename?: 'nominator_aggregate', aggregate?: { __typename?: 'nominator_aggregate_fields', count: number } | null }, deposits_aggregate: { __typename?: 'deposit_aggregate', aggregate?: { __typename?: 'deposit_aggregate_fields', count: number } | null }, withdrawals_aggregate: { __typename?: 'withdrawal_aggregate', aggregate?: { __typename?: 'withdrawal_aggregate_fields', count: number } | null } } | null }; export type OperatorNominatorsByIdQueryVariables = Exact<{ limit: Scalars['Int']['input']; diff --git a/explorer/src/components/Staking/Operator.tsx b/explorer/src/components/Staking/Operator.tsx index 7565fdcee..8d54b01a1 100644 --- a/explorer/src/components/Staking/Operator.tsx +++ b/explorer/src/components/Staking/Operator.tsx @@ -1,10 +1,10 @@ 'use client' -import { useConsensusData } from '@/hooks/useConsensusData' import { Spinner } from 'components/common/Spinner' import { NotFound } from 'components/layout/NotFound' import { Routes } from 'constants/routes' import type { OperatorByIdQuery, OperatorByIdQueryVariables } from 'gql/types/staking' +import { useConsensusData } from 'hooks/useConsensusData' import useMediaQuery from 'hooks/useMediaQuery' import { useSquidQuery } from 'hooks/useSquidQuery' import { useWindowFocus } from 'hooks/useWindowFocus' diff --git a/explorer/src/components/Staking/OperatorDetailsCard.tsx b/explorer/src/components/Staking/OperatorDetailsCard.tsx index 596fbfb60..1c339cfe5 100644 --- a/explorer/src/components/Staking/OperatorDetailsCard.tsx +++ b/explorer/src/components/Staking/OperatorDetailsCard.tsx @@ -9,7 +9,7 @@ import useChains from 'hooks/useChains' import useMediaQuery from 'hooks/useMediaQuery' import Link from 'next/link' import { FC } from 'react' -import { bigNumberToNumber } from 'utils/number' +import { bigNumberToFormattedString } from 'utils/number' import { operatorStatus } from 'utils/operator' import { capitalizeFirstLetter, shortString } from 'utils/string' import { AccountIcon } from '../common/AccountIcon' @@ -69,11 +69,57 @@ export const OperatorDetailsCard: FC = ({ operator, isDesktop = false }) - {bigNumberToNumber(operator.minimum_nominator_stake)} {TOKEN.symbol} + {bigNumberToFormattedString(operator.minimum_nominator_stake)} {TOKEN.symbol} {operator.nomination_tax} % - - {bigNumberToNumber(operator.current_total_stake)} {TOKEN.symbol} + {operator.bundle_count} + + +
#{operator.last_bundle_at}
+ +
+ + {bigNumberToFormattedString(operator.current_total_stake)} {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.current_storage_fee_deposit)} {TOKEN.symbol} + + + {bigNumberToFormattedString( + BigInt(operator.current_total_stake) + BigInt(operator.current_storage_fee_deposit), + )}{' '} + {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.total_rewards_collected)} {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.total_consensus_storage_fee)} {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.total_domain_execution_fee)} {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.total_burned_balance)} {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.total_tax_collected)} {TOKEN.symbol} + + + {bigNumberToFormattedString(operator.nominators_aggregate.aggregate?.count ?? '0')} + + + {bigNumberToFormattedString(operator.deposits_aggregate.aggregate?.count ?? '0')} + + + {bigNumberToFormattedString(operator.withdrawals_aggregate.aggregate?.count ?? '0')} {capitalizeFirstLetter(operatorStatus(operator.raw_status))} diff --git a/explorer/src/components/Staking/staking.query.ts b/explorer/src/components/Staking/staking.query.ts index 6fd1ae53a..d6b7e57ae 100644 --- a/explorer/src/components/Staking/staking.query.ts +++ b/explorer/src/components/Staking/staking.query.ts @@ -54,15 +54,38 @@ export const QUERY_OPERATOR_BY_ID = gql` id sort_id } + bundle_count current_epoch_rewards current_total_stake current_total_shares + current_storage_fee_deposit minimum_nominator_stake + total_rewards_collected + total_consensus_storage_fee + total_domain_execution_fee + total_burned_balance + total_tax_collected nomination_tax signing_key status raw_status + last_bundle_at updated_at + nominators_aggregate { + aggregate { + count + } + } + deposits_aggregate { + aggregate { + count + } + } + withdrawals_aggregate { + aggregate { + count + } + } } } `