diff --git a/explorer/gql/graphql.tsx b/explorer/gql/graphql.tsx index 56db3a1b1..b5597974f 100644 --- a/explorer/gql/graphql.tsx +++ b/explorer/gql/graphql.tsx @@ -19,6 +19,7 @@ export type Scalars = { jsonb: { input: any; output: any; } numeric: { input: any; output: any; } timestamp: { input: any; output: any; } + timestamptz: { input: any; output: any; } uuid: { input: any; output: any; } }; @@ -10581,14 +10582,10 @@ export type Query_Root = { staking_deposits_by_pk?: Maybe; /** fetch data from the table: "staking.domain_block_histories" */ staking_domain_block_histories: Array; - /** fetch data from the table: "staking.domain_blocks" */ - staking_domain_blocks: Array; - /** fetch data from the table: "staking.domain_blocks" using primary key columns */ - staking_domain_blocks_by_pk?: Maybe; - /** fetch data from the table: "staking.domain_epoches" */ - staking_domain_epoches: Array; - /** fetch data from the table: "staking.domain_epoches" using primary key columns */ - staking_domain_epoches_by_pk?: Maybe; + /** fetch data from the table: "staking.domain_epochs" */ + staking_domain_epochs: Array; + /** fetch data from the table: "staking.domain_epochs" using primary key columns */ + staking_domain_epochs_by_pk?: Maybe; /** fetch data from the table: "staking.domain_instantiations" */ staking_domain_instantiations: Array; /** fetch data from the table: "staking.domain_instantiations" using primary key columns */ @@ -10609,6 +10606,10 @@ export type Query_Root = { staking_nominators_aggregate: Staking_Nominators_Aggregate; /** fetch data from the table: "staking.nominators" using primary key columns */ staking_nominators_by_pk?: Maybe; + /** fetch data from the table: "staking.operator_deregistrations" */ + staking_operator_deregistrations: Array; + /** fetch data from the table: "staking.operator_deregistrations" using primary key columns */ + staking_operator_deregistrations_by_pk?: Maybe; /** fetch data from the table: "staking.operator_registrations" */ staking_operator_registrations: Array; /** fetch data from the table: "staking.operator_registrations" using primary key columns */ @@ -10621,6 +10622,10 @@ export type Query_Root = { staking_operator_staking_histories: Array; /** fetch data from the table: "staking.operator_staking_histories" using primary key columns */ staking_operator_staking_histories_by_pk?: Maybe; + /** fetch data from the table: "staking.operator_tax_collections" */ + staking_operator_tax_collections: Array; + /** fetch data from the table: "staking.operator_tax_collections" using primary key columns */ + staking_operator_tax_collections_by_pk?: Maybe; /** fetch data from the table: "staking.operators" */ staking_operators: Array; /** fetch aggregated fields from the table: "staking.operators" */ @@ -10631,6 +10636,14 @@ export type Query_Root = { staking_runtime_creations: Array; /** fetch data from the table: "staking.runtime_creations" using primary key columns */ staking_runtime_creations_by_pk?: Maybe; + /** fetch data from the table: "staking.staked_unlocked_events" */ + staking_staked_unlocked_events: Array; + /** fetch data from the table: "staking.staked_unlocked_events" using primary key columns */ + staking_staked_unlocked_events_by_pk?: Maybe; + /** fetch data from the table: "staking.withdraw_events" */ + staking_withdraw_events: Array; + /** fetch data from the table: "staking.withdraw_events" using primary key columns */ + staking_withdraw_events_by_pk?: Maybe; /** fetch data from the table: "staking.withdrawal_histories" */ staking_withdrawal_histories: Array; /** fetch data from the table: "staking.withdrawal_histories" using primary key columns */ @@ -11877,30 +11890,16 @@ export type Query_RootStaking_Domain_Block_HistoriesArgs = { }; -export type Query_RootStaking_Domain_BlocksArgs = { - distinct_on?: InputMaybe>; +export type Query_RootStaking_Domain_EpochsArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Query_RootStaking_Domain_Blocks_By_PkArgs = { - id: Scalars['String']['input']; -}; - - -export type Query_RootStaking_Domain_EpochesArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootStaking_Domain_Epoches_By_PkArgs = { +export type Query_RootStaking_Domain_Epochs_By_PkArgs = { id: Scalars['String']['input']; }; @@ -11979,6 +11978,20 @@ export type Query_RootStaking_Nominators_By_PkArgs = { }; +export type Query_RootStaking_Operator_DeregistrationsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootStaking_Operator_Deregistrations_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + export type Query_RootStaking_Operator_RegistrationsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -12021,6 +12034,20 @@ export type Query_RootStaking_Operator_Staking_Histories_By_PkArgs = { }; +export type Query_RootStaking_Operator_Tax_CollectionsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootStaking_Operator_Tax_Collections_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + export type Query_RootStaking_OperatorsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -12058,6 +12085,34 @@ export type Query_RootStaking_Runtime_Creations_By_PkArgs = { }; +export type Query_RootStaking_Staked_Unlocked_EventsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootStaking_Staked_Unlocked_Events_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + +export type Query_RootStaking_Withdraw_EventsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootStaking_Withdraw_Events_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + export type Query_RootStaking_Withdrawal_HistoriesArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -12737,7 +12792,7 @@ export type Staking_Deposit_Events = { operator_id: Scalars['String']['output']; sort_id: Scalars['String']['output']; storage_fee_deposit: Scalars['numeric']['output']; - timestamp: Scalars['timestamp']['output']; + timestamp: Scalars['timestamptz']['output']; total_amount: Scalars['numeric']['output']; uuid: Scalars['uuid']['output']; }; @@ -12759,7 +12814,7 @@ export type Staking_Deposit_Events_Bool_Exp = { operator_id?: InputMaybe; sort_id?: InputMaybe; storage_fee_deposit?: InputMaybe; - timestamp?: InputMaybe; + timestamp?: InputMaybe; total_amount?: InputMaybe; uuid?: InputMaybe; }; @@ -12839,7 +12894,7 @@ export type Staking_Deposit_Events_Stream_Cursor_Value_Input = { operator_id?: InputMaybe; sort_id?: InputMaybe; storage_fee_deposit?: InputMaybe; - timestamp?: InputMaybe; + timestamp?: InputMaybe; total_amount?: InputMaybe; uuid?: InputMaybe; }; @@ -12985,7 +13040,7 @@ export type Staking_Deposits = { operator_id: Scalars['String']['output']; status: Scalars['String']['output']; storage_fee_deposit: Scalars['numeric']['output']; - timestamp: Scalars['timestamp']['output']; + timestamp: Scalars['timestamptz']['output']; total_amount: Scalars['numeric']['output']; total_withdrawn: Scalars['numeric']['output']; updated_at: Scalars['numeric']['output']; @@ -13086,7 +13141,7 @@ export type Staking_Deposits_Bool_Exp = { operator_id?: InputMaybe; status?: InputMaybe; storage_fee_deposit?: InputMaybe; - timestamp?: InputMaybe; + timestamp?: InputMaybe; total_amount?: InputMaybe; total_withdrawn?: InputMaybe; updated_at?: InputMaybe; @@ -13105,7 +13160,7 @@ export type Staking_Deposits_Max_Fields = { operator_id?: Maybe; status?: Maybe; storage_fee_deposit?: Maybe; - timestamp?: Maybe; + timestamp?: Maybe; total_amount?: Maybe; total_withdrawn?: Maybe; updated_at?: Maybe; @@ -13142,7 +13197,7 @@ export type Staking_Deposits_Min_Fields = { operator_id?: Maybe; status?: Maybe; storage_fee_deposit?: Maybe; - timestamp?: Maybe; + timestamp?: Maybe; total_amount?: Maybe; total_withdrawn?: Maybe; updated_at?: Maybe; @@ -13302,7 +13357,7 @@ export type Staking_Deposits_Stream_Cursor_Value_Input = { operator_id?: InputMaybe; status?: InputMaybe; storage_fee_deposit?: InputMaybe; - timestamp?: InputMaybe; + timestamp?: InputMaybe; total_amount?: InputMaybe; total_withdrawn?: InputMaybe; updated_at?: InputMaybe; @@ -13400,6 +13455,7 @@ export type Staking_Domain_Block_Histories = { domain_block_number: Scalars['numeric']['output']; domain_id: Scalars['String']['output']; id: Scalars['String']['output']; + timestamp: Scalars['timestamptz']['output']; uuid: Scalars['uuid']['output']; }; @@ -13413,6 +13469,7 @@ export type Staking_Domain_Block_Histories_Bool_Exp = { domain_block_number?: InputMaybe; domain_id?: InputMaybe; id?: InputMaybe; + timestamp?: InputMaybe; uuid?: InputMaybe; }; @@ -13423,6 +13480,7 @@ export type Staking_Domain_Block_Histories_Order_By = { domain_block_number?: InputMaybe; domain_id?: InputMaybe; id?: InputMaybe; + timestamp?: InputMaybe; uuid?: InputMaybe; }; @@ -13439,6 +13497,8 @@ export enum Staking_Domain_Block_Histories_Select_Column { /** column name */ Id = 'id', /** column name */ + Timestamp = 'timestamp', + /** column name */ Uuid = 'uuid' } @@ -13457,124 +13517,20 @@ export type Staking_Domain_Block_Histories_Stream_Cursor_Value_Input = { domain_block_number?: InputMaybe; domain_id?: InputMaybe; id?: InputMaybe; + timestamp?: InputMaybe; uuid?: InputMaybe; }; -/** columns and relationships of "staking.domain_blocks" */ -export type Staking_Domain_Blocks = { - __typename?: 'staking_domain_blocks'; - block_hash: Scalars['String']['output']; - block_number: Scalars['numeric']['output']; - consensus_block_hash: Scalars['String']['output']; - consensus_block_number: Scalars['numeric']['output']; - created_at: Scalars['numeric']['output']; - domain_epoch_id: Scalars['String']['output']; - domain_id: Scalars['String']['output']; - epoch: Scalars['numeric']['output']; - extrinsic_root: Scalars['String']['output']; - id: Scalars['String']['output']; - timestamp: Scalars['timestamp']['output']; - updated_at: Scalars['numeric']['output']; -}; - -/** Boolean expression to filter rows from the table "staking.domain_blocks". All fields are combined with a logical 'AND'. */ -export type Staking_Domain_Blocks_Bool_Exp = { - _and?: InputMaybe>; - _not?: InputMaybe; - _or?: InputMaybe>; - block_hash?: InputMaybe; - block_number?: InputMaybe; - consensus_block_hash?: InputMaybe; - consensus_block_number?: InputMaybe; - created_at?: InputMaybe; - domain_epoch_id?: InputMaybe; - domain_id?: InputMaybe; - epoch?: InputMaybe; - extrinsic_root?: InputMaybe; - id?: InputMaybe; - timestamp?: InputMaybe; - updated_at?: InputMaybe; -}; - -/** Ordering options when selecting data from "staking.domain_blocks". */ -export type Staking_Domain_Blocks_Order_By = { - block_hash?: InputMaybe; - block_number?: InputMaybe; - consensus_block_hash?: InputMaybe; - consensus_block_number?: InputMaybe; - created_at?: InputMaybe; - domain_epoch_id?: InputMaybe; - domain_id?: InputMaybe; - epoch?: InputMaybe; - extrinsic_root?: InputMaybe; - id?: InputMaybe; - timestamp?: InputMaybe; - updated_at?: InputMaybe; -}; - -/** select columns of table "staking.domain_blocks" */ -export enum Staking_Domain_Blocks_Select_Column { - /** column name */ - BlockHash = 'block_hash', - /** column name */ - BlockNumber = 'block_number', - /** column name */ - ConsensusBlockHash = 'consensus_block_hash', - /** column name */ - ConsensusBlockNumber = 'consensus_block_number', - /** column name */ - CreatedAt = 'created_at', - /** column name */ - DomainEpochId = 'domain_epoch_id', - /** column name */ - DomainId = 'domain_id', - /** column name */ - Epoch = 'epoch', - /** column name */ - ExtrinsicRoot = 'extrinsic_root', - /** column name */ - Id = 'id', - /** column name */ - Timestamp = 'timestamp', - /** column name */ - UpdatedAt = 'updated_at' -} - -/** Streaming cursor of the table "staking_domain_blocks" */ -export type Staking_Domain_Blocks_Stream_Cursor_Input = { - /** Stream column input with initial value */ - initial_value: Staking_Domain_Blocks_Stream_Cursor_Value_Input; - /** cursor ordering */ - ordering?: InputMaybe; -}; - -/** Initial value of the column from where the streaming should start */ -export type Staking_Domain_Blocks_Stream_Cursor_Value_Input = { - block_hash?: InputMaybe; - block_number?: InputMaybe; - consensus_block_hash?: InputMaybe; - consensus_block_number?: InputMaybe; - created_at?: InputMaybe; - domain_epoch_id?: InputMaybe; - domain_id?: InputMaybe; - epoch?: InputMaybe; - extrinsic_root?: InputMaybe; - id?: InputMaybe; - timestamp?: InputMaybe; - updated_at?: InputMaybe; -}; - -/** columns and relationships of "staking.domain_epoches" */ -export type Staking_Domain_Epoches = { - __typename?: 'staking_domain_epoches'; - block_count: Scalars['numeric']['output']; - block_number_end: Scalars['numeric']['output']; - block_number_start: Scalars['numeric']['output']; - consensus_block_hash_end: Scalars['String']['output']; - consensus_block_hash_start: Scalars['String']['output']; +/** columns and relationships of "staking.domain_epochs" */ +export type Staking_Domain_Epochs = { + __typename?: 'staking_domain_epochs'; + consensus_block_count: Scalars['numeric']['output']; consensus_block_number_end: Scalars['numeric']['output']; consensus_block_number_start: Scalars['numeric']['output']; created_at: Scalars['numeric']['output']; + domain_block_count: Scalars['numeric']['output']; + domain_block_number_end: Scalars['numeric']['output']; + domain_block_number_start: Scalars['numeric']['output']; domain_id: Scalars['String']['output']; epoch: Scalars['numeric']['output']; epoch_duration: Scalars['numeric']['output']; @@ -13584,19 +13540,18 @@ export type Staking_Domain_Epoches = { updated_at: Scalars['numeric']['output']; }; -/** Boolean expression to filter rows from the table "staking.domain_epoches". All fields are combined with a logical 'AND'. */ -export type Staking_Domain_Epoches_Bool_Exp = { - _and?: InputMaybe>; - _not?: InputMaybe; - _or?: InputMaybe>; - block_count?: InputMaybe; - block_number_end?: InputMaybe; - block_number_start?: InputMaybe; - consensus_block_hash_end?: InputMaybe; - consensus_block_hash_start?: InputMaybe; +/** Boolean expression to filter rows from the table "staking.domain_epochs". All fields are combined with a logical 'AND'. */ +export type Staking_Domain_Epochs_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + consensus_block_count?: InputMaybe; consensus_block_number_end?: InputMaybe; consensus_block_number_start?: InputMaybe; created_at?: InputMaybe; + domain_block_count?: InputMaybe; + domain_block_number_end?: InputMaybe; + domain_block_number_start?: InputMaybe; domain_id?: InputMaybe; epoch?: InputMaybe; epoch_duration?: InputMaybe; @@ -13606,16 +13561,15 @@ export type Staking_Domain_Epoches_Bool_Exp = { updated_at?: InputMaybe; }; -/** Ordering options when selecting data from "staking.domain_epoches". */ -export type Staking_Domain_Epoches_Order_By = { - block_count?: InputMaybe; - block_number_end?: InputMaybe; - block_number_start?: InputMaybe; - consensus_block_hash_end?: InputMaybe; - consensus_block_hash_start?: InputMaybe; +/** Ordering options when selecting data from "staking.domain_epochs". */ +export type Staking_Domain_Epochs_Order_By = { + consensus_block_count?: InputMaybe; consensus_block_number_end?: InputMaybe; consensus_block_number_start?: InputMaybe; created_at?: InputMaybe; + domain_block_count?: InputMaybe; + domain_block_number_end?: InputMaybe; + domain_block_number_start?: InputMaybe; domain_id?: InputMaybe; epoch?: InputMaybe; epoch_duration?: InputMaybe; @@ -13625,18 +13579,10 @@ export type Staking_Domain_Epoches_Order_By = { updated_at?: InputMaybe; }; -/** select columns of table "staking.domain_epoches" */ -export enum Staking_Domain_Epoches_Select_Column { - /** column name */ - BlockCount = 'block_count', - /** column name */ - BlockNumberEnd = 'block_number_end', - /** column name */ - BlockNumberStart = 'block_number_start', +/** select columns of table "staking.domain_epochs" */ +export enum Staking_Domain_Epochs_Select_Column { /** column name */ - ConsensusBlockHashEnd = 'consensus_block_hash_end', - /** column name */ - ConsensusBlockHashStart = 'consensus_block_hash_start', + ConsensusBlockCount = 'consensus_block_count', /** column name */ ConsensusBlockNumberEnd = 'consensus_block_number_end', /** column name */ @@ -13644,6 +13590,12 @@ export enum Staking_Domain_Epoches_Select_Column { /** column name */ CreatedAt = 'created_at', /** column name */ + DomainBlockCount = 'domain_block_count', + /** column name */ + DomainBlockNumberEnd = 'domain_block_number_end', + /** column name */ + DomainBlockNumberStart = 'domain_block_number_start', + /** column name */ DomainId = 'domain_id', /** column name */ Epoch = 'epoch', @@ -13659,24 +13611,23 @@ export enum Staking_Domain_Epoches_Select_Column { UpdatedAt = 'updated_at' } -/** Streaming cursor of the table "staking_domain_epoches" */ -export type Staking_Domain_Epoches_Stream_Cursor_Input = { +/** Streaming cursor of the table "staking_domain_epochs" */ +export type Staking_Domain_Epochs_Stream_Cursor_Input = { /** Stream column input with initial value */ - initial_value: Staking_Domain_Epoches_Stream_Cursor_Value_Input; + initial_value: Staking_Domain_Epochs_Stream_Cursor_Value_Input; /** cursor ordering */ ordering?: InputMaybe; }; /** Initial value of the column from where the streaming should start */ -export type Staking_Domain_Epoches_Stream_Cursor_Value_Input = { - block_count?: InputMaybe; - block_number_end?: InputMaybe; - block_number_start?: InputMaybe; - consensus_block_hash_end?: InputMaybe; - consensus_block_hash_start?: InputMaybe; +export type Staking_Domain_Epochs_Stream_Cursor_Value_Input = { + consensus_block_count?: InputMaybe; consensus_block_number_end?: InputMaybe; consensus_block_number_start?: InputMaybe; created_at?: InputMaybe; + domain_block_count?: InputMaybe; + domain_block_number_end?: InputMaybe; + domain_block_number_start?: InputMaybe; domain_id?: InputMaybe; epoch?: InputMaybe; epoch_duration?: InputMaybe; @@ -15668,6 +15619,86 @@ export type Staking_Nominators_Variance_Order_By = { updated_at?: InputMaybe; }; +/** columns and relationships of "staking.operator_deregistrations" */ +export type Staking_Operator_Deregistrations = { + __typename?: 'staking_operator_deregistrations'; + _block_range: Scalars['int8range']['output']; + block_height: Scalars['numeric']['output']; + domain_id: Scalars['String']['output']; + event_id: Scalars['String']['output']; + extrinsic_id: Scalars['String']['output']; + id: Scalars['String']['output']; + owner: Scalars['String']['output']; + uuid: Scalars['uuid']['output']; +}; + +/** Boolean expression to filter rows from the table "staking.operator_deregistrations". All fields are combined with a logical 'AND'. */ +export type Staking_Operator_Deregistrations_Bool_Exp = { + _and?: InputMaybe>; + _block_range?: InputMaybe; + _not?: InputMaybe; + _or?: InputMaybe>; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + owner?: InputMaybe; + uuid?: InputMaybe; +}; + +/** Ordering options when selecting data from "staking.operator_deregistrations". */ +export type Staking_Operator_Deregistrations_Order_By = { + _block_range?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + owner?: InputMaybe; + uuid?: InputMaybe; +}; + +/** select columns of table "staking.operator_deregistrations" */ +export enum Staking_Operator_Deregistrations_Select_Column { + /** column name */ + BlockRange = '_block_range', + /** column name */ + BlockHeight = 'block_height', + /** column name */ + DomainId = 'domain_id', + /** column name */ + EventId = 'event_id', + /** column name */ + ExtrinsicId = 'extrinsic_id', + /** column name */ + Id = 'id', + /** column name */ + Owner = 'owner', + /** column name */ + Uuid = 'uuid' +} + +/** Streaming cursor of the table "staking_operator_deregistrations" */ +export type Staking_Operator_Deregistrations_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Staking_Operator_Deregistrations_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Staking_Operator_Deregistrations_Stream_Cursor_Value_Input = { + _block_range?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + owner?: InputMaybe; + uuid?: InputMaybe; +}; + /** columns and relationships of "staking.operator_registrations" */ export type Staking_Operator_Registrations = { __typename?: 'staking_operator_registrations'; @@ -15986,6 +16017,92 @@ export type Staking_Operator_Staking_Histories_Stream_Cursor_Value_Input = { withdrawals_in_epoch?: InputMaybe; }; +/** columns and relationships of "staking.operator_tax_collections" */ +export type Staking_Operator_Tax_Collections = { + __typename?: 'staking_operator_tax_collections'; + _block_range: Scalars['int8range']['output']; + amount: Scalars['numeric']['output']; + block_height: Scalars['numeric']['output']; + domain_id: Scalars['String']['output']; + event_id: Scalars['String']['output']; + extrinsic_id: Scalars['String']['output']; + id: Scalars['String']['output']; + operator_id: Scalars['String']['output']; + uuid: Scalars['uuid']['output']; +}; + +/** Boolean expression to filter rows from the table "staking.operator_tax_collections". All fields are combined with a logical 'AND'. */ +export type Staking_Operator_Tax_Collections_Bool_Exp = { + _and?: InputMaybe>; + _block_range?: InputMaybe; + _not?: InputMaybe; + _or?: InputMaybe>; + amount?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + operator_id?: InputMaybe; + uuid?: InputMaybe; +}; + +/** Ordering options when selecting data from "staking.operator_tax_collections". */ +export type Staking_Operator_Tax_Collections_Order_By = { + _block_range?: InputMaybe; + amount?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + operator_id?: InputMaybe; + uuid?: InputMaybe; +}; + +/** select columns of table "staking.operator_tax_collections" */ +export enum Staking_Operator_Tax_Collections_Select_Column { + /** column name */ + BlockRange = '_block_range', + /** column name */ + Amount = 'amount', + /** column name */ + BlockHeight = 'block_height', + /** column name */ + DomainId = 'domain_id', + /** column name */ + EventId = 'event_id', + /** column name */ + ExtrinsicId = 'extrinsic_id', + /** column name */ + Id = 'id', + /** column name */ + OperatorId = 'operator_id', + /** column name */ + Uuid = 'uuid' +} + +/** Streaming cursor of the table "staking_operator_tax_collections" */ +export type Staking_Operator_Tax_Collections_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Staking_Operator_Tax_Collections_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Staking_Operator_Tax_Collections_Stream_Cursor_Value_Input = { + _block_range?: InputMaybe; + amount?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + operator_id?: InputMaybe; + uuid?: InputMaybe; +}; + /** columns and relationships of "staking.operators" */ export type Staking_Operators = { __typename?: 'staking_operators'; @@ -17164,97 +17281,311 @@ export type Staking_Operators_Variance_Fields = { updated_at?: Maybe; }; -/** order by variance() on columns of table "staking.operators" */ -export type Staking_Operators_Variance_Order_By = { - accumulated_epoch_rewards?: InputMaybe; - accumulated_epoch_shares?: InputMaybe; - accumulated_epoch_stake?: InputMaybe; - accumulated_epoch_storage_fee_deposit?: InputMaybe; - active_epoch_count?: InputMaybe; - bundle_count?: InputMaybe; - created_at?: InputMaybe; - current_epoch_rewards?: InputMaybe; - current_share_price?: InputMaybe; - current_storage_fee_deposit?: InputMaybe; - current_total_shares?: InputMaybe; - current_total_stake?: InputMaybe; - last_bundle_at?: InputMaybe; - minimum_nominator_stake?: InputMaybe; - nomination_tax?: InputMaybe; - rejected_transfers_claimed_count?: InputMaybe; - total_burned_balance?: InputMaybe; - total_consensus_storage_fee?: InputMaybe; - total_deposits?: InputMaybe; - total_domain_execution_fee?: InputMaybe; - total_estimated_withdrawals?: InputMaybe; - total_rejected_transfers_claimed?: InputMaybe; - total_rewards_collected?: InputMaybe; - total_tax_collected?: InputMaybe; - total_transfers_in?: InputMaybe; - total_transfers_out?: InputMaybe; - total_transfers_rejected?: InputMaybe; - total_volume?: InputMaybe; - total_withdrawals?: InputMaybe; - transfers_in_count?: InputMaybe; - transfers_out_count?: InputMaybe; - transfers_rejected_count?: InputMaybe; - updated_at?: InputMaybe; +/** order by variance() on columns of table "staking.operators" */ +export type Staking_Operators_Variance_Order_By = { + accumulated_epoch_rewards?: InputMaybe; + accumulated_epoch_shares?: InputMaybe; + accumulated_epoch_stake?: InputMaybe; + accumulated_epoch_storage_fee_deposit?: InputMaybe; + active_epoch_count?: InputMaybe; + bundle_count?: InputMaybe; + created_at?: InputMaybe; + current_epoch_rewards?: InputMaybe; + current_share_price?: InputMaybe; + current_storage_fee_deposit?: InputMaybe; + current_total_shares?: InputMaybe; + current_total_stake?: InputMaybe; + last_bundle_at?: InputMaybe; + minimum_nominator_stake?: InputMaybe; + nomination_tax?: InputMaybe; + rejected_transfers_claimed_count?: InputMaybe; + total_burned_balance?: InputMaybe; + total_consensus_storage_fee?: InputMaybe; + total_deposits?: InputMaybe; + total_domain_execution_fee?: InputMaybe; + total_estimated_withdrawals?: InputMaybe; + total_rejected_transfers_claimed?: InputMaybe; + total_rewards_collected?: InputMaybe; + total_tax_collected?: InputMaybe; + total_transfers_in?: InputMaybe; + total_transfers_out?: InputMaybe; + total_transfers_rejected?: InputMaybe; + total_volume?: InputMaybe; + total_withdrawals?: InputMaybe; + transfers_in_count?: InputMaybe; + transfers_out_count?: InputMaybe; + transfers_rejected_count?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** columns and relationships of "staking.runtime_creations" */ +export type Staking_Runtime_Creations = { + __typename?: 'staking_runtime_creations'; + _block_range: Scalars['int8range']['output']; + block_height: Scalars['numeric']['output']; + created_by: Scalars['String']['output']; + event_id: Scalars['String']['output']; + extrinsic_id: Scalars['String']['output']; + id: Scalars['String']['output']; + name: Scalars['String']['output']; + sort_id: Scalars['String']['output']; + type: Scalars['String']['output']; + uuid: Scalars['uuid']['output']; +}; + +/** Boolean expression to filter rows from the table "staking.runtime_creations". All fields are combined with a logical 'AND'. */ +export type Staking_Runtime_Creations_Bool_Exp = { + _and?: InputMaybe>; + _block_range?: InputMaybe; + _not?: InputMaybe; + _or?: InputMaybe>; + block_height?: InputMaybe; + created_by?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + sort_id?: InputMaybe; + type?: InputMaybe; + uuid?: InputMaybe; +}; + +/** Ordering options when selecting data from "staking.runtime_creations". */ +export type Staking_Runtime_Creations_Order_By = { + _block_range?: InputMaybe; + block_height?: InputMaybe; + created_by?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + sort_id?: InputMaybe; + type?: InputMaybe; + uuid?: InputMaybe; +}; + +/** select columns of table "staking.runtime_creations" */ +export enum Staking_Runtime_Creations_Select_Column { + /** column name */ + BlockRange = '_block_range', + /** column name */ + BlockHeight = 'block_height', + /** column name */ + CreatedBy = 'created_by', + /** column name */ + EventId = 'event_id', + /** column name */ + ExtrinsicId = 'extrinsic_id', + /** column name */ + Id = 'id', + /** column name */ + Name = 'name', + /** column name */ + SortId = 'sort_id', + /** column name */ + Type = 'type', + /** column name */ + Uuid = 'uuid' +} + +/** Streaming cursor of the table "staking_runtime_creations" */ +export type Staking_Runtime_Creations_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Staking_Runtime_Creations_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Staking_Runtime_Creations_Stream_Cursor_Value_Input = { + _block_range?: InputMaybe; + block_height?: InputMaybe; + created_by?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + sort_id?: InputMaybe; + type?: InputMaybe; + uuid?: InputMaybe; +}; + +/** columns and relationships of "staking.staked_unlocked_events" */ +export type Staking_Staked_Unlocked_Events = { + __typename?: 'staking_staked_unlocked_events'; + _block_range: Scalars['int8range']['output']; + account_id: Scalars['String']['output']; + amount: Scalars['numeric']['output']; + block_height: Scalars['numeric']['output']; + domain_id: Scalars['String']['output']; + event_id: Scalars['String']['output']; + extrinsic_id: Scalars['String']['output']; + id: Scalars['String']['output']; + operator_id: Scalars['String']['output']; + storage_fee: Scalars['numeric']['output']; + uuid: Scalars['uuid']['output']; +}; + +/** Boolean expression to filter rows from the table "staking.staked_unlocked_events". All fields are combined with a logical 'AND'. */ +export type Staking_Staked_Unlocked_Events_Bool_Exp = { + _and?: InputMaybe>; + _block_range?: InputMaybe; + _not?: InputMaybe; + _or?: InputMaybe>; + account_id?: InputMaybe; + amount?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + operator_id?: InputMaybe; + storage_fee?: InputMaybe; + uuid?: InputMaybe; +}; + +/** Ordering options when selecting data from "staking.staked_unlocked_events". */ +export type Staking_Staked_Unlocked_Events_Order_By = { + _block_range?: InputMaybe; + account_id?: InputMaybe; + amount?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + operator_id?: InputMaybe; + storage_fee?: InputMaybe; + uuid?: InputMaybe; +}; + +/** select columns of table "staking.staked_unlocked_events" */ +export enum Staking_Staked_Unlocked_Events_Select_Column { + /** column name */ + BlockRange = '_block_range', + /** column name */ + AccountId = 'account_id', + /** column name */ + Amount = 'amount', + /** column name */ + BlockHeight = 'block_height', + /** column name */ + DomainId = 'domain_id', + /** column name */ + EventId = 'event_id', + /** column name */ + ExtrinsicId = 'extrinsic_id', + /** column name */ + Id = 'id', + /** column name */ + OperatorId = 'operator_id', + /** column name */ + StorageFee = 'storage_fee', + /** column name */ + Uuid = 'uuid' +} + +/** Streaming cursor of the table "staking_staked_unlocked_events" */ +export type Staking_Staked_Unlocked_Events_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Staking_Staked_Unlocked_Events_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Staking_Staked_Unlocked_Events_Stream_Cursor_Value_Input = { + _block_range?: InputMaybe; + account_id?: InputMaybe; + amount?: InputMaybe; + block_height?: InputMaybe; + domain_id?: InputMaybe; + event_id?: InputMaybe; + extrinsic_id?: InputMaybe; + id?: InputMaybe; + operator_id?: InputMaybe; + storage_fee?: InputMaybe; + uuid?: InputMaybe; }; -/** columns and relationships of "staking.runtime_creations" */ -export type Staking_Runtime_Creations = { - __typename?: 'staking_runtime_creations'; +/** columns and relationships of "staking.withdraw_events" */ +export type Staking_Withdraw_Events = { + __typename?: 'staking_withdraw_events'; _block_range: Scalars['int8range']['output']; + account_id: Scalars['String']['output']; + amount1: Scalars['numeric']['output']; + amount2: Scalars['numeric']['output']; block_height: Scalars['numeric']['output']; - created_by: Scalars['String']['output']; + domain_id: Scalars['String']['output']; event_id: Scalars['String']['output']; extrinsic_id: Scalars['String']['output']; id: Scalars['String']['output']; - name: Scalars['String']['output']; + nominator_id: Scalars['String']['output']; + operator_id: Scalars['String']['output']; sort_id: Scalars['String']['output']; - type: Scalars['String']['output']; + timestamp: Scalars['timestamptz']['output']; + to_withdraw: Scalars['String']['output']; + total_amount: Scalars['numeric']['output']; uuid: Scalars['uuid']['output']; }; -/** Boolean expression to filter rows from the table "staking.runtime_creations". All fields are combined with a logical 'AND'. */ -export type Staking_Runtime_Creations_Bool_Exp = { - _and?: InputMaybe>; +/** Boolean expression to filter rows from the table "staking.withdraw_events". All fields are combined with a logical 'AND'. */ +export type Staking_Withdraw_Events_Bool_Exp = { + _and?: InputMaybe>; _block_range?: InputMaybe; - _not?: InputMaybe; - _or?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + account_id?: InputMaybe; + amount1?: InputMaybe; + amount2?: InputMaybe; block_height?: InputMaybe; - created_by?: InputMaybe; + domain_id?: InputMaybe; event_id?: InputMaybe; extrinsic_id?: InputMaybe; id?: InputMaybe; - name?: InputMaybe; + nominator_id?: InputMaybe; + operator_id?: InputMaybe; sort_id?: InputMaybe; - type?: InputMaybe; + timestamp?: InputMaybe; + to_withdraw?: InputMaybe; + total_amount?: InputMaybe; uuid?: InputMaybe; }; -/** Ordering options when selecting data from "staking.runtime_creations". */ -export type Staking_Runtime_Creations_Order_By = { +/** Ordering options when selecting data from "staking.withdraw_events". */ +export type Staking_Withdraw_Events_Order_By = { _block_range?: InputMaybe; + account_id?: InputMaybe; + amount1?: InputMaybe; + amount2?: InputMaybe; block_height?: InputMaybe; - created_by?: InputMaybe; + domain_id?: InputMaybe; event_id?: InputMaybe; extrinsic_id?: InputMaybe; id?: InputMaybe; - name?: InputMaybe; + nominator_id?: InputMaybe; + operator_id?: InputMaybe; sort_id?: InputMaybe; - type?: InputMaybe; + timestamp?: InputMaybe; + to_withdraw?: InputMaybe; + total_amount?: InputMaybe; uuid?: InputMaybe; }; -/** select columns of table "staking.runtime_creations" */ -export enum Staking_Runtime_Creations_Select_Column { +/** select columns of table "staking.withdraw_events" */ +export enum Staking_Withdraw_Events_Select_Column { /** column name */ BlockRange = '_block_range', /** column name */ + AccountId = 'account_id', + /** column name */ + Amount1 = 'amount1', + /** column name */ + Amount2 = 'amount2', + /** column name */ BlockHeight = 'block_height', /** column name */ - CreatedBy = 'created_by', + DomainId = 'domain_id', /** column name */ EventId = 'event_id', /** column name */ @@ -17262,34 +17593,46 @@ export enum Staking_Runtime_Creations_Select_Column { /** column name */ Id = 'id', /** column name */ - Name = 'name', + NominatorId = 'nominator_id', + /** column name */ + OperatorId = 'operator_id', /** column name */ SortId = 'sort_id', /** column name */ - Type = 'type', + Timestamp = 'timestamp', + /** column name */ + ToWithdraw = 'to_withdraw', + /** column name */ + TotalAmount = 'total_amount', /** column name */ Uuid = 'uuid' } -/** Streaming cursor of the table "staking_runtime_creations" */ -export type Staking_Runtime_Creations_Stream_Cursor_Input = { +/** Streaming cursor of the table "staking_withdraw_events" */ +export type Staking_Withdraw_Events_Stream_Cursor_Input = { /** Stream column input with initial value */ - initial_value: Staking_Runtime_Creations_Stream_Cursor_Value_Input; + initial_value: Staking_Withdraw_Events_Stream_Cursor_Value_Input; /** cursor ordering */ ordering?: InputMaybe; }; /** Initial value of the column from where the streaming should start */ -export type Staking_Runtime_Creations_Stream_Cursor_Value_Input = { +export type Staking_Withdraw_Events_Stream_Cursor_Value_Input = { _block_range?: InputMaybe; + account_id?: InputMaybe; + amount1?: InputMaybe; + amount2?: InputMaybe; block_height?: InputMaybe; - created_by?: InputMaybe; + domain_id?: InputMaybe; event_id?: InputMaybe; extrinsic_id?: InputMaybe; id?: InputMaybe; - name?: InputMaybe; + nominator_id?: InputMaybe; + operator_id?: InputMaybe; sort_id?: InputMaybe; - type?: InputMaybe; + timestamp?: InputMaybe; + to_withdraw?: InputMaybe; + total_amount?: InputMaybe; uuid?: InputMaybe; }; @@ -17297,8 +17640,17 @@ export type Staking_Runtime_Creations_Stream_Cursor_Value_Input = { export type Staking_Withdrawal_Histories = { __typename?: 'staking_withdrawal_histories'; _block_range: Scalars['int8range']['output']; + account_id: Scalars['String']['output']; block_height: Scalars['numeric']['output']; + domain_epoch: Scalars['Int']['output']; + domain_id: Scalars['String']['output']; id: Scalars['String']['output']; + nominator_id: Scalars['String']['output']; + operator_id: Scalars['String']['output']; + shares: Scalars['numeric']['output']; + storage_fee_refund: Scalars['numeric']['output']; + total_withdrawal_amount: Scalars['numeric']['output']; + unlock_at_confirmed_domain_block_number: Scalars['numeric']['output']; uuid: Scalars['uuid']['output']; }; @@ -17308,16 +17660,34 @@ export type Staking_Withdrawal_Histories_Bool_Exp = { _block_range?: InputMaybe; _not?: InputMaybe; _or?: InputMaybe>; + account_id?: InputMaybe; block_height?: InputMaybe; + domain_epoch?: InputMaybe; + domain_id?: InputMaybe; id?: InputMaybe; + nominator_id?: InputMaybe; + operator_id?: InputMaybe; + shares?: InputMaybe; + storage_fee_refund?: InputMaybe; + total_withdrawal_amount?: InputMaybe; + unlock_at_confirmed_domain_block_number?: InputMaybe; uuid?: InputMaybe; }; /** Ordering options when selecting data from "staking.withdrawal_histories". */ export type Staking_Withdrawal_Histories_Order_By = { _block_range?: InputMaybe; + account_id?: InputMaybe; block_height?: InputMaybe; + domain_epoch?: InputMaybe; + domain_id?: InputMaybe; id?: InputMaybe; + nominator_id?: InputMaybe; + operator_id?: InputMaybe; + shares?: InputMaybe; + storage_fee_refund?: InputMaybe; + total_withdrawal_amount?: InputMaybe; + unlock_at_confirmed_domain_block_number?: InputMaybe; uuid?: InputMaybe; }; @@ -17326,10 +17696,28 @@ export enum Staking_Withdrawal_Histories_Select_Column { /** column name */ BlockRange = '_block_range', /** column name */ + AccountId = 'account_id', + /** column name */ BlockHeight = 'block_height', /** column name */ + DomainEpoch = 'domain_epoch', + /** column name */ + DomainId = 'domain_id', + /** column name */ Id = 'id', /** column name */ + NominatorId = 'nominator_id', + /** column name */ + OperatorId = 'operator_id', + /** column name */ + Shares = 'shares', + /** column name */ + StorageFeeRefund = 'storage_fee_refund', + /** column name */ + TotalWithdrawalAmount = 'total_withdrawal_amount', + /** column name */ + UnlockAtConfirmedDomainBlockNumber = 'unlock_at_confirmed_domain_block_number', + /** column name */ Uuid = 'uuid' } @@ -17344,8 +17732,17 @@ export type Staking_Withdrawal_Histories_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Staking_Withdrawal_Histories_Stream_Cursor_Value_Input = { _block_range?: InputMaybe; + account_id?: InputMaybe; block_height?: InputMaybe; + domain_epoch?: InputMaybe; + domain_id?: InputMaybe; id?: InputMaybe; + nominator_id?: InputMaybe; + operator_id?: InputMaybe; + shares?: InputMaybe; + storage_fee_refund?: InputMaybe; + total_withdrawal_amount?: InputMaybe; + unlock_at_confirmed_domain_block_number?: InputMaybe; uuid?: InputMaybe; }; @@ -17370,7 +17767,7 @@ export type Staking_Withdrawals = { ready_at: Scalars['numeric']['output']; shares: Scalars['numeric']['output']; status: Scalars['String']['output']; - timestamp: Scalars['timestamp']['output']; + timestamp: Scalars['timestamptz']['output']; total_amount: Scalars['numeric']['output']; unlock_extrinsic_hash: Scalars['String']['output']; unlocked_amount: Scalars['numeric']['output']; @@ -17487,7 +17884,7 @@ export type Staking_Withdrawals_Bool_Exp = { ready_at?: InputMaybe; shares?: InputMaybe; status?: InputMaybe; - timestamp?: InputMaybe; + timestamp?: InputMaybe; total_amount?: InputMaybe; unlock_extrinsic_hash?: InputMaybe; unlocked_amount?: InputMaybe; @@ -17512,7 +17909,7 @@ export type Staking_Withdrawals_Max_Fields = { ready_at?: Maybe; shares?: Maybe; status?: Maybe; - timestamp?: Maybe; + timestamp?: Maybe; total_amount?: Maybe; unlock_extrinsic_hash?: Maybe; unlocked_amount?: Maybe; @@ -17561,7 +17958,7 @@ export type Staking_Withdrawals_Min_Fields = { ready_at?: Maybe; shares?: Maybe; status?: Maybe; - timestamp?: Maybe; + timestamp?: Maybe; total_amount?: Maybe; unlock_extrinsic_hash?: Maybe; unlocked_amount?: Maybe; @@ -17781,7 +18178,7 @@ export type Staking_Withdrawals_Stream_Cursor_Value_Input = { ready_at?: InputMaybe; shares?: InputMaybe; status?: InputMaybe; - timestamp?: InputMaybe; + timestamp?: InputMaybe; total_amount?: InputMaybe; unlock_extrinsic_hash?: InputMaybe; unlocked_amount?: InputMaybe; @@ -18677,18 +19074,12 @@ export type Subscription_Root = { staking_domain_block_histories: Array; /** fetch data from the table in a streaming manner: "staking.domain_block_histories" */ staking_domain_block_histories_stream: Array; - /** fetch data from the table: "staking.domain_blocks" */ - staking_domain_blocks: Array; - /** fetch data from the table: "staking.domain_blocks" using primary key columns */ - staking_domain_blocks_by_pk?: Maybe; - /** fetch data from the table in a streaming manner: "staking.domain_blocks" */ - staking_domain_blocks_stream: Array; - /** fetch data from the table: "staking.domain_epoches" */ - staking_domain_epoches: Array; - /** fetch data from the table: "staking.domain_epoches" using primary key columns */ - staking_domain_epoches_by_pk?: Maybe; - /** fetch data from the table in a streaming manner: "staking.domain_epoches" */ - staking_domain_epoches_stream: Array; + /** fetch data from the table: "staking.domain_epochs" */ + staking_domain_epochs: Array; + /** fetch data from the table: "staking.domain_epochs" using primary key columns */ + staking_domain_epochs_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "staking.domain_epochs" */ + staking_domain_epochs_stream: Array; /** fetch data from the table: "staking.domain_instantiations" */ staking_domain_instantiations: Array; /** fetch data from the table: "staking.domain_instantiations" using primary key columns */ @@ -18717,6 +19108,12 @@ export type Subscription_Root = { staking_nominators_by_pk?: Maybe; /** fetch data from the table in a streaming manner: "staking.nominators" */ staking_nominators_stream: Array; + /** fetch data from the table: "staking.operator_deregistrations" */ + staking_operator_deregistrations: Array; + /** fetch data from the table: "staking.operator_deregistrations" using primary key columns */ + staking_operator_deregistrations_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "staking.operator_deregistrations" */ + staking_operator_deregistrations_stream: Array; /** fetch data from the table: "staking.operator_registrations" */ staking_operator_registrations: Array; /** fetch data from the table: "staking.operator_registrations" using primary key columns */ @@ -18735,6 +19132,12 @@ export type Subscription_Root = { staking_operator_staking_histories_by_pk?: Maybe; /** fetch data from the table in a streaming manner: "staking.operator_staking_histories" */ staking_operator_staking_histories_stream: Array; + /** fetch data from the table: "staking.operator_tax_collections" */ + staking_operator_tax_collections: Array; + /** fetch data from the table: "staking.operator_tax_collections" using primary key columns */ + staking_operator_tax_collections_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "staking.operator_tax_collections" */ + staking_operator_tax_collections_stream: Array; /** fetch data from the table: "staking.operators" */ staking_operators: Array; /** fetch aggregated fields from the table: "staking.operators" */ @@ -18749,6 +19152,18 @@ export type Subscription_Root = { staking_runtime_creations_by_pk?: Maybe; /** fetch data from the table in a streaming manner: "staking.runtime_creations" */ staking_runtime_creations_stream: Array; + /** fetch data from the table: "staking.staked_unlocked_events" */ + staking_staked_unlocked_events: Array; + /** fetch data from the table: "staking.staked_unlocked_events" using primary key columns */ + staking_staked_unlocked_events_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "staking.staked_unlocked_events" */ + staking_staked_unlocked_events_stream: Array; + /** fetch data from the table: "staking.withdraw_events" */ + staking_withdraw_events: Array; + /** fetch data from the table: "staking.withdraw_events" using primary key columns */ + staking_withdraw_events_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "staking.withdraw_events" */ + staking_withdraw_events_stream: Array; /** fetch data from the table: "staking.withdrawal_histories" */ staking_withdrawal_histories: Array; /** fetch data from the table: "staking.withdrawal_histories" using primary key columns */ @@ -20420,45 +20835,24 @@ export type Subscription_RootStaking_Domain_Block_Histories_StreamArgs = { }; -export type Subscription_RootStaking_Domain_BlocksArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootStaking_Domain_Blocks_By_PkArgs = { - id: Scalars['String']['input']; -}; - - -export type Subscription_RootStaking_Domain_Blocks_StreamArgs = { - batch_size: Scalars['Int']['input']; - cursor: Array>; - where?: InputMaybe; -}; - - -export type Subscription_RootStaking_Domain_EpochesArgs = { - distinct_on?: InputMaybe>; +export type Subscription_RootStaking_Domain_EpochsArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Subscription_RootStaking_Domain_Epoches_By_PkArgs = { +export type Subscription_RootStaking_Domain_Epochs_By_PkArgs = { id: Scalars['String']['input']; }; -export type Subscription_RootStaking_Domain_Epoches_StreamArgs = { +export type Subscription_RootStaking_Domain_Epochs_StreamArgs = { batch_size: Scalars['Int']['input']; - cursor: Array>; - where?: InputMaybe; + cursor: Array>; + where?: InputMaybe; }; @@ -20564,6 +20958,27 @@ export type Subscription_RootStaking_Nominators_StreamArgs = { }; +export type Subscription_RootStaking_Operator_DeregistrationsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootStaking_Operator_Deregistrations_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + +export type Subscription_RootStaking_Operator_Deregistrations_StreamArgs = { + batch_size: Scalars['Int']['input']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootStaking_Operator_RegistrationsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -20627,6 +21042,27 @@ export type Subscription_RootStaking_Operator_Staking_Histories_StreamArgs = { }; +export type Subscription_RootStaking_Operator_Tax_CollectionsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootStaking_Operator_Tax_Collections_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + +export type Subscription_RootStaking_Operator_Tax_Collections_StreamArgs = { + batch_size: Scalars['Int']['input']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootStaking_OperatorsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -20678,6 +21114,48 @@ export type Subscription_RootStaking_Runtime_Creations_StreamArgs = { }; +export type Subscription_RootStaking_Staked_Unlocked_EventsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootStaking_Staked_Unlocked_Events_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + +export type Subscription_RootStaking_Staked_Unlocked_Events_StreamArgs = { + batch_size: Scalars['Int']['input']; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootStaking_Withdraw_EventsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootStaking_Withdraw_Events_By_PkArgs = { + uuid: Scalars['uuid']['input']; +}; + + +export type Subscription_RootStaking_Withdraw_Events_StreamArgs = { + batch_size: Scalars['Int']['input']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootStaking_Withdrawal_HistoriesArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -20825,6 +21303,19 @@ export type Timestamp_Comparison_Exp = { _nin?: InputMaybe>; }; +/** Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. */ +export type Timestamptz_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + /** Boolean expression to compare columns of type "uuid". All fields are combined with logical 'AND'. */ export type Uuid_Comparison_Exp = { _eq?: InputMaybe; @@ -21391,11 +21882,13 @@ export type FolderChildrenByIdQueryVariables = Exact<{ export type FolderChildrenByIdQuery = { __typename?: 'query_root', files_folder_cids_aggregate: { __typename?: 'files_folder_cids_aggregate', aggregate?: { __typename?: 'files_folder_cids_aggregate_fields', count: number } | null }, files_folder_cids: Array<{ __typename?: 'files_folder_cids', child_cid: string, chunk?: { __typename?: 'files_chunks', name?: string | null } | null }> }; export type AccountsTopLeaderboardQueryVariables = Exact<{ - first: Scalars['Int']['input']; + whereFarmerBlockTotalCounts?: InputMaybe; + whereOperatorDepositsTotalValues?: InputMaybe; + whereNominatorDepositsTotalValues?: InputMaybe; }>; -export type AccountsTopLeaderboardQuery = { __typename?: 'query_root', farmers: Array<{ __typename?: 'consensus_rewards', id: string }>, operators: Array<{ __typename?: 'consensus_rewards', id: string }>, nominators: Array<{ __typename?: 'consensus_rewards', id: string }> }; +export type AccountsTopLeaderboardQuery = { __typename?: 'query_root', leaderboard_farmer_block_total_counts: Array<{ __typename?: 'leaderboard_farmer_block_total_counts', rank: number }>, leaderboard_operator_deposits_total_values: Array<{ __typename?: 'leaderboard_operator_deposits_total_values', rank: number }>, leaderboard_nominator_deposits_total_values: Array<{ __typename?: 'leaderboard_nominator_deposits_total_values', rank: number }> }; export type PendingTransactionQueryVariables = Exact<{ subspaceAccount?: InputMaybe; @@ -25051,27 +25544,27 @@ export type FolderChildrenByIdLazyQueryHookResult = ReturnType; export type FolderChildrenByIdQueryResult = Apollo.QueryResult; export const AccountsTopLeaderboardDocument = gql` - query AccountsTopLeaderboard($first: Int!) { - farmers: consensus_rewards( - order_by: {amount: desc} - limit: $first - where: {_or: [{reward_type: {_eq: "Rewards.VoteReward"}}, {reward_type: {_eq: "Rewards.BlockReward"}}]} + query AccountsTopLeaderboard($whereFarmerBlockTotalCounts: leaderboard_farmer_block_total_counts_bool_exp, $whereOperatorDepositsTotalValues: leaderboard_operator_deposits_total_values_bool_exp, $whereNominatorDepositsTotalValues: leaderboard_nominator_deposits_total_values_bool_exp) { + leaderboard_farmer_block_total_counts( + order_by: {rank: asc} + where: $whereFarmerBlockTotalCounts + limit: 1 ) { - id + rank } - operators: consensus_rewards( - order_by: {amount: desc} - limit: $first - where: {_or: [{reward_type: {_eq: "Rewards.VoteReward"}}, {reward_type: {_eq: "Rewards.BlockReward"}}]} + leaderboard_operator_deposits_total_values( + order_by: {rank: asc} + where: $whereOperatorDepositsTotalValues + limit: 1 ) { - id + rank } - nominators: consensus_rewards( - order_by: {amount: desc} - limit: $first - where: {_or: [{reward_type: {_eq: "Rewards.VoteReward"}}, {reward_type: {_eq: "Rewards.BlockReward"}}]} + leaderboard_nominator_deposits_total_values( + order_by: {rank: asc} + where: $whereNominatorDepositsTotalValues + limit: 1 ) { - id + rank } } `; @@ -25088,11 +25581,13 @@ export const AccountsTopLeaderboardDocument = gql` * @example * const { data, loading, error } = useAccountsTopLeaderboardQuery({ * variables: { - * first: // value for 'first' + * whereFarmerBlockTotalCounts: // value for 'whereFarmerBlockTotalCounts' + * whereOperatorDepositsTotalValues: // value for 'whereOperatorDepositsTotalValues' + * whereNominatorDepositsTotalValues: // value for 'whereNominatorDepositsTotalValues' * }, * }); */ -export function useAccountsTopLeaderboardQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: AccountsTopLeaderboardQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useAccountsTopLeaderboardQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(AccountsTopLeaderboardDocument, options); } diff --git a/explorer/src/components/WalletSideKick/Leaderboard.tsx b/explorer/src/components/WalletSideKick/Leaderboard.tsx index 17ac1c761..5ffa2ff65 100644 --- a/explorer/src/components/WalletSideKick/Leaderboard.tsx +++ b/explorer/src/components/WalletSideKick/Leaderboard.tsx @@ -31,13 +31,24 @@ export const useLeaderboard = (subspaceAccount: string) => { const { get } = useSearchParams() const isSideKickOpen = get(ROUTE_EXTRA_FLAG_TYPE.WALLET_SIDEKICK) + const where = useMemo( + () => ({ + id: { + _eq: subspaceAccount, + }, + }), + [subspaceAccount], + ) + const variables = useMemo( () => ({ - first: 100, + whereFarmerBlockTotalCounts: where, + whereOperatorDepositsTotalValues: where, + whereNominatorDepositsTotalValues: where, }), - [], + [where], ) - const { setIsVisible } = useIndexersQuery< + const { setIsVisible, data: leaderboardData } = useIndexersQuery< AccountsTopLeaderboardQuery, AccountsTopLeaderboardQueryVariables >( @@ -51,33 +62,52 @@ export const useLeaderboard = (subspaceAccount: string) => { 'leaderboard', ) + console.log('leaderboardData', leaderboardData) + const leaderboard = useQueryStates((state) => state.walletSidekick.leaderboard) const loading = useMemo(() => isLoading(leaderboard), [leaderboard]) const data = useMemo(() => hasValue(leaderboard) && leaderboard.value, [leaderboard]) const error = useMemo(() => isError(leaderboard), [leaderboard]) + console.log('data', data) + // TODO: change this for the right logic const topFarmers = useMemo(() => { - if (!data || !data.farmers) return 0 - const account = data.farmers.find((edge) => edge.id === subspaceAccount) - if (!account) return 0 - return parseInt(account.id) - }, [data, subspaceAccount]) + if ( + !data || + !data.leaderboard_farmer_block_total_counts || + data.leaderboard_farmer_block_total_counts.length === 0 + ) + return 0 + const rank = data.leaderboard_farmer_block_total_counts[0].rank + if (!rank) return 0 + return rank + }, [data]) const topOperators = useMemo(() => { - if (!data || !data.operators) return 0 - const account = data.operators.find((edge) => edge.id === subspaceAccount) - if (!account) return 0 - return parseInt(account.id) - }, [data, subspaceAccount]) + if ( + !data || + !data.leaderboard_operator_deposits_total_values || + data.leaderboard_operator_deposits_total_values.length === 0 + ) + return 0 + const rank = data.leaderboard_operator_deposits_total_values[0].rank + if (!rank) return 0 + return rank + }, [data]) const topNominators = useMemo(() => { - if (!data || !data.nominators) return 0 - const account = data.nominators.find((edge) => edge.id === subspaceAccount) - if (!account) return 0 - return parseInt(account.id) - }, [data, subspaceAccount]) + if ( + !data || + !data.leaderboard_nominator_deposits_total_values || + data.leaderboard_nominator_deposits_total_values.length === 0 + ) + return 0 + const rank = data.leaderboard_nominator_deposits_total_values[0].rank + if (!rank) return 0 + return rank + }, [data]) const hasTopPositions = useMemo( () => topFarmers > 0 || topOperators > 0 || topNominators > 0, diff --git a/explorer/src/components/WalletSideKick/query.gql b/explorer/src/components/WalletSideKick/query.gql index dab9f1c9c..11eac0987 100644 --- a/explorer/src/components/WalletSideKick/query.gql +++ b/explorer/src/components/WalletSideKick/query.gql @@ -1,41 +1,28 @@ -query AccountsTopLeaderboard($first: Int!) { - farmers: consensus_rewards( - order_by: { amount: desc } - limit: $first - where: { - _or: [ - { reward_type: { _eq: "Rewards.VoteReward" } } - { reward_type: { _eq: "Rewards.BlockReward" } } - ] - } +query AccountsTopLeaderboard( + $whereFarmerBlockTotalCounts: leaderboard_farmer_block_total_counts_bool_exp + $whereOperatorDepositsTotalValues: leaderboard_operator_deposits_total_values_bool_exp + $whereNominatorDepositsTotalValues: leaderboard_nominator_deposits_total_values_bool_exp +) { + leaderboard_farmer_block_total_counts( + order_by: { rank: asc } + where: $whereFarmerBlockTotalCounts + limit: 1 ) { - id + rank } - # TODO: change this for operators - operators: consensus_rewards( - order_by: { amount: desc } - limit: $first - where: { - _or: [ - { reward_type: { _eq: "Rewards.VoteReward" } } - { reward_type: { _eq: "Rewards.BlockReward" } } - ] - } + leaderboard_operator_deposits_total_values( + order_by: { rank: asc } + where: $whereOperatorDepositsTotalValues + limit: 1 ) { - id + rank } - # TODO: change this for nominators - nominators: consensus_rewards( - order_by: { amount: desc } - limit: $first - where: { - _or: [ - { reward_type: { _eq: "Rewards.VoteReward" } } - { reward_type: { _eq: "Rewards.BlockReward" } } - ] - } + leaderboard_nominator_deposits_total_values( + order_by: { rank: asc } + where: $whereNominatorDepositsTotalValues + limit: 1 ) { - id + rank } }