Skip to content

Commit

Permalink
feat: update queries for validators to handle all validators (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
akhlopiachyi committed May 28, 2024
1 parent 43e6d31 commit c43edbd
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 121 deletions.
2 changes: 1 addition & 1 deletion apps/web-coreum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-coreum",
"version": "2.19.3-104",
"version": "2.19.3-105",
"license": "Apache-2.0",
"private": true,
"scripts": {
Expand Down
120 changes: 66 additions & 54 deletions apps/web-coreum/src/graphql/types/general_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11890,7 +11890,10 @@ export type ValidatorUndelegationsQueryVariables = Exact<{

export type ValidatorUndelegationsQuery = { undelegations?: { __typename?: 'ActionUnbondingDelegationResponse', pagination?: any | null, undelegations?: Array<any | null> | null } | null };

export type ValidatorsQueryVariables = Exact<{ [key: string]: never; }>;
export type ValidatorsQueryVariables = Exact<{
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
}>;


export type ValidatorsQuery = { stakingPool: Array<{ __typename?: 'staking_pool', bondedTokens: any }>, validator: Array<{ __typename?: 'validator', validatorStatuses: Array<{ __typename?: 'validator_status', status: number, jailed: boolean, height: any }>, validatorSigningInfos: Array<{ __typename?: 'validator_signing_info', tombstoned: boolean, missedBlocksCounter: any }>, validatorInfo?: { __typename?: 'validator_info', operatorAddress: string, selfDelegateAddress?: string | null } | null, validatorVotingPowers: Array<{ __typename?: 'validator_voting_power', votingPower: any }>, validatorCommissions: Array<{ __typename?: 'validator_commission', commission: any }> }>, slashingParams: Array<{ __typename?: 'slashing_params', params: any }> };
Expand All @@ -11900,7 +11903,10 @@ export type ValidatorsAddressListQueryVariables = Exact<{ [key: string]: never;

export type ValidatorsAddressListQuery = { validator: Array<{ __typename?: 'validator', validatorInfo?: { __typename?: 'validator_info', operatorAddress: string, selfDelegateAddress?: string | null, consensusAddress: string } | null, validatorDescriptions: Array<{ __typename?: 'validator_description', moniker?: string | null, identity?: string | null, avatarUrl?: string | null }> }> };

export type ValidatorAddressesQueryVariables = Exact<{ [key: string]: never; }>;
export type ValidatorAddressesQueryVariables = Exact<{
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
}>;


export type ValidatorAddressesQuery = { validator: Array<{ __typename?: 'validator', validatorInfo?: { __typename?: 'validator_info', operatorAddress: string, selfDelegateAddress?: string | null, consensusAddress: string } | null, validatorDescriptions: Array<{ __typename?: 'validator_description', moniker?: string | null, avatarUrl?: string | null }> }> };
Expand Down Expand Up @@ -13574,49 +13580,52 @@ export type ValidatorUndelegationsQueryHookResult = ReturnType<typeof useValidat
export type ValidatorUndelegationsLazyQueryHookResult = ReturnType<typeof useValidatorUndelegationsLazyQuery>;
export type ValidatorUndelegationsQueryResult = Apollo.QueryResult<ValidatorUndelegationsQuery, ValidatorUndelegationsQueryVariables>;
export const ValidatorsDocument = gql`
query Validators {
stakingPool: staking_pool(limit: 1, order_by: {height: desc}) {
bondedTokens: bonded_tokens
}
validator {
validatorStatuses: validator_statuses(order_by: {height: desc}, limit: 1) {
status
jailed
height
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
tombstoned
}
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
query Validators($limit: Int = 100, $offset: Int = 0) {
stakingPool: staking_pool(limit: 1, order_by: {height: desc}) {
bondedTokens: bonded_tokens
}
validatorVotingPowers: validator_voting_powers(
offset: 0
limit: 1
order_by: {height: desc}
validator: validator(
limit: $limit
offset: $offset
) {
votingPower: voting_power
}
validatorCommissions: validator_commissions(order_by: {height: desc}, limit: 1) {
commission
validatorStatuses: validator_statuses(order_by: {height: desc}, limit: 1) {
status
jailed
height
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
tombstoned
}
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
}
validatorVotingPowers: validator_voting_powers(
offset: 0
limit: 1
order_by: {height: desc}
) {
votingPower: voting_power
}
validatorCommissions: validator_commissions(order_by: {height: desc}, limit: 1) {
commission
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
}
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
slashingParams: slashing_params(order_by: {height: desc}, limit: 1) {
params
}
}
slashingParams: slashing_params(order_by: {height: desc}, limit: 1) {
params
}
}
`;
`;

/**
* __useValidatorsQuery__
Expand Down Expand Up @@ -13691,23 +13700,26 @@ export type ValidatorsAddressListQueryHookResult = ReturnType<typeof useValidato
export type ValidatorsAddressListLazyQueryHookResult = ReturnType<typeof useValidatorsAddressListLazyQuery>;
export type ValidatorsAddressListQueryResult = Apollo.QueryResult<ValidatorsAddressListQuery, ValidatorsAddressListQueryVariables>;
export const ValidatorAddressesDocument = gql`
query ValidatorAddresses {
validator {
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
consensusAddress: consensus_address
}
validatorDescriptions: validator_descriptions(
limit: 1
order_by: {height: desc}
query ValidatorAddresses($limit: Int = 100, $offset: Int = 0) {
validator: validator(
limit: $limit
offset: $offset
) {
moniker
avatarUrl: avatar_url
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
consensusAddress: consensus_address
}
validatorDescriptions: validator_descriptions(
limit: 1
order_by: {height: desc}
) {
moniker
avatarUrl: avatar_url
}
}
}
}
`;
`;

/**
* __useValidatorAddressesQuery__
Expand Down
124 changes: 69 additions & 55 deletions packages/ui/src/graphql/types/general_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11892,7 +11892,10 @@ export type ValidatorUndelegationsQueryVariables = Exact<{

export type ValidatorUndelegationsQuery = { undelegations?: { __typename?: 'ActionUnbondingDelegationResponse', pagination?: any | null, undelegations?: Array<any | null> | null } | null };

export type ValidatorsQueryVariables = Exact<{ [key: string]: never; }>;
export type ValidatorsQueryVariables = Exact<{
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
}>;


export type ValidatorsQuery = { stakingPool: Array<{ __typename?: 'staking_pool', bondedTokens: any }>, validator: Array<{ __typename?: 'validator', validatorStatuses: Array<{ __typename?: 'validator_status', status: number, jailed: boolean, height: any }>, validatorSigningInfos: Array<{ __typename?: 'validator_signing_info', tombstoned: boolean, missedBlocksCounter: any }>, validatorInfo?: { __typename?: 'validator_info', operatorAddress: string, selfDelegateAddress?: string | null } | null, validatorVotingPowers: Array<{ __typename?: 'validator_voting_power', votingPower: any }>, validatorCommissions: Array<{ __typename?: 'validator_commission', commission: any }> }>, slashingParams: Array<{ __typename?: 'slashing_params', params: any }> };
Expand All @@ -11902,7 +11905,10 @@ export type ValidatorsAddressListQueryVariables = Exact<{ [key: string]: never;

export type ValidatorsAddressListQuery = { validator: Array<{ __typename?: 'validator', validatorInfo?: { __typename?: 'validator_info', operatorAddress: string, selfDelegateAddress?: string | null, consensusAddress: string } | null, validatorDescriptions: Array<{ __typename?: 'validator_description', moniker?: string | null, identity?: string | null, avatarUrl?: string | null }> }> };

export type ValidatorAddressesQueryVariables = Exact<{ [key: string]: never; }>;
export type ValidatorAddressesQueryVariables = Exact<{
limit?: InputMaybe<Scalars['Int']>;
offset?: InputMaybe<Scalars['Int']>;
}>;


export type ValidatorAddressesQuery = { validator: Array<{ __typename?: 'validator', validatorInfo?: { __typename?: 'validator_info', operatorAddress: string, selfDelegateAddress?: string | null, consensusAddress: string } | null, validatorDescriptions: Array<{ __typename?: 'validator_description', moniker?: string | null, identity?: string | null, avatarUrl?: string | null }> }> };
Expand Down Expand Up @@ -13562,53 +13568,58 @@ export function useValidatorUndelegationsLazyQuery(baseOptions?: Apollo.LazyQuer
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<ValidatorUndelegationsQuery, ValidatorUndelegationsQueryVariables>(ValidatorUndelegationsDocument, options);
}

export type ValidatorUndelegationsQueryHookResult = ReturnType<typeof useValidatorUndelegationsQuery>;
export type ValidatorUndelegationsLazyQueryHookResult = ReturnType<typeof useValidatorUndelegationsLazyQuery>;
export type ValidatorUndelegationsQueryResult = Apollo.QueryResult<ValidatorUndelegationsQuery, ValidatorUndelegationsQueryVariables>;

export const ValidatorsDocument = gql`
query Validators {
stakingPool: staking_pool(limit: 1, order_by: {height: desc}) {
bondedTokens: bonded_tokens
}
validator {
validatorStatuses: validator_statuses(order_by: {height: desc}, limit: 1) {
status
jailed
height
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
tombstoned
}
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
query Validators($limit: Int = 100, $offset: Int = 0) {
stakingPool: staking_pool(limit: 1, order_by: {height: desc}) {
bondedTokens: bonded_tokens
}
validatorVotingPowers: validator_voting_powers(
offset: 0
limit: 1
order_by: {height: desc}
validator: validator(
limit: $limit
offset: $offset
) {
votingPower: voting_power
}
validatorCommissions: validator_commissions(order_by: {height: desc}, limit: 1) {
commission
validatorStatuses: validator_statuses(order_by: {height: desc}, limit: 1) {
status
jailed
height
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
tombstoned
}
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
}
validatorVotingPowers: validator_voting_powers(
offset: 0
limit: 1
order_by: {height: desc}
) {
votingPower: voting_power
}
validatorCommissions: validator_commissions(order_by: {height: desc}, limit: 1) {
commission
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
}
}
validatorSigningInfos: validator_signing_infos(
order_by: {height: desc}
limit: 1
) {
missedBlocksCounter: missed_blocks_counter
slashingParams: slashing_params(order_by: {height: desc}, limit: 1) {
params
}
}
slashingParams: slashing_params(order_by: {height: desc}, limit: 1) {
params
}
}
`;
`;

/**
* __useValidatorsQuery__
Expand Down Expand Up @@ -13683,24 +13694,27 @@ export type ValidatorsAddressListQueryHookResult = ReturnType<typeof useValidato
export type ValidatorsAddressListLazyQueryHookResult = ReturnType<typeof useValidatorsAddressListLazyQuery>;
export type ValidatorsAddressListQueryResult = Apollo.QueryResult<ValidatorsAddressListQuery, ValidatorsAddressListQueryVariables>;
export const ValidatorAddressesDocument = gql`
query ValidatorAddresses {
validator {
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
consensusAddress: consensus_address
}
validatorDescriptions: validator_descriptions(
limit: 1
order_by: {height: desc}
query ValidatorAddresses($limit: Int = 100, $offset: Int = 0) {
validator: validator(
limit: $limit
offset: $offset
) {
moniker
identity
avatarUrl: avatar_url
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
consensusAddress: consensus_address
}
validatorDescriptions: validator_descriptions(
limit: 1
order_by: {height: desc}
) {
moniker
identity
avatarUrl: avatar_url
}
}
}
}
`;
`;

/**
* __useValidatorAddressesQuery__
Expand Down
Loading

0 comments on commit c43edbd

Please sign in to comment.