diff --git a/.changeset/gorgeous-squids-learn.md b/.changeset/gorgeous-squids-learn.md new file mode 100644 index 0000000000..3d2755c855 --- /dev/null +++ b/.changeset/gorgeous-squids-learn.md @@ -0,0 +1,37 @@ +--- +'shared-utils': minor +'web-assetmantle': minor +'web-persistence': minor +'web-quicksilver': minor +'web-provenance': minor +'web-crescent': minor +'web-humansai': minor +'web-likecoin': minor +'web-wormhole': minor +'web-archway': minor +'web-bitsong': minor +'web-gitopia': minor +'web-neutron': minor +'web-osmosis': minor +'web-agoric': minor +'web-comdex': minor +'web-coreum': minor +'web-cosmos': minor +'web-desmos': minor +'web-emoney': minor +'web-jackal': minor +'web-quasar': minor +'web-stride': minor +'web-akash': minor +'web-cheqd': minor +'web-evmos': minor +'web-regen': minor +'web-rizon': minor +'web-band': minor +'web-kyve': minor +'web-nym': minor +'ui': minor +'web': minor +--- + +add button to filter transactions by type diff --git a/apps/web-agoric/src/graphql/general/message_types.graphql b/apps/web-agoric/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-agoric/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-agoric/src/graphql/types/general_types.ts b/apps/web-agoric/src/graphql/types/general_types.ts index db0479ee30..8a77deba84 100644 --- a/apps/web-agoric/src/graphql/types/general_types.ts +++ b/apps/web-agoric/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3143,6 +3283,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5272,10 +5424,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5811,6 +5975,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5831,6 +6013,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7074,10 +7296,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7527,6 +7761,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7547,6 +7799,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11777,6 +12069,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12715,6 +13037,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-akash/src/graphql/general/message_types.graphql b/apps/web-akash/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-akash/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-akash/src/graphql/types/general_types.ts b/apps/web-akash/src/graphql/types/general_types.ts index afb5128be4..15c3b75569 100644 --- a/apps/web-akash/src/graphql/types/general_types.ts +++ b/apps/web-akash/src/graphql/types/general_types.ts @@ -3713,6 +3713,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -3797,6 +3799,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3848,6 +3851,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3934,6 +3938,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3986,6 +4126,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -6156,10 +6308,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -6795,6 +6959,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -6815,6 +6997,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -8082,10 +8304,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -8635,6 +8869,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -8655,6 +8907,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -12885,6 +13177,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -13843,6 +14165,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-archway/src/graphql/general/message_types.graphql b/apps/web-archway/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-archway/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-archway/src/graphql/types/general_types.ts b/apps/web-archway/src/graphql/types/general_types.ts index 78c4811a71..08d7851f2e 100644 --- a/apps/web-archway/src/graphql/types/general_types.ts +++ b/apps/web-archway/src/graphql/types/general_types.ts @@ -185,6 +185,10 @@ export type Account = { __typename?: 'account'; address: Scalars['String']; /** An array relationship */ + feeGrantAllowancesByGranterAddress: Array; + /** An array relationship */ + fee_grant_allowances: Array; + /** An array relationship */ proposal_deposits: Array; /** An array relationship */ proposal_votes: Array; @@ -200,6 +204,30 @@ export type Account = { vesting_account?: Maybe; /** An array relationship */ vesting_accounts: Array; + /** An array relationship */ + wasm_contracts: Array; + /** An aggregate relationship */ + wasm_contracts_aggregate: Wasm_Contract_Aggregate; +}; + + +/** columns and relationships of "account" */ +export type AccountFeeGrantAllowancesByGranterAddressArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "account" */ +export type AccountFee_Grant_AllowancesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; @@ -272,29 +300,55 @@ export type AccountVesting_AccountsArgs = { where?: InputMaybe; }; + +/** columns and relationships of "account" */ +export type AccountWasm_ContractsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "account" */ +export type AccountWasm_Contracts_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "account". All fields are combined with a logical 'AND'. */ export type Account_Bool_Exp = { _and?: InputMaybe>; _not?: InputMaybe; _or?: InputMaybe>; address?: InputMaybe; + feeGrantAllowancesByGranterAddress?: InputMaybe; + fee_grant_allowances?: InputMaybe; proposal_deposits?: InputMaybe; proposal_votes?: InputMaybe; proposals?: InputMaybe; validator_infos?: InputMaybe; vesting_account?: InputMaybe; vesting_accounts?: InputMaybe; + wasm_contracts?: InputMaybe; }; /** Ordering options when selecting data from "account". */ export type Account_Order_By = { address?: InputMaybe; + feeGrantAllowancesByGranterAddress_aggregate?: InputMaybe; + fee_grant_allowances_aggregate?: InputMaybe; proposal_deposits_aggregate?: InputMaybe; proposal_votes_aggregate?: InputMaybe; proposals_aggregate?: InputMaybe; validator_infos_aggregate?: InputMaybe; vesting_account?: InputMaybe; vesting_accounts_aggregate?: InputMaybe; + wasm_contracts_aggregate?: InputMaybe; }; /** select columns of table "account" */ @@ -1089,6 +1143,26 @@ export type Fee_Grant_AllowanceAllowanceArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Avg_Order_By = { + height?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "fee_grant_allowance". All fields are combined with a logical 'AND'. */ export type Fee_Grant_Allowance_Bool_Exp = { _and?: InputMaybe>; @@ -1102,6 +1176,20 @@ export type Fee_Grant_Allowance_Bool_Exp = { height?: InputMaybe; }; +/** order by max() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Max_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + +/** order by min() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Min_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + /** Ordering options when selecting data from "fee_grant_allowance". */ export type Fee_Grant_Allowance_Order_By = { allowance?: InputMaybe; @@ -1124,6 +1212,41 @@ export enum Fee_Grant_Allowance_Select_Column { Height = 'height' } +/** order by stddev() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by sum() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Sum_Order_By = { + height?: InputMaybe; +}; + +/** order by var_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by var_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by variance() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Variance_Order_By = { + height?: InputMaybe; +}; + /** columns and relationships of "genesis" */ export type Genesis = { __typename?: 'genesis'; @@ -1277,7 +1400,11 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; + /** An object relationship */ + transactionByPartitionIdTransactionHash?: Maybe; transaction_hash: Scalars['String']; type: Scalars['String']; value: Scalars['jsonb']; @@ -1289,6 +1416,27 @@ export type MessageValueArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "message" */ +export type Message_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "message" */ +export type Message_Avg_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "message". All fields are combined with a logical 'AND'. */ export type Message_Bool_Exp = { _and?: InputMaybe>; @@ -1297,18 +1445,38 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; }; +/** order by max() on columns of table "message" */ +export type Message_Max_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + +/** order by min() on columns of table "message" */ +export type Message_Min_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + /** Ordering options when selecting data from "message". */ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -1330,6 +1498,184 @@ export enum Message_Select_Column { Value = 'value' } +/** order by stddev() on columns of table "message" */ +export type Message_Stddev_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "message" */ +export type Message_Stddev_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "message" */ +export type Message_Stddev_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by sum() on columns of table "message" */ +export type Message_Sum_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + +/** order by var_pop() on columns of table "message" */ +export type Message_Var_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by var_samp() on columns of table "message" */ +export type Message_Var_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by variance() on columns of table "message" */ +export type Message_Variance_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + export type Messages_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -1337,6 +1683,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2686,8 +3044,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3030,6 +3396,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3040,6 +3424,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3806,8 +4210,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4064,6 +4476,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4074,6 +4504,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -5004,6 +5454,8 @@ export type Transaction = { logs?: Maybe; memo?: Maybe; messages: Scalars['jsonb']; + /** An array relationship */ + messagesByTransactionHashPartitionId: Array; raw_log?: Maybe; signatures: Scalars['_text']; signer_infos: Scalars['jsonb']; @@ -5029,6 +5481,16 @@ export type TransactionMessagesArgs = { }; +/** columns and relationships of "transaction" */ +export type TransactionMessagesByTransactionHashPartitionIdArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "transaction" */ export type TransactionSigner_InfosArgs = { path?: InputMaybe; @@ -5070,6 +5532,7 @@ export type Transaction_Bool_Exp = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByTransactionHashPartitionId?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe<_Text_Comparison_Exp>; signer_infos?: InputMaybe; @@ -5107,6 +5570,7 @@ export type Transaction_Order_By = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByTransactionHashPartitionId_aggregate?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe; signer_infos?: InputMaybe; @@ -6890,6 +7354,8 @@ export type Wasm_Code_Variance_Fields = { /** columns and relationships of "wasm_contract" */ export type Wasm_Contract = { __typename?: 'wasm_contract'; + /** An object relationship */ + account: Account; admin?: Maybe; code_id: Scalars['bigint']; contract_address: Scalars['String']; @@ -7006,6 +7472,7 @@ export type Wasm_Contract_Bool_Exp = { _and?: InputMaybe>; _not?: InputMaybe; _or?: InputMaybe>; + account?: InputMaybe; admin?: InputMaybe; code_id?: InputMaybe; contract_address?: InputMaybe; @@ -7083,6 +7550,7 @@ export type Wasm_Contract_Min_Order_By = { /** Ordering options when selecting data from "wasm_contract". */ export type Wasm_Contract_Order_By = { + account?: InputMaybe; admin?: InputMaybe; code_id?: InputMaybe; contract_address?: InputMaybe; @@ -7729,6 +8197,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -8667,6 +9165,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-assetmantle/src/graphql/general/message_types.graphql b/apps/web-assetmantle/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-assetmantle/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-assetmantle/src/graphql/types/general_types.ts b/apps/web-assetmantle/src/graphql/types/general_types.ts index 437f9f181f..99ad18a190 100644 --- a/apps/web-assetmantle/src/graphql/types/general_types.ts +++ b/apps/web-assetmantle/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3143,6 +3283,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5276,10 +5428,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5815,6 +5979,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5835,6 +6017,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7078,10 +7300,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7531,6 +7765,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7551,6 +7803,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11781,6 +12073,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12719,6 +13041,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-band/src/graphql/general/message_types.graphql b/apps/web-band/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-band/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-band/src/graphql/types/general_types.ts b/apps/web-band/src/graphql/types/general_types.ts index 5ccb8c3c44..2aab0b91a1 100644 --- a/apps/web-band/src/graphql/types/general_types.ts +++ b/apps/web-band/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3143,6 +3283,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5407,10 +5559,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5952,6 +6116,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5972,6 +6154,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7238,10 +7460,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7697,6 +7931,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7717,6 +7969,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11965,6 +12257,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12903,6 +13225,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-bitsong/src/graphql/general/message_types.graphql b/apps/web-bitsong/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-bitsong/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-bitsong/src/graphql/types/general_types.ts b/apps/web-bitsong/src/graphql/types/general_types.ts index b962a26041..11276d63c3 100644 --- a/apps/web-bitsong/src/graphql/types/general_types.ts +++ b/apps/web-bitsong/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3143,6 +3283,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5276,10 +5428,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5815,6 +5979,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5835,6 +6017,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7078,10 +7300,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7531,6 +7765,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7551,6 +7803,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11781,6 +12073,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12719,6 +13041,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-cheqd/src/graphql/general/message_types.graphql b/apps/web-cheqd/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-cheqd/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-cheqd/src/graphql/types/general_types.ts b/apps/web-cheqd/src/graphql/types/general_types.ts index 8a5a759c72..5b6817f8d0 100644 --- a/apps/web-cheqd/src/graphql/types/general_types.ts +++ b/apps/web-cheqd/src/graphql/types/general_types.ts @@ -1440,6 +1440,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1483,6 +1485,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1511,6 +1514,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1558,6 +1562,142 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -1583,6 +1723,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2936,8 +3088,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3286,6 +3446,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3296,6 +3474,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4099,8 +4297,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4363,6 +4569,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4373,6 +4597,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7065,6 +7309,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -8016,6 +8290,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-comdex/src/graphql/general/message_types.graphql b/apps/web-comdex/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-comdex/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-comdex/src/graphql/types/general_types.ts b/apps/web-comdex/src/graphql/types/general_types.ts index bf5cc403d6..fcd3edde2a 100644 --- a/apps/web-comdex/src/graphql/types/general_types.ts +++ b/apps/web-comdex/src/graphql/types/general_types.ts @@ -2910,6 +2910,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2994,6 +2996,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3045,6 +3048,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3131,6 +3135,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3183,6 +3323,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5316,10 +5468,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5873,6 +6037,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5893,6 +6075,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7213,10 +7435,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7684,6 +7918,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7704,6 +7956,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -12895,6 +13187,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -13851,6 +14173,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-coreum/src/graphql/general/message_types.graphql b/apps/web-coreum/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-coreum/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-coreum/src/graphql/types/general_types.ts b/apps/web-coreum/src/graphql/types/general_types.ts index 03a0d398a4..51f3bf8e8f 100644 --- a/apps/web-coreum/src/graphql/types/general_types.ts +++ b/apps/web-coreum/src/graphql/types/general_types.ts @@ -1360,6 +1360,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1403,6 +1405,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1431,6 +1434,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1478,6 +1482,142 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -1503,6 +1643,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2852,8 +3004,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3190,6 +3350,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3200,6 +3378,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3939,8 +4137,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4191,6 +4397,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4201,6 +4425,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7502,6 +7746,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -8440,6 +8714,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-cosmos/src/graphql/general/message_types.graphql b/apps/web-cosmos/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-cosmos/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-cosmos/src/graphql/types/general_types.ts b/apps/web-cosmos/src/graphql/types/general_types.ts index a697046747..029837f080 100644 --- a/apps/web-cosmos/src/graphql/types/general_types.ts +++ b/apps/web-cosmos/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3151,11 +3291,23 @@ export type Messages_By_Single_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + export type Messages_Get_Types_Args = { limit?: InputMaybe; offset?: InputMaybe; }; +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5289,6 +5441,10 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -5297,10 +5453,18 @@ export type Query_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_get_types" which returns "message" */ messages_get_types: Array; /** execute function "messages_get_types" and query aggregates on result of table type "message" */ messages_get_types_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5843,6 +6007,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5883,6 +6065,26 @@ export type Query_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_Get_TypesArgs = { args: Messages_Get_Types_Args; distinct_on?: InputMaybe>; @@ -5903,6 +6105,26 @@ export type Query_RootMessages_Get_Types_AggregateArgs = { }; +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7146,6 +7368,10 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -7154,10 +7380,18 @@ export type Subscription_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_get_types" which returns "message" */ messages_get_types: Array; /** execute function "messages_get_types" and query aggregates on result of table type "message" */ messages_get_types_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7607,6 +7841,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7647,6 +7899,26 @@ export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_Get_TypesArgs = { args: Messages_Get_Types_Args; distinct_on?: InputMaybe>; @@ -7667,6 +7939,26 @@ export type Subscription_RootMessages_Get_Types_AggregateArgs = { }; +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11897,6 +12189,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12835,6 +13157,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-crescent/src/graphql/general/message_types.graphql b/apps/web-crescent/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-crescent/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-crescent/src/graphql/types/general_types.ts b/apps/web-crescent/src/graphql/types/general_types.ts index b681919b52..d7b7f79b09 100644 --- a/apps/web-crescent/src/graphql/types/general_types.ts +++ b/apps/web-crescent/src/graphql/types/general_types.ts @@ -3132,6 +3132,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -3216,6 +3218,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3267,6 +3270,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3353,6 +3357,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3413,6 +3553,18 @@ export type Messages_By_Single_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5558,6 +5710,10 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -5566,6 +5722,14 @@ export type Query_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -6147,6 +6311,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -6187,6 +6369,46 @@ export type Query_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7442,6 +7664,10 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -7450,6 +7676,14 @@ export type Subscription_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7945,6 +8179,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7985,6 +8237,46 @@ export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -12220,6 +12512,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }>, mintParams: Array<{ __typename?: 'mint_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -13161,6 +13483,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-desmos/src/chain.json b/apps/web-desmos/src/chain.json index 46f25dffd5..457b6e5f04 100644 --- a/apps/web-desmos/src/chain.json +++ b/apps/web-desmos/src/chain.json @@ -3,8 +3,7 @@ "title": "Desmos Block Explorer", "extra": { "profile": true, - "graphqlWs": false, - "votingPowerExponent": 6 + "graphqlWs": false }, "previewImage": "https://s3.bigdipper.live/desmos.png", "themes": { diff --git a/apps/web-desmos/src/graphql/general/message_types.graphql b/apps/web-desmos/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-desmos/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-desmos/src/graphql/types/general_types.ts b/apps/web-desmos/src/graphql/types/general_types.ts index 0f3f6dbb7b..5d33c25fc7 100644 --- a/apps/web-desmos/src/graphql/types/general_types.ts +++ b/apps/web-desmos/src/graphql/types/general_types.ts @@ -2848,6 +2848,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2932,6 +2934,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -2983,6 +2986,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -4088,10 +4092,9 @@ export type Proposal_Deposit = { depositor?: Maybe; depositor_address?: Maybe; height?: Maybe; - /** An object relationship */ - proposal: Proposal; proposal_id: Scalars['Int']; timestamp?: Maybe; + transaction_hash: Scalars['String']; }; /** aggregated selection of "proposal_deposit" */ @@ -4162,9 +4165,9 @@ export type Proposal_Deposit_Bool_Exp = { depositor?: InputMaybe; depositor_address?: InputMaybe; height?: InputMaybe; - proposal?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; + transaction_hash?: InputMaybe; }; /** aggregate max on columns */ @@ -4174,6 +4177,7 @@ export type Proposal_Deposit_Max_Fields = { height?: Maybe; proposal_id?: Maybe; timestamp?: Maybe; + transaction_hash?: Maybe; }; /** order by max() on columns of table "proposal_deposit" */ @@ -4182,6 +4186,7 @@ export type Proposal_Deposit_Max_Order_By = { height?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; + transaction_hash?: InputMaybe; }; /** aggregate min on columns */ @@ -4191,6 +4196,7 @@ export type Proposal_Deposit_Min_Fields = { height?: Maybe; proposal_id?: Maybe; timestamp?: Maybe; + transaction_hash?: Maybe; }; /** order by min() on columns of table "proposal_deposit" */ @@ -4199,6 +4205,7 @@ export type Proposal_Deposit_Min_Order_By = { height?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; + transaction_hash?: InputMaybe; }; /** Ordering options when selecting data from "proposal_deposit". */ @@ -4208,9 +4215,9 @@ export type Proposal_Deposit_Order_By = { depositor?: InputMaybe; depositor_address?: InputMaybe; height?: InputMaybe; - proposal?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; + transaction_hash?: InputMaybe; }; /** select columns of table "proposal_deposit" */ @@ -4224,7 +4231,9 @@ export enum Proposal_Deposit_Select_Column { /** column name */ ProposalId = 'proposal_id', /** column name */ - Timestamp = 'timestamp' + Timestamp = 'timestamp', + /** column name */ + TransactionHash = 'transaction_hash' } /** aggregate stddev on columns */ @@ -4437,8 +4446,6 @@ export type Proposal_Staking_Pool_Snapshot = { bonded_tokens: Scalars['bigint']; height: Scalars['bigint']; not_bonded_tokens: Scalars['bigint']; - /** An object relationship */ - proposal: Proposal; proposal_id: Scalars['Int']; }; @@ -4489,7 +4496,6 @@ export type Proposal_Staking_Pool_Snapshot_Bool_Exp = { bonded_tokens?: InputMaybe; height?: InputMaybe; not_bonded_tokens?: InputMaybe; - proposal?: InputMaybe; proposal_id?: InputMaybe; }; @@ -4516,7 +4522,6 @@ export type Proposal_Staking_Pool_Snapshot_Order_By = { bonded_tokens?: InputMaybe; height?: InputMaybe; not_bonded_tokens?: InputMaybe; - proposal?: InputMaybe; proposal_id?: InputMaybe; }; @@ -4646,8 +4651,6 @@ export type Proposal_Tally_Result = { height: Scalars['bigint']; no: Scalars['String']; no_with_veto: Scalars['String']; - /** An object relationship */ - proposal: Proposal; proposal_id: Scalars['Int']; yes: Scalars['String']; }; @@ -4719,7 +4722,6 @@ export type Proposal_Tally_Result_Bool_Exp = { height?: InputMaybe; no?: InputMaybe; no_with_veto?: InputMaybe; - proposal?: InputMaybe; proposal_id?: InputMaybe; yes?: InputMaybe; }; @@ -4772,7 +4774,6 @@ export type Proposal_Tally_Result_Order_By = { height?: InputMaybe; no?: InputMaybe; no_with_veto?: InputMaybe; - proposal?: InputMaybe; proposal_id?: InputMaybe; yes?: InputMaybe; }; @@ -5231,6 +5232,7 @@ export type Proposal_Vote = { proposal_id: Scalars['Int']; timestamp?: Maybe; voter_address: Scalars['String']; + weight: Scalars['String']; }; /** aggregated selection of "proposal_vote" */ @@ -5303,6 +5305,7 @@ export type Proposal_Vote_Bool_Exp = { proposal_id?: InputMaybe; timestamp?: InputMaybe; voter_address?: InputMaybe; + weight?: InputMaybe; }; /** aggregate max on columns */ @@ -5313,6 +5316,7 @@ export type Proposal_Vote_Max_Fields = { proposal_id?: Maybe; timestamp?: Maybe; voter_address?: Maybe; + weight?: Maybe; }; /** order by max() on columns of table "proposal_vote" */ @@ -5322,6 +5326,7 @@ export type Proposal_Vote_Max_Order_By = { proposal_id?: InputMaybe; timestamp?: InputMaybe; voter_address?: InputMaybe; + weight?: InputMaybe; }; /** aggregate min on columns */ @@ -5332,6 +5337,7 @@ export type Proposal_Vote_Min_Fields = { proposal_id?: Maybe; timestamp?: Maybe; voter_address?: Maybe; + weight?: Maybe; }; /** order by min() on columns of table "proposal_vote" */ @@ -5341,6 +5347,7 @@ export type Proposal_Vote_Min_Order_By = { proposal_id?: InputMaybe; timestamp?: InputMaybe; voter_address?: InputMaybe; + weight?: InputMaybe; }; /** Ordering options when selecting data from "proposal_vote". */ @@ -5352,6 +5359,7 @@ export type Proposal_Vote_Order_By = { proposal_id?: InputMaybe; timestamp?: InputMaybe; voter_address?: InputMaybe; + weight?: InputMaybe; }; /** select columns of table "proposal_vote" */ @@ -5365,7 +5373,9 @@ export enum Proposal_Vote_Select_Column { /** column name */ Timestamp = 'timestamp', /** column name */ - VoterAddress = 'voter_address' + VoterAddress = 'voter_address', + /** column name */ + Weight = 'weight' } /** aggregate stddev on columns */ @@ -12264,6 +12274,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: any }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -13202,6 +13242,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-emoney/src/graphql/general/message_types.graphql b/apps/web-emoney/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-emoney/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-emoney/src/graphql/types/general_types.ts b/apps/web-emoney/src/graphql/types/general_types.ts index 5aa0b5e4d2..727559998e 100644 --- a/apps/web-emoney/src/graphql/types/general_types.ts +++ b/apps/web-emoney/src/graphql/types/general_types.ts @@ -3016,9 +3016,13 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; + /** An object relationship */ + transactionByPartitionIdTransactionHash?: Maybe; transaction_hash: Scalars['String']; type: Scalars['String']; value: Scalars['jsonb']; @@ -3076,8 +3080,10 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -3108,8 +3114,10 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -3165,6 +3173,142 @@ export type Message_Sum_Fields = { partition_id?: Maybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3196,6 +3340,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5323,10 +5479,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5904,6 +6072,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5924,6 +6110,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6984,10 +7210,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7479,6 +7717,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7499,6 +7755,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11672,6 +11968,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'emoney_inflation', inflation: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12610,6 +12936,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-evmos/src/graphql/general/message_types.graphql b/apps/web-evmos/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-evmos/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-evmos/src/graphql/types/general_types.ts b/apps/web-evmos/src/graphql/types/general_types.ts index a28a9708c9..537e7e6987 100644 --- a/apps/web-evmos/src/graphql/types/general_types.ts +++ b/apps/web-evmos/src/graphql/types/general_types.ts @@ -1894,6 +1894,7 @@ export type Double_Sign_Vote = { /** An aggregate relationship */ double_sign_evidences_aggregate: Double_Sign_Evidence_Aggregate; height: Scalars['bigint']; + id: Scalars['Int']; round: Scalars['Int']; signature: Scalars['String']; type: Scalars['smallint']; @@ -1992,6 +1993,7 @@ export type Double_Sign_Vote_Aggregate_Order_By = { export type Double_Sign_Vote_Avg_Fields = { __typename?: 'double_sign_vote_avg_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2000,6 +2002,7 @@ export type Double_Sign_Vote_Avg_Fields = { /** order by avg() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Avg_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2014,6 +2017,7 @@ export type Double_Sign_Vote_Bool_Exp = { doubleSignEvidencesByVoteBId?: InputMaybe; double_sign_evidences?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; signature?: InputMaybe; type?: InputMaybe; @@ -2027,6 +2031,7 @@ export type Double_Sign_Vote_Max_Fields = { __typename?: 'double_sign_vote_max_fields'; block_id?: Maybe; height?: Maybe; + id?: Maybe; round?: Maybe; signature?: Maybe; type?: Maybe; @@ -2038,6 +2043,7 @@ export type Double_Sign_Vote_Max_Fields = { export type Double_Sign_Vote_Max_Order_By = { block_id?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; signature?: InputMaybe; type?: InputMaybe; @@ -2050,6 +2056,7 @@ export type Double_Sign_Vote_Min_Fields = { __typename?: 'double_sign_vote_min_fields'; block_id?: Maybe; height?: Maybe; + id?: Maybe; round?: Maybe; signature?: Maybe; type?: Maybe; @@ -2061,6 +2068,7 @@ export type Double_Sign_Vote_Min_Fields = { export type Double_Sign_Vote_Min_Order_By = { block_id?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; signature?: InputMaybe; type?: InputMaybe; @@ -2074,6 +2082,7 @@ export type Double_Sign_Vote_Order_By = { doubleSignEvidencesByVoteBId_aggregate?: InputMaybe; double_sign_evidences_aggregate?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; signature?: InputMaybe; type?: InputMaybe; @@ -2089,6 +2098,8 @@ export enum Double_Sign_Vote_Select_Column { /** column name */ Height = 'height', /** column name */ + Id = 'id', + /** column name */ Round = 'round', /** column name */ Signature = 'signature', @@ -2104,6 +2115,7 @@ export enum Double_Sign_Vote_Select_Column { export type Double_Sign_Vote_Stddev_Fields = { __typename?: 'double_sign_vote_stddev_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2112,6 +2124,7 @@ export type Double_Sign_Vote_Stddev_Fields = { /** order by stddev() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Stddev_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2121,6 +2134,7 @@ export type Double_Sign_Vote_Stddev_Order_By = { export type Double_Sign_Vote_Stddev_Pop_Fields = { __typename?: 'double_sign_vote_stddev_pop_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2129,6 +2143,7 @@ export type Double_Sign_Vote_Stddev_Pop_Fields = { /** order by stddev_pop() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Stddev_Pop_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2138,6 +2153,7 @@ export type Double_Sign_Vote_Stddev_Pop_Order_By = { export type Double_Sign_Vote_Stddev_Samp_Fields = { __typename?: 'double_sign_vote_stddev_samp_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2146,6 +2162,7 @@ export type Double_Sign_Vote_Stddev_Samp_Fields = { /** order by stddev_samp() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Stddev_Samp_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2155,6 +2172,7 @@ export type Double_Sign_Vote_Stddev_Samp_Order_By = { export type Double_Sign_Vote_Sum_Fields = { __typename?: 'double_sign_vote_sum_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2163,6 +2181,7 @@ export type Double_Sign_Vote_Sum_Fields = { /** order by sum() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Sum_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2172,6 +2191,7 @@ export type Double_Sign_Vote_Sum_Order_By = { export type Double_Sign_Vote_Var_Pop_Fields = { __typename?: 'double_sign_vote_var_pop_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2180,6 +2200,7 @@ export type Double_Sign_Vote_Var_Pop_Fields = { /** order by var_pop() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Var_Pop_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2189,6 +2210,7 @@ export type Double_Sign_Vote_Var_Pop_Order_By = { export type Double_Sign_Vote_Var_Samp_Fields = { __typename?: 'double_sign_vote_var_samp_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2197,6 +2219,7 @@ export type Double_Sign_Vote_Var_Samp_Fields = { /** order by var_samp() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Var_Samp_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; @@ -2206,6 +2229,7 @@ export type Double_Sign_Vote_Var_Samp_Order_By = { export type Double_Sign_Vote_Variance_Fields = { __typename?: 'double_sign_vote_variance_fields'; height?: Maybe; + id?: Maybe; round?: Maybe; type?: Maybe; validator_index?: Maybe; @@ -2214,11 +2238,313 @@ export type Double_Sign_Vote_Variance_Fields = { /** order by variance() on columns of table "double_sign_vote" */ export type Double_Sign_Vote_Variance_Order_By = { height?: InputMaybe; + id?: InputMaybe; round?: InputMaybe; type?: InputMaybe; validator_index?: InputMaybe; }; +/** columns and relationships of "evmos_inflation_data" */ +export type Evmos_Inflation_Data = { + __typename?: 'evmos_inflation_data'; + circulating_supply: Scalars['_dec_coin']; + height: Scalars['bigint']; + inflation_period: Scalars['Int']; + inflation_rate: Scalars['numeric']; + one_row_id: Scalars['Boolean']; + skipped_epochs: Scalars['Int']; +}; + +/** aggregated selection of "evmos_inflation_data" */ +export type Evmos_Inflation_Data_Aggregate = { + __typename?: 'evmos_inflation_data_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "evmos_inflation_data" */ +export type Evmos_Inflation_Data_Aggregate_Fields = { + __typename?: 'evmos_inflation_data_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "evmos_inflation_data" */ +export type Evmos_Inflation_Data_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Evmos_Inflation_Data_Avg_Fields = { + __typename?: 'evmos_inflation_data_avg_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** Boolean expression to filter rows from the table "evmos_inflation_data". All fields are combined with a logical 'AND'. */ +export type Evmos_Inflation_Data_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + circulating_supply?: InputMaybe<_Dec_Coin_Comparison_Exp>; + height?: InputMaybe; + inflation_period?: InputMaybe; + inflation_rate?: InputMaybe; + one_row_id?: InputMaybe; + skipped_epochs?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Evmos_Inflation_Data_Max_Fields = { + __typename?: 'evmos_inflation_data_max_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate min on columns */ +export type Evmos_Inflation_Data_Min_Fields = { + __typename?: 'evmos_inflation_data_min_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** Ordering options when selecting data from "evmos_inflation_data". */ +export type Evmos_Inflation_Data_Order_By = { + circulating_supply?: InputMaybe; + height?: InputMaybe; + inflation_period?: InputMaybe; + inflation_rate?: InputMaybe; + one_row_id?: InputMaybe; + skipped_epochs?: InputMaybe; +}; + +/** select columns of table "evmos_inflation_data" */ +export enum Evmos_Inflation_Data_Select_Column { + /** column name */ + CirculatingSupply = 'circulating_supply', + /** column name */ + Height = 'height', + /** column name */ + InflationPeriod = 'inflation_period', + /** column name */ + InflationRate = 'inflation_rate', + /** column name */ + OneRowId = 'one_row_id', + /** column name */ + SkippedEpochs = 'skipped_epochs' +} + +/** aggregate stddev on columns */ +export type Evmos_Inflation_Data_Stddev_Fields = { + __typename?: 'evmos_inflation_data_stddev_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Evmos_Inflation_Data_Stddev_Pop_Fields = { + __typename?: 'evmos_inflation_data_stddev_pop_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Evmos_Inflation_Data_Stddev_Samp_Fields = { + __typename?: 'evmos_inflation_data_stddev_samp_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate sum on columns */ +export type Evmos_Inflation_Data_Sum_Fields = { + __typename?: 'evmos_inflation_data_sum_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Evmos_Inflation_Data_Var_Pop_Fields = { + __typename?: 'evmos_inflation_data_var_pop_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Evmos_Inflation_Data_Var_Samp_Fields = { + __typename?: 'evmos_inflation_data_var_samp_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** aggregate variance on columns */ +export type Evmos_Inflation_Data_Variance_Fields = { + __typename?: 'evmos_inflation_data_variance_fields'; + height?: Maybe; + inflation_period?: Maybe; + inflation_rate?: Maybe; + skipped_epochs?: Maybe; +}; + +/** columns and relationships of "evmos_inflation_params" */ +export type Evmos_Inflation_Params = { + __typename?: 'evmos_inflation_params'; + height: Scalars['bigint']; + one_row_id: Scalars['Boolean']; + params: Scalars['jsonb']; +}; + + +/** columns and relationships of "evmos_inflation_params" */ +export type Evmos_Inflation_ParamsParamsArgs = { + path?: InputMaybe; +}; + +/** aggregated selection of "evmos_inflation_params" */ +export type Evmos_Inflation_Params_Aggregate = { + __typename?: 'evmos_inflation_params_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "evmos_inflation_params" */ +export type Evmos_Inflation_Params_Aggregate_Fields = { + __typename?: 'evmos_inflation_params_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "evmos_inflation_params" */ +export type Evmos_Inflation_Params_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Evmos_Inflation_Params_Avg_Fields = { + __typename?: 'evmos_inflation_params_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "evmos_inflation_params". All fields are combined with a logical 'AND'. */ +export type Evmos_Inflation_Params_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + one_row_id?: InputMaybe; + params?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Evmos_Inflation_Params_Max_Fields = { + __typename?: 'evmos_inflation_params_max_fields'; + height?: Maybe; +}; + +/** aggregate min on columns */ +export type Evmos_Inflation_Params_Min_Fields = { + __typename?: 'evmos_inflation_params_min_fields'; + height?: Maybe; +}; + +/** Ordering options when selecting data from "evmos_inflation_params". */ +export type Evmos_Inflation_Params_Order_By = { + height?: InputMaybe; + one_row_id?: InputMaybe; + params?: InputMaybe; +}; + +/** select columns of table "evmos_inflation_params" */ +export enum Evmos_Inflation_Params_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + OneRowId = 'one_row_id', + /** column name */ + Params = 'params' +} + +/** aggregate stddev on columns */ +export type Evmos_Inflation_Params_Stddev_Fields = { + __typename?: 'evmos_inflation_params_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Evmos_Inflation_Params_Stddev_Pop_Fields = { + __typename?: 'evmos_inflation_params_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Evmos_Inflation_Params_Stddev_Samp_Fields = { + __typename?: 'evmos_inflation_params_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Evmos_Inflation_Params_Sum_Fields = { + __typename?: 'evmos_inflation_params_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Evmos_Inflation_Params_Var_Pop_Fields = { + __typename?: 'evmos_inflation_params_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Evmos_Inflation_Params_Var_Samp_Fields = { + __typename?: 'evmos_inflation_params_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Evmos_Inflation_Params_Variance_Fields = { + __typename?: 'evmos_inflation_params_variance_fields'; + height?: Maybe; +}; + /** columns and relationships of "fee_grant_allowance" */ export type Fee_Grant_Allowance = { __typename?: 'fee_grant_allowance'; @@ -2230,6 +2556,7 @@ export type Fee_Grant_Allowance = { granter: Account; granter_address: Scalars['String']; height: Scalars['bigint']; + id: Scalars['Int']; }; @@ -2287,11 +2614,13 @@ export type Fee_Grant_Allowance_Aggregate_Order_By = { export type Fee_Grant_Allowance_Avg_Fields = { __typename?: 'fee_grant_allowance_avg_fields'; height?: Maybe; + id?: Maybe; }; /** order by avg() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Avg_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** Boolean expression to filter rows from the table "fee_grant_allowance". All fields are combined with a logical 'AND'. */ @@ -2305,6 +2634,7 @@ export type Fee_Grant_Allowance_Bool_Exp = { granter?: InputMaybe; granter_address?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; }; /** aggregate max on columns */ @@ -2313,6 +2643,7 @@ export type Fee_Grant_Allowance_Max_Fields = { grantee_address?: Maybe; granter_address?: Maybe; height?: Maybe; + id?: Maybe; }; /** order by max() on columns of table "fee_grant_allowance" */ @@ -2320,6 +2651,7 @@ export type Fee_Grant_Allowance_Max_Order_By = { grantee_address?: InputMaybe; granter_address?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; }; /** aggregate min on columns */ @@ -2328,6 +2660,7 @@ export type Fee_Grant_Allowance_Min_Fields = { grantee_address?: Maybe; granter_address?: Maybe; height?: Maybe; + id?: Maybe; }; /** order by min() on columns of table "fee_grant_allowance" */ @@ -2335,6 +2668,7 @@ export type Fee_Grant_Allowance_Min_Order_By = { grantee_address?: InputMaybe; granter_address?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; }; /** Ordering options when selecting data from "fee_grant_allowance". */ @@ -2345,6 +2679,7 @@ export type Fee_Grant_Allowance_Order_By = { granter?: InputMaybe; granter_address?: InputMaybe; height?: InputMaybe; + id?: InputMaybe; }; /** select columns of table "fee_grant_allowance" */ @@ -2356,84 +2691,100 @@ export enum Fee_Grant_Allowance_Select_Column { /** column name */ GranterAddress = 'granter_address', /** column name */ - Height = 'height' + Height = 'height', + /** column name */ + Id = 'id' } /** aggregate stddev on columns */ export type Fee_Grant_Allowance_Stddev_Fields = { __typename?: 'fee_grant_allowance_stddev_fields'; height?: Maybe; + id?: Maybe; }; /** order by stddev() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Stddev_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** aggregate stddev_pop on columns */ export type Fee_Grant_Allowance_Stddev_Pop_Fields = { __typename?: 'fee_grant_allowance_stddev_pop_fields'; height?: Maybe; + id?: Maybe; }; /** order by stddev_pop() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Stddev_Pop_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** aggregate stddev_samp on columns */ export type Fee_Grant_Allowance_Stddev_Samp_Fields = { __typename?: 'fee_grant_allowance_stddev_samp_fields'; height?: Maybe; + id?: Maybe; }; /** order by stddev_samp() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Stddev_Samp_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** aggregate sum on columns */ export type Fee_Grant_Allowance_Sum_Fields = { __typename?: 'fee_grant_allowance_sum_fields'; height?: Maybe; + id?: Maybe; }; /** order by sum() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Sum_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** aggregate var_pop on columns */ export type Fee_Grant_Allowance_Var_Pop_Fields = { __typename?: 'fee_grant_allowance_var_pop_fields'; height?: Maybe; + id?: Maybe; }; /** order by var_pop() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Var_Pop_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** aggregate var_samp on columns */ export type Fee_Grant_Allowance_Var_Samp_Fields = { __typename?: 'fee_grant_allowance_var_samp_fields'; height?: Maybe; + id?: Maybe; }; /** order by var_samp() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Var_Samp_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** aggregate variance on columns */ export type Fee_Grant_Allowance_Variance_Fields = { __typename?: 'fee_grant_allowance_variance_fields'; height?: Maybe; + id?: Maybe; }; /** order by variance() on columns of table "fee_grant_allowance" */ export type Fee_Grant_Allowance_Variance_Order_By = { height?: InputMaybe; + id?: InputMaybe; }; /** columns and relationships of "genesis" */ @@ -2843,6 +3194,9 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + partition_id: Scalars['bigint']; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -2907,12 +3261,14 @@ export type Message_Avg_Fields = { __typename?: 'message_avg_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by avg() on columns of table "message" */ export type Message_Avg_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; /** Boolean expression to filter rows from the table "message". All fields are combined with a logical 'AND'. */ @@ -2923,6 +3279,8 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; + partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -2935,6 +3293,7 @@ export type Message_Max_Fields = { __typename?: 'message_max_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; transaction_hash?: Maybe; type?: Maybe; }; @@ -2943,6 +3302,7 @@ export type Message_Max_Fields = { export type Message_Max_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; }; @@ -2952,6 +3312,7 @@ export type Message_Min_Fields = { __typename?: 'message_min_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; transaction_hash?: Maybe; type?: Maybe; }; @@ -2960,6 +3321,7 @@ export type Message_Min_Fields = { export type Message_Min_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; }; @@ -2969,6 +3331,8 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; + partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -2985,6 +3349,8 @@ export enum Message_Select_Column { /** column name */ InvolvedAccountsAddresses = 'involved_accounts_addresses', /** column name */ + PartitionId = 'partition_id', + /** column name */ TransactionHash = 'transaction_hash', /** column name */ Type = 'type', @@ -2997,12 +3363,14 @@ export type Message_Stddev_Fields = { __typename?: 'message_stddev_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by stddev() on columns of table "message" */ export type Message_Stddev_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; /** aggregate stddev_pop on columns */ @@ -3010,12 +3378,14 @@ export type Message_Stddev_Pop_Fields = { __typename?: 'message_stddev_pop_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by stddev_pop() on columns of table "message" */ export type Message_Stddev_Pop_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; /** aggregate stddev_samp on columns */ @@ -3023,12 +3393,14 @@ export type Message_Stddev_Samp_Fields = { __typename?: 'message_stddev_samp_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by stddev_samp() on columns of table "message" */ export type Message_Stddev_Samp_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; /** aggregate sum on columns */ @@ -3036,12 +3408,150 @@ export type Message_Sum_Fields = { __typename?: 'message_sum_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by sum() on columns of table "message" */ export type Message_Sum_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; +}; + +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; }; /** aggregate var_pop on columns */ @@ -3049,12 +3559,14 @@ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; /** aggregate var_samp on columns */ @@ -3062,12 +3574,14 @@ export type Message_Var_Samp_Fields = { __typename?: 'message_var_samp_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by var_samp() on columns of table "message" */ export type Message_Var_Samp_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; /** aggregate variance on columns */ @@ -3075,12 +3589,14 @@ export type Message_Variance_Fields = { __typename?: 'message_variance_fields'; height?: Maybe; index?: Maybe; + partition_id?: Maybe; }; /** order by variance() on columns of table "message" */ export type Message_Variance_Order_By = { height?: InputMaybe; index?: InputMaybe; + partition_id?: InputMaybe; }; export type Messages_By_Address_Args = { @@ -3090,31 +3606,12 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; -export type Messages_By_Single_Address_Args = { - address?: InputMaybe; - apikey?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; - types?: InputMaybe; -}; - -export type Messages_By_Types_Args = { +export type Messages_By_Type_Args = { limit?: InputMaybe; offset?: InputMaybe; types?: InputMaybe; }; -export type Messages_Get_Types_Args = { - limit?: InputMaybe; - offset?: InputMaybe; -}; - -export type Messages_Get_Types_New_Args = { - addresses?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; -}; - export type Messages_Types_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -3253,6 +3750,28 @@ export type Modules = { module_name: Scalars['String']; }; +/** aggregated selection of "modules" */ +export type Modules_Aggregate = { + __typename?: 'modules_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "modules" */ +export type Modules_Aggregate_Fields = { + __typename?: 'modules_aggregate_fields'; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "modules" */ +export type Modules_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "modules". All fields are combined with a logical 'AND'. */ export type Modules_Bool_Exp = { _and?: InputMaybe>; @@ -3261,6 +3780,18 @@ export type Modules_Bool_Exp = { module_name?: InputMaybe; }; +/** aggregate max on columns */ +export type Modules_Max_Fields = { + __typename?: 'modules_max_fields'; + module_name?: Maybe; +}; + +/** aggregate min on columns */ +export type Modules_Min_Fields = { + __typename?: 'modules_min_fields'; + module_name?: Maybe; +}; + /** Ordering options when selecting data from "modules". */ export type Modules_Order_By = { module_name?: InputMaybe; @@ -3769,12 +4300,11 @@ export type Proposal_Deposit = { /** An object relationship */ depositor?: Maybe; depositor_address?: Maybe; - height: Scalars['bigint']; + height?: Maybe; /** An object relationship */ proposal: Proposal; proposal_id: Scalars['Int']; timestamp?: Maybe; - transaction_hash: Scalars['String']; }; /** aggregated selection of "proposal_deposit" */ @@ -3848,7 +4378,6 @@ export type Proposal_Deposit_Bool_Exp = { proposal?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; - transaction_hash?: InputMaybe; }; /** aggregate max on columns */ @@ -3858,7 +4387,6 @@ export type Proposal_Deposit_Max_Fields = { height?: Maybe; proposal_id?: Maybe; timestamp?: Maybe; - transaction_hash?: Maybe; }; /** order by max() on columns of table "proposal_deposit" */ @@ -3867,7 +4395,6 @@ export type Proposal_Deposit_Max_Order_By = { height?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; - transaction_hash?: InputMaybe; }; /** aggregate min on columns */ @@ -3877,7 +4404,6 @@ export type Proposal_Deposit_Min_Fields = { height?: Maybe; proposal_id?: Maybe; timestamp?: Maybe; - transaction_hash?: Maybe; }; /** order by min() on columns of table "proposal_deposit" */ @@ -3886,7 +4412,6 @@ export type Proposal_Deposit_Min_Order_By = { height?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; - transaction_hash?: InputMaybe; }; /** Ordering options when selecting data from "proposal_deposit". */ @@ -3899,7 +4424,6 @@ export type Proposal_Deposit_Order_By = { proposal?: InputMaybe; proposal_id?: InputMaybe; timestamp?: InputMaybe; - transaction_hash?: InputMaybe; }; /** select columns of table "proposal_deposit" */ @@ -3913,9 +4437,7 @@ export enum Proposal_Deposit_Select_Column { /** column name */ ProposalId = 'proposal_id', /** column name */ - Timestamp = 'timestamp', - /** column name */ - TransactionHash = 'transaction_hash' + Timestamp = 'timestamp' } /** aggregate stddev on columns */ @@ -5165,6 +5687,8 @@ export type Query_Root = { distribution_params: Array; /** fetch aggregated fields from the table: "distribution_params" */ distribution_params_aggregate: Distribution_Params_Aggregate; + /** fetch data from the table: "distribution_params" using primary key columns */ + distribution_params_by_pk?: Maybe; /** fetch data from the table: "double_sign_evidence" */ double_sign_evidence: Array; /** fetch aggregated fields from the table: "double_sign_evidence" */ @@ -5173,10 +5697,26 @@ export type Query_Root = { double_sign_vote: Array; /** fetch aggregated fields from the table: "double_sign_vote" */ double_sign_vote_aggregate: Double_Sign_Vote_Aggregate; + /** fetch data from the table: "double_sign_vote" using primary key columns */ + double_sign_vote_by_pk?: Maybe; + /** fetch data from the table: "evmos_inflation_data" */ + evmos_inflation_data: Array; + /** fetch aggregated fields from the table: "evmos_inflation_data" */ + evmos_inflation_data_aggregate: Evmos_Inflation_Data_Aggregate; + /** fetch data from the table: "evmos_inflation_data" using primary key columns */ + evmos_inflation_data_by_pk?: Maybe; + /** fetch data from the table: "evmos_inflation_params" */ + evmos_inflation_params: Array; + /** fetch aggregated fields from the table: "evmos_inflation_params" */ + evmos_inflation_params_aggregate: Evmos_Inflation_Params_Aggregate; + /** fetch data from the table: "evmos_inflation_params" using primary key columns */ + evmos_inflation_params_by_pk?: Maybe; /** fetch data from the table: "fee_grant_allowance" */ fee_grant_allowance: Array; /** fetch aggregated fields from the table: "fee_grant_allowance" */ fee_grant_allowance_aggregate: Fee_Grant_Allowance_Aggregate; + /** fetch data from the table: "fee_grant_allowance" using primary key columns */ + fee_grant_allowance_by_pk?: Maybe; /** fetch data from the table: "genesis" */ genesis: Array; /** fetch aggregated fields from the table: "genesis" */ @@ -5185,6 +5725,8 @@ export type Query_Root = { gov_params: Array; /** fetch aggregated fields from the table: "gov_params" */ gov_params_aggregate: Gov_Params_Aggregate; + /** fetch data from the table: "gov_params" using primary key columns */ + gov_params_by_pk?: Maybe; /** fetch data from the table: "inflation" */ inflation: Array; /** fetch aggregated fields from the table: "inflation" */ @@ -5193,26 +5735,18 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; - /** execute function "messages_by_single_address" which returns "message" */ - messages_by_single_address: Array; - /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ - messages_by_single_address_aggregate: Message_Aggregate; - /** execute function "messages_by_types" which returns "message" */ - messages_by_types: Array; - /** execute function "messages_by_types" and query aggregates on result of table type "message" */ - messages_by_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types" which returns "message" */ - messages_get_types: Array; - /** execute function "messages_get_types" and query aggregates on result of table type "message" */ - messages_get_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types_new" which returns "message" */ - messages_get_types_new: Array; - /** execute function "messages_get_types_new" and query aggregates on result of table type "message" */ - messages_get_types_new_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ @@ -5221,8 +5755,12 @@ export type Query_Root = { mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ mint_params_aggregate: Mint_Params_Aggregate; + /** fetch data from the table: "mint_params" using primary key columns */ + mint_params_by_pk?: Maybe; /** fetch data from the table: "modules" */ modules: Array; + /** fetch aggregated fields from the table: "modules" */ + modules_aggregate: Modules_Aggregate; /** fetch data from the table: "modules" using primary key columns */ modules_by_pk?: Maybe; /** fetch data from the table: "pre_commit" */ @@ -5255,6 +5793,8 @@ export type Query_Root = { proposal_validator_status_snapshot: Array; /** fetch aggregated fields from the table: "proposal_validator_status_snapshot" */ proposal_validator_status_snapshot_aggregate: Proposal_Validator_Status_Snapshot_Aggregate; + /** fetch data from the table: "proposal_validator_status_snapshot" using primary key columns */ + proposal_validator_status_snapshot_by_pk?: Maybe; /** fetch data from the table: "proposal_vote" */ proposal_vote: Array; /** fetch aggregated fields from the table: "proposal_vote" */ @@ -5263,7 +5803,9 @@ export type Query_Root = { slashing_params: Array; /** fetch aggregated fields from the table: "slashing_params" */ slashing_params_aggregate: Slashing_Params_Aggregate; - /** fetch data from the table: "software_upgrade_plan" */ + /** fetch data from the table: "slashing_params" using primary key columns */ + slashing_params_by_pk?: Maybe; + /** fetch data from the table: "software_upgrade_plan" */ software_upgrade_plan: Array; /** fetch aggregated fields from the table: "software_upgrade_plan" */ software_upgrade_plan_aggregate: Software_Upgrade_Plan_Aggregate; @@ -5271,6 +5813,8 @@ export type Query_Root = { staking_params: Array; /** fetch aggregated fields from the table: "staking_params" */ staking_params_aggregate: Staking_Params_Aggregate; + /** fetch data from the table: "staking_params" using primary key columns */ + staking_params_by_pk?: Maybe; /** fetch data from the table: "staking_pool" */ staking_pool: Array; /** fetch aggregated fields from the table: "staking_pool" */ @@ -5279,7 +5823,6 @@ export type Query_Root = { supply: Array; /** fetch aggregated fields from the table: "supply" */ supply_aggregate: Supply_Aggregate; - test_action_account_balance?: Maybe; /** fetch data from the table: "token" */ token: Array; /** fetch aggregated fields from the table: "token" */ @@ -5288,6 +5831,8 @@ export type Query_Root = { token_price: Array; /** fetch aggregated fields from the table: "token_price" */ token_price_aggregate: Token_Price_Aggregate; + /** fetch data from the table: "token_price" using primary key columns */ + token_price_by_pk?: Maybe; /** fetch data from the table: "token_price_history" */ token_price_history: Array; /** fetch aggregated fields from the table: "token_price_history" */ @@ -5346,6 +5891,8 @@ export type Query_Root = { vesting_account: Array; /** fetch aggregated fields from the table: "vesting_account" */ vesting_account_aggregate: Vesting_Account_Aggregate; + /** fetch data from the table: "vesting_account" using primary key columns */ + vesting_account_by_pk?: Maybe; /** fetch data from the table: "vesting_period" */ vesting_period: Array; /** fetch aggregated fields from the table: "vesting_period" */ @@ -5623,6 +6170,11 @@ export type Query_RootDistribution_Params_AggregateArgs = { }; +export type Query_RootDistribution_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Query_RootDouble_Sign_EvidenceArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -5659,6 +6211,57 @@ export type Query_RootDouble_Sign_Vote_AggregateArgs = { }; +export type Query_RootDouble_Sign_Vote_By_PkArgs = { + id: Scalars['Int']; +}; + + +export type Query_RootEvmos_Inflation_DataArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootEvmos_Inflation_Data_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootEvmos_Inflation_Data_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + +export type Query_RootEvmos_Inflation_ParamsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootEvmos_Inflation_Params_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootEvmos_Inflation_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Query_RootFee_Grant_AllowanceArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -5677,6 +6280,11 @@ export type Query_RootFee_Grant_Allowance_AggregateArgs = { }; +export type Query_RootFee_Grant_Allowance_By_PkArgs = { + id: Scalars['Int']; +}; + + export type Query_RootGenesisArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -5713,6 +6321,11 @@ export type Query_RootGov_Params_AggregateArgs = { }; +export type Query_RootGov_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Query_RootInflationArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -5749,68 +6362,26 @@ export type Query_RootMessage_AggregateArgs = { }; -export type Query_RootMessages_By_AddressArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Query_RootMessages_By_Address_AggregateArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootMessages_By_Single_AddressArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootMessages_By_Single_Address_AggregateArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootMessages_By_TypesArgs = { - args: Messages_By_Types_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootMessages_By_Types_AggregateArgs = { - args: Messages_By_Types_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Query_RootMessages_Get_TypesArgs = { - args: Messages_Get_Types_Args; +export type Query_RootMessages_By_AddressArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5819,8 +6390,8 @@ export type Query_RootMessages_Get_TypesArgs = { }; -export type Query_RootMessages_Get_Types_AggregateArgs = { - args: Messages_Get_Types_Args; +export type Query_RootMessages_By_Address_AggregateArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5829,8 +6400,8 @@ export type Query_RootMessages_Get_Types_AggregateArgs = { }; -export type Query_RootMessages_Get_Types_NewArgs = { - args: Messages_Get_Types_New_Args; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5839,8 +6410,8 @@ export type Query_RootMessages_Get_Types_NewArgs = { }; -export type Query_RootMessages_Get_Types_New_AggregateArgs = { - args: Messages_Get_Types_New_Args; +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5887,6 +6458,11 @@ export type Query_RootMint_Params_AggregateArgs = { }; +export type Query_RootMint_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Query_RootModulesArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -5896,6 +6472,15 @@ export type Query_RootModulesArgs = { }; +export type Query_RootModules_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootModules_By_PkArgs = { module_name: Scalars['String']; }; @@ -6024,6 +6609,11 @@ export type Query_RootProposal_Validator_Status_Snapshot_AggregateArgs = { }; +export type Query_RootProposal_Validator_Status_Snapshot_By_PkArgs = { + id: Scalars['Int']; +}; + + export type Query_RootProposal_VoteArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6096,6 +6686,11 @@ export type Query_RootStaking_Params_AggregateArgs = { }; +export type Query_RootStaking_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Query_RootStaking_PoolArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6132,13 +6727,6 @@ export type Query_RootSupply_AggregateArgs = { }; -export type Query_RootTest_Action_Account_BalanceArgs = { - address: Scalars['String']; - apikey?: InputMaybe; - height?: InputMaybe; -}; - - export type Query_RootTokenArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6175,6 +6763,11 @@ export type Query_RootToken_Price_AggregateArgs = { }; +export type Query_RootToken_Price_By_PkArgs = { + id: Scalars['Int']; +}; + + export type Query_RootToken_Price_HistoryArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6408,6 +7001,11 @@ export type Query_RootVesting_Account_AggregateArgs = { }; +export type Query_RootVesting_Account_By_PkArgs = { + id: Scalars['Int']; +}; + + export type Query_RootVesting_PeriodArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6426,6 +7024,7 @@ export type Query_RootVesting_Period_AggregateArgs = { }; + export type Query_RootWasm_CodeArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6936,8 +7535,8 @@ export type Staking_Pool = { bonded_tokens: Scalars['String']; height: Scalars['bigint']; not_bonded_tokens: Scalars['String']; - staked_not_bonded_tokens?: Maybe; - unbonding_tokens?: Maybe; + staked_not_bonded_tokens: Scalars['String']; + unbonding_tokens: Scalars['String']; }; /** aggregated selection of "staking_pool" */ @@ -7111,6 +7710,8 @@ export type Subscription_Root = { distribution_params: Array; /** fetch aggregated fields from the table: "distribution_params" */ distribution_params_aggregate: Distribution_Params_Aggregate; + /** fetch data from the table: "distribution_params" using primary key columns */ + distribution_params_by_pk?: Maybe; /** fetch data from the table: "double_sign_evidence" */ double_sign_evidence: Array; /** fetch aggregated fields from the table: "double_sign_evidence" */ @@ -7119,10 +7720,26 @@ export type Subscription_Root = { double_sign_vote: Array; /** fetch aggregated fields from the table: "double_sign_vote" */ double_sign_vote_aggregate: Double_Sign_Vote_Aggregate; + /** fetch data from the table: "double_sign_vote" using primary key columns */ + double_sign_vote_by_pk?: Maybe; + /** fetch data from the table: "evmos_inflation_data" */ + evmos_inflation_data: Array; + /** fetch aggregated fields from the table: "evmos_inflation_data" */ + evmos_inflation_data_aggregate: Evmos_Inflation_Data_Aggregate; + /** fetch data from the table: "evmos_inflation_data" using primary key columns */ + evmos_inflation_data_by_pk?: Maybe; + /** fetch data from the table: "evmos_inflation_params" */ + evmos_inflation_params: Array; + /** fetch aggregated fields from the table: "evmos_inflation_params" */ + evmos_inflation_params_aggregate: Evmos_Inflation_Params_Aggregate; + /** fetch data from the table: "evmos_inflation_params" using primary key columns */ + evmos_inflation_params_by_pk?: Maybe; /** fetch data from the table: "fee_grant_allowance" */ fee_grant_allowance: Array; /** fetch aggregated fields from the table: "fee_grant_allowance" */ fee_grant_allowance_aggregate: Fee_Grant_Allowance_Aggregate; + /** fetch data from the table: "fee_grant_allowance" using primary key columns */ + fee_grant_allowance_by_pk?: Maybe; /** fetch data from the table: "genesis" */ genesis: Array; /** fetch aggregated fields from the table: "genesis" */ @@ -7131,6 +7748,8 @@ export type Subscription_Root = { gov_params: Array; /** fetch aggregated fields from the table: "gov_params" */ gov_params_aggregate: Gov_Params_Aggregate; + /** fetch data from the table: "gov_params" using primary key columns */ + gov_params_by_pk?: Maybe; /** fetch data from the table: "inflation" */ inflation: Array; /** fetch aggregated fields from the table: "inflation" */ @@ -7139,26 +7758,18 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; - /** execute function "messages_by_single_address" which returns "message" */ - messages_by_single_address: Array; - /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ - messages_by_single_address_aggregate: Message_Aggregate; - /** execute function "messages_by_types" which returns "message" */ - messages_by_types: Array; - /** execute function "messages_by_types" and query aggregates on result of table type "message" */ - messages_by_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types" which returns "message" */ - messages_get_types: Array; - /** execute function "messages_get_types" and query aggregates on result of table type "message" */ - messages_get_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types_new" which returns "message" */ - messages_get_types_new: Array; - /** execute function "messages_get_types_new" and query aggregates on result of table type "message" */ - messages_get_types_new_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ @@ -7167,8 +7778,12 @@ export type Subscription_Root = { mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ mint_params_aggregate: Mint_Params_Aggregate; + /** fetch data from the table: "mint_params" using primary key columns */ + mint_params_by_pk?: Maybe; /** fetch data from the table: "modules" */ modules: Array; + /** fetch aggregated fields from the table: "modules" */ + modules_aggregate: Modules_Aggregate; /** fetch data from the table: "modules" using primary key columns */ modules_by_pk?: Maybe; /** fetch data from the table: "pre_commit" */ @@ -7201,6 +7816,8 @@ export type Subscription_Root = { proposal_validator_status_snapshot: Array; /** fetch aggregated fields from the table: "proposal_validator_status_snapshot" */ proposal_validator_status_snapshot_aggregate: Proposal_Validator_Status_Snapshot_Aggregate; + /** fetch data from the table: "proposal_validator_status_snapshot" using primary key columns */ + proposal_validator_status_snapshot_by_pk?: Maybe; /** fetch data from the table: "proposal_vote" */ proposal_vote: Array; /** fetch aggregated fields from the table: "proposal_vote" */ @@ -7209,7 +7826,9 @@ export type Subscription_Root = { slashing_params: Array; /** fetch aggregated fields from the table: "slashing_params" */ slashing_params_aggregate: Slashing_Params_Aggregate; - /** fetch data from the table: "software_upgrade_plan" */ + /** fetch data from the table: "slashing_params" using primary key columns */ + slashing_params_by_pk?: Maybe; + /** fetch data from the table: "software_upgrade_plan" */ software_upgrade_plan: Array; /** fetch aggregated fields from the table: "software_upgrade_plan" */ software_upgrade_plan_aggregate: Software_Upgrade_Plan_Aggregate; @@ -7217,6 +7836,8 @@ export type Subscription_Root = { staking_params: Array; /** fetch aggregated fields from the table: "staking_params" */ staking_params_aggregate: Staking_Params_Aggregate; + /** fetch data from the table: "staking_params" using primary key columns */ + staking_params_by_pk?: Maybe; /** fetch data from the table: "staking_pool" */ staking_pool: Array; /** fetch aggregated fields from the table: "staking_pool" */ @@ -7233,6 +7854,8 @@ export type Subscription_Root = { token_price: Array; /** fetch aggregated fields from the table: "token_price" */ token_price_aggregate: Token_Price_Aggregate; + /** fetch data from the table: "token_price" using primary key columns */ + token_price_by_pk?: Maybe; /** fetch data from the table: "token_price_history" */ token_price_history: Array; /** fetch aggregated fields from the table: "token_price_history" */ @@ -7291,10 +7914,12 @@ export type Subscription_Root = { vesting_account: Array; /** fetch aggregated fields from the table: "vesting_account" */ vesting_account_aggregate: Vesting_Account_Aggregate; + /** fetch data from the table: "vesting_account" using primary key columns */ + vesting_account_by_pk?: Maybe; /** fetch data from the table: "vesting_period" */ vesting_period: Array; /** fetch aggregated fields from the table: "vesting_period" */ - vesting_period_aggregate: Vesting_Period_Aggregate; + vesting_period_aggregate: Vesting_Period_Aggregate; /** fetch data from the table: "wasm_code" */ wasm_code: Array; /** fetch aggregated fields from the table: "wasm_code" */ @@ -7470,6 +8095,11 @@ export type Subscription_RootDistribution_Params_AggregateArgs = { }; +export type Subscription_RootDistribution_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Subscription_RootDouble_Sign_EvidenceArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7506,6 +8136,57 @@ export type Subscription_RootDouble_Sign_Vote_AggregateArgs = { }; +export type Subscription_RootDouble_Sign_Vote_By_PkArgs = { + id: Scalars['Int']; +}; + + +export type Subscription_RootEvmos_Inflation_DataArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootEvmos_Inflation_Data_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootEvmos_Inflation_Data_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + +export type Subscription_RootEvmos_Inflation_ParamsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootEvmos_Inflation_Params_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootEvmos_Inflation_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Subscription_RootFee_Grant_AllowanceArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7524,6 +8205,11 @@ export type Subscription_RootFee_Grant_Allowance_AggregateArgs = { }; +export type Subscription_RootFee_Grant_Allowance_By_PkArgs = { + id: Scalars['Int']; +}; + + export type Subscription_RootGenesisArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7560,6 +8246,11 @@ export type Subscription_RootGov_Params_AggregateArgs = { }; +export type Subscription_RootGov_Params_By_PkArgs = { + one_row_id: Scalars['Boolean']; +}; + + export type Subscription_RootInflationArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7596,88 +8287,26 @@ export type Subscription_RootMessage_AggregateArgs = { }; -export type Subscription_RootMessages_By_AddressArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_Address_AggregateArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_Single_AddressArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_TypesArgs = { - args: Messages_By_Types_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_Types_AggregateArgs = { - args: Messages_By_Types_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_Get_TypesArgs = { - args: Messages_Get_Types_Args; - distinct_on?: InputMaybe>; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Subscription_RootMessages_Get_Types_AggregateArgs = { - args: Messages_Get_Types_Args; - distinct_on?: InputMaybe>; +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Subscription_RootMessages_Get_Types_NewArgs = { - args: Messages_Get_Types_New_Args; +export type Subscription_RootMessages_By_AddressArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7686,8 +8315,8 @@ export type Subscription_RootMessages_Get_Types_NewArgs = { }; -export type Subscription_RootMessages_Get_Types_New_AggregateArgs = { - args: Messages_Get_Types_New_Args; +export type Subscription_RootMessages_By_Address_AggregateArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7695,7 +8324,6 @@ export type Subscription_RootMessages_Get_Types_New_AggregateArgs = { where?: InputMaybe; }; - export type Subscription_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; @@ -12821,6 +13449,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }>, evmosInflationData: Array<{ __typename?: 'evmos_inflation_data', circulating_supply: any, inflation_rate: any }>, evmosInflationParams: Array<{ __typename?: 'evmos_inflation_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -13766,6 +14424,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-gitopia/src/graphql/general/message_types.graphql b/apps/web-gitopia/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-gitopia/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-gitopia/src/graphql/types/general_types.ts b/apps/web-gitopia/src/graphql/types/general_types.ts index 7ccad12ff5..33b0a8cc57 100644 --- a/apps/web-gitopia/src/graphql/types/general_types.ts +++ b/apps/web-gitopia/src/graphql/types/general_types.ts @@ -170,6 +170,10 @@ export type Account = { __typename?: 'account'; address: Scalars['String']; /** An array relationship */ + feeGrantAllowancesByGranterAddress: Array; + /** An array relationship */ + fee_grant_allowances: Array; + /** An array relationship */ proposal_deposits: Array; /** An array relationship */ proposal_votes: Array; @@ -186,6 +190,26 @@ export type Account = { }; +/** columns and relationships of "account" */ +export type AccountFeeGrantAllowancesByGranterAddressArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "account" */ +export type AccountFee_Grant_AllowancesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "account" */ export type AccountProposal_DepositsArgs = { distinct_on?: InputMaybe>; @@ -251,6 +275,8 @@ export type Account_Bool_Exp = { _not?: InputMaybe; _or?: InputMaybe>; address?: InputMaybe; + feeGrantAllowancesByGranterAddress?: InputMaybe; + fee_grant_allowances?: InputMaybe; proposal_deposits?: InputMaybe; proposal_votes?: InputMaybe; proposals?: InputMaybe; @@ -262,6 +288,8 @@ export type Account_Bool_Exp = { /** Ordering options when selecting data from "account". */ export type Account_Order_By = { address?: InputMaybe; + feeGrantAllowancesByGranterAddress_aggregate?: InputMaybe; + fee_grant_allowances_aggregate?: InputMaybe; proposal_deposits_aggregate?: InputMaybe; proposal_votes_aggregate?: InputMaybe; proposals_aggregate?: InputMaybe; @@ -1049,6 +1077,26 @@ export type Fee_Grant_AllowanceAllowanceArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Avg_Order_By = { + height?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "fee_grant_allowance". All fields are combined with a logical 'AND'. */ export type Fee_Grant_Allowance_Bool_Exp = { _and?: InputMaybe>; @@ -1062,6 +1110,20 @@ export type Fee_Grant_Allowance_Bool_Exp = { height?: InputMaybe; }; +/** order by max() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Max_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + +/** order by min() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Min_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + /** Ordering options when selecting data from "fee_grant_allowance". */ export type Fee_Grant_Allowance_Order_By = { allowance?: InputMaybe; @@ -1084,6 +1146,41 @@ export enum Fee_Grant_Allowance_Select_Column { Height = 'height' } +/** order by stddev() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by sum() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Sum_Order_By = { + height?: InputMaybe; +}; + +/** order by var_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by var_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by variance() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Variance_Order_By = { + height?: InputMaybe; +}; + /** columns and relationships of "genesis" */ export type Genesis = { __typename?: 'genesis'; @@ -1237,7 +1334,11 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; + /** An object relationship */ + transactionByPartitionIdTransactionHash?: Maybe; transaction_hash: Scalars['String']; type: Scalars['String']; value: Scalars['jsonb']; @@ -1249,6 +1350,27 @@ export type MessageValueArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "message" */ +export type Message_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "message" */ +export type Message_Avg_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "message". All fields are combined with a logical 'AND'. */ export type Message_Bool_Exp = { _and?: InputMaybe>; @@ -1257,18 +1379,38 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; }; +/** order by max() on columns of table "message" */ +export type Message_Max_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + +/** order by min() on columns of table "message" */ +export type Message_Min_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + /** Ordering options when selecting data from "message". */ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -1290,6 +1432,184 @@ export enum Message_Select_Column { Value = 'value' } +/** order by stddev() on columns of table "message" */ +export type Message_Stddev_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "message" */ +export type Message_Stddev_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "message" */ +export type Message_Stddev_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by sum() on columns of table "message" */ +export type Message_Sum_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + +/** order by var_pop() on columns of table "message" */ +export type Message_Var_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by var_samp() on columns of table "message" */ +export type Message_Var_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by variance() on columns of table "message" */ +export type Message_Variance_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + export type Messages_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -1297,6 +1617,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2646,8 +2978,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -2970,6 +3310,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -2980,6 +3338,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3660,8 +4038,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3898,6 +4284,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3908,6 +4312,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4752,6 +5176,8 @@ export type Transaction = { logs?: Maybe; memo?: Maybe; messages: Scalars['jsonb']; + /** An array relationship */ + messagesByPartitionIdTransactionHash: Array; raw_log?: Maybe; signatures: Scalars['_text']; signer_infos: Scalars['jsonb']; @@ -4777,6 +5203,16 @@ export type TransactionMessagesArgs = { }; +/** columns and relationships of "transaction" */ +export type TransactionMessagesByPartitionIdTransactionHashArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "transaction" */ export type TransactionSigner_InfosArgs = { path?: InputMaybe; @@ -4818,6 +5254,7 @@ export type Transaction_Bool_Exp = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByPartitionIdTransactionHash?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe<_Text_Comparison_Exp>; signer_infos?: InputMaybe; @@ -4855,6 +5292,7 @@ export type Transaction_Order_By = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByPartitionIdTransactionHash_aggregate?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe; signer_infos?: InputMaybe; @@ -6435,6 +6873,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -7373,6 +7841,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-humansai/codegen.yml b/apps/web-humansai/codegen.yml index d9accf653f..b0e232f6ce 100644 --- a/apps/web-humansai/codegen.yml +++ b/apps/web-humansai/codegen.yml @@ -3,7 +3,7 @@ generates: ./src/graphql/types/general_types.ts: documents: - 'src/graphql/general/*' - schema: https://gql-testnet.humansai.forbole.com/v1/graphql + schema: https://gql.humansai.forbole.com/v1/graphql config: # omitOperationSuffix: true skipTypeNameForRoot: true diff --git a/apps/web-humansai/src/graphql/general/message_types.graphql b/apps/web-humansai/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-humansai/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-humansai/src/graphql/types/general_types.ts b/apps/web-humansai/src/graphql/types/general_types.ts index 801b6378e3..33b0a8cc57 100644 --- a/apps/web-humansai/src/graphql/types/general_types.ts +++ b/apps/web-humansai/src/graphql/types/general_types.ts @@ -170,6 +170,10 @@ export type Account = { __typename?: 'account'; address: Scalars['String']; /** An array relationship */ + feeGrantAllowancesByGranterAddress: Array; + /** An array relationship */ + fee_grant_allowances: Array; + /** An array relationship */ proposal_deposits: Array; /** An array relationship */ proposal_votes: Array; @@ -186,6 +190,26 @@ export type Account = { }; +/** columns and relationships of "account" */ +export type AccountFeeGrantAllowancesByGranterAddressArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "account" */ +export type AccountFee_Grant_AllowancesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "account" */ export type AccountProposal_DepositsArgs = { distinct_on?: InputMaybe>; @@ -251,6 +275,8 @@ export type Account_Bool_Exp = { _not?: InputMaybe; _or?: InputMaybe>; address?: InputMaybe; + feeGrantAllowancesByGranterAddress?: InputMaybe; + fee_grant_allowances?: InputMaybe; proposal_deposits?: InputMaybe; proposal_votes?: InputMaybe; proposals?: InputMaybe; @@ -262,6 +288,8 @@ export type Account_Bool_Exp = { /** Ordering options when selecting data from "account". */ export type Account_Order_By = { address?: InputMaybe; + feeGrantAllowancesByGranterAddress_aggregate?: InputMaybe; + fee_grant_allowances_aggregate?: InputMaybe; proposal_deposits_aggregate?: InputMaybe; proposal_votes_aggregate?: InputMaybe; proposals_aggregate?: InputMaybe; @@ -1049,6 +1077,26 @@ export type Fee_Grant_AllowanceAllowanceArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Avg_Order_By = { + height?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "fee_grant_allowance". All fields are combined with a logical 'AND'. */ export type Fee_Grant_Allowance_Bool_Exp = { _and?: InputMaybe>; @@ -1062,6 +1110,20 @@ export type Fee_Grant_Allowance_Bool_Exp = { height?: InputMaybe; }; +/** order by max() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Max_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + +/** order by min() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Min_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + /** Ordering options when selecting data from "fee_grant_allowance". */ export type Fee_Grant_Allowance_Order_By = { allowance?: InputMaybe; @@ -1084,6 +1146,41 @@ export enum Fee_Grant_Allowance_Select_Column { Height = 'height' } +/** order by stddev() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by sum() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Sum_Order_By = { + height?: InputMaybe; +}; + +/** order by var_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by var_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by variance() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Variance_Order_By = { + height?: InputMaybe; +}; + /** columns and relationships of "genesis" */ export type Genesis = { __typename?: 'genesis'; @@ -1237,7 +1334,11 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; + /** An object relationship */ + transactionByPartitionIdTransactionHash?: Maybe; transaction_hash: Scalars['String']; type: Scalars['String']; value: Scalars['jsonb']; @@ -1249,6 +1350,27 @@ export type MessageValueArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "message" */ +export type Message_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "message" */ +export type Message_Avg_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "message". All fields are combined with a logical 'AND'. */ export type Message_Bool_Exp = { _and?: InputMaybe>; @@ -1257,18 +1379,38 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; }; +/** order by max() on columns of table "message" */ +export type Message_Max_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + +/** order by min() on columns of table "message" */ +export type Message_Min_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + /** Ordering options when selecting data from "message". */ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -1290,6 +1432,184 @@ export enum Message_Select_Column { Value = 'value' } +/** order by stddev() on columns of table "message" */ +export type Message_Stddev_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "message" */ +export type Message_Stddev_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "message" */ +export type Message_Stddev_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by sum() on columns of table "message" */ +export type Message_Sum_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + +/** order by var_pop() on columns of table "message" */ +export type Message_Var_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by var_samp() on columns of table "message" */ +export type Message_Var_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by variance() on columns of table "message" */ +export type Message_Variance_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + export type Messages_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -1297,6 +1617,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2646,8 +2978,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -2686,8 +3026,6 @@ export type Query_Root = { software_upgrade_plan_aggregate: Software_Upgrade_Plan_Aggregate; /** fetch data from the table: "staking_params" */ staking_params: Array; - /** fetch aggregated fields from the table: "staking_params" */ - staking_params_aggregate: Staking_Params_Aggregate; /** fetch data from the table: "staking_pool" */ staking_pool: Array; /** fetch data from the table: "supply" */ @@ -2972,6 +3310,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -2982,6 +3338,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3137,15 +3513,6 @@ export type Query_RootStaking_ParamsArgs = { }; -export type Query_RootStaking_Params_AggregateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - export type Query_RootStaking_PoolArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3567,42 +3934,6 @@ export type Staking_ParamsParamsArgs = { path?: InputMaybe; }; -/** aggregated selection of "staking_params" */ -export type Staking_Params_Aggregate = { - __typename?: 'staking_params_aggregate'; - aggregate?: Maybe; - nodes: Array; -}; - -/** aggregate fields of "staking_params" */ -export type Staking_Params_Aggregate_Fields = { - __typename?: 'staking_params_aggregate_fields'; - avg?: Maybe; - count: Scalars['Int']; - max?: Maybe; - min?: Maybe; - stddev?: Maybe; - stddev_pop?: Maybe; - stddev_samp?: Maybe; - sum?: Maybe; - var_pop?: Maybe; - var_samp?: Maybe; - variance?: Maybe; -}; - - -/** aggregate fields of "staking_params" */ -export type Staking_Params_Aggregate_FieldsCountArgs = { - columns?: InputMaybe>; - distinct?: InputMaybe; -}; - -/** aggregate avg on columns */ -export type Staking_Params_Avg_Fields = { - __typename?: 'staking_params_avg_fields'; - height?: Maybe; -}; - /** Boolean expression to filter rows from the table "staking_params". All fields are combined with a logical 'AND'. */ export type Staking_Params_Bool_Exp = { _and?: InputMaybe>; @@ -3612,18 +3943,6 @@ export type Staking_Params_Bool_Exp = { params?: InputMaybe; }; -/** aggregate max on columns */ -export type Staking_Params_Max_Fields = { - __typename?: 'staking_params_max_fields'; - height?: Maybe; -}; - -/** aggregate min on columns */ -export type Staking_Params_Min_Fields = { - __typename?: 'staking_params_min_fields'; - height?: Maybe; -}; - /** Ordering options when selecting data from "staking_params". */ export type Staking_Params_Order_By = { height?: InputMaybe; @@ -3638,48 +3957,6 @@ export enum Staking_Params_Select_Column { Params = 'params' } -/** aggregate stddev on columns */ -export type Staking_Params_Stddev_Fields = { - __typename?: 'staking_params_stddev_fields'; - height?: Maybe; -}; - -/** aggregate stddev_pop on columns */ -export type Staking_Params_Stddev_Pop_Fields = { - __typename?: 'staking_params_stddev_pop_fields'; - height?: Maybe; -}; - -/** aggregate stddev_samp on columns */ -export type Staking_Params_Stddev_Samp_Fields = { - __typename?: 'staking_params_stddev_samp_fields'; - height?: Maybe; -}; - -/** aggregate sum on columns */ -export type Staking_Params_Sum_Fields = { - __typename?: 'staking_params_sum_fields'; - height?: Maybe; -}; - -/** aggregate var_pop on columns */ -export type Staking_Params_Var_Pop_Fields = { - __typename?: 'staking_params_var_pop_fields'; - height?: Maybe; -}; - -/** aggregate var_samp on columns */ -export type Staking_Params_Var_Samp_Fields = { - __typename?: 'staking_params_var_samp_fields'; - height?: Maybe; -}; - -/** aggregate variance on columns */ -export type Staking_Params_Variance_Fields = { - __typename?: 'staking_params_variance_fields'; - height?: Maybe; -}; - /** columns and relationships of "staking_pool" */ export type Staking_Pool = { __typename?: 'staking_pool'; @@ -3761,8 +4038,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3801,8 +4086,6 @@ export type Subscription_Root = { software_upgrade_plan_aggregate: Software_Upgrade_Plan_Aggregate; /** fetch data from the table: "staking_params" */ staking_params: Array; - /** fetch aggregated fields from the table: "staking_params" */ - staking_params_aggregate: Staking_Params_Aggregate; /** fetch data from the table: "staking_pool" */ staking_pool: Array; /** fetch data from the table: "supply" */ @@ -4001,6 +4284,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4011,6 +4312,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4166,15 +4487,6 @@ export type Subscription_RootStaking_ParamsArgs = { }; -export type Subscription_RootStaking_Params_AggregateArgs = { - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - export type Subscription_RootStaking_PoolArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4864,6 +5176,8 @@ export type Transaction = { logs?: Maybe; memo?: Maybe; messages: Scalars['jsonb']; + /** An array relationship */ + messagesByPartitionIdTransactionHash: Array; raw_log?: Maybe; signatures: Scalars['_text']; signer_infos: Scalars['jsonb']; @@ -4889,6 +5203,16 @@ export type TransactionMessagesArgs = { }; +/** columns and relationships of "transaction" */ +export type TransactionMessagesByPartitionIdTransactionHashArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "transaction" */ export type TransactionSigner_InfosArgs = { path?: InputMaybe; @@ -4930,6 +5254,7 @@ export type Transaction_Bool_Exp = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByPartitionIdTransactionHash?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe<_Text_Comparison_Exp>; signer_infos?: InputMaybe; @@ -4967,6 +5292,7 @@ export type Transaction_Order_By = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByPartitionIdTransactionHash_aggregate?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe; signer_infos?: InputMaybe; @@ -6547,6 +6873,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -7485,6 +7841,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-jackal/src/graphql/general/message_types.graphql b/apps/web-jackal/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-jackal/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-jackal/src/graphql/types/general_types.ts b/apps/web-jackal/src/graphql/types/general_types.ts index bf594e1057..33b0a8cc57 100644 --- a/apps/web-jackal/src/graphql/types/general_types.ts +++ b/apps/web-jackal/src/graphql/types/general_types.ts @@ -1334,6 +1334,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1377,6 +1379,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1405,6 +1408,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1452,6 +1456,142 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -1477,6 +1617,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2826,8 +2978,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3150,6 +3310,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3160,6 +3338,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3840,8 +4038,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4078,6 +4284,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4088,6 +4312,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6629,6 +6873,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -7567,6 +7841,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-kyve/src/graphql/general/message_types.graphql b/apps/web-kyve/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-kyve/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-kyve/src/graphql/types/general_types.ts b/apps/web-kyve/src/graphql/types/general_types.ts index dbb14a003c..23ccc9a205 100644 --- a/apps/web-kyve/src/graphql/types/general_types.ts +++ b/apps/web-kyve/src/graphql/types/general_types.ts @@ -1420,6 +1420,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1463,6 +1465,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1491,6 +1494,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1705,12 +1709,6 @@ export type Messages_By_Type_Args = { types?: InputMaybe; }; -export type Messages_By_Types_Args = { - limit?: InputMaybe; - offset?: InputMaybe; - types?: InputMaybe; -}; - export type Messages_Types_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -3443,8 +3441,6 @@ export type Query_Root = { messages_by_address: Array; /** execute function "messages_by_type" which returns "message" */ messages_by_type: Array; - /** execute function "messages_by_types" which returns "message" */ - messages_by_types: Array; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ @@ -3849,16 +3845,6 @@ export type Query_RootMessages_By_TypeArgs = { }; -export type Query_RootMessages_By_TypesArgs = { - args: Messages_By_Types_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - export type Query_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; @@ -4686,8 +4672,6 @@ export type Subscription_Root = { messages_by_address: Array; /** execute function "messages_by_type" which returns "message" */ messages_by_type: Array; - /** execute function "messages_by_types" which returns "message" */ - messages_by_types: Array; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ @@ -5006,16 +4990,6 @@ export type Subscription_RootMessages_By_TypeArgs = { }; -export type Subscription_RootMessages_By_TypesArgs = { - args: Messages_By_Types_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - export type Subscription_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; @@ -7662,6 +7636,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -8610,6 +8614,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-likecoin/src/graphql/general/message_types.graphql b/apps/web-likecoin/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-likecoin/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-likecoin/src/graphql/types/general_types.ts b/apps/web-likecoin/src/graphql/types/general_types.ts index f0489638f5..5633b66ccc 100644 --- a/apps/web-likecoin/src/graphql/types/general_types.ts +++ b/apps/web-likecoin/src/graphql/types/general_types.ts @@ -2869,6 +2869,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2953,6 +2955,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3004,6 +3007,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3090,6 +3094,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3142,6 +3282,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5281,10 +5433,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5841,6 +6005,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5861,6 +6043,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6934,10 +7156,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7408,6 +7642,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7428,6 +7680,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11650,6 +11942,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins?: any | null }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12588,6 +12910,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-neutron/src/graphql/general/message_types.graphql b/apps/web-neutron/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-neutron/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-neutron/src/graphql/types/general_types.ts b/apps/web-neutron/src/graphql/types/general_types.ts index d314c4065b..744d3e765b 100644 --- a/apps/web-neutron/src/graphql/types/general_types.ts +++ b/apps/web-neutron/src/graphql/types/general_types.ts @@ -10382,6 +10382,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -10425,6 +10427,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -10453,6 +10456,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -10518,6 +10522,158 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** Streaming cursor of the table "message_type" */ +export type Message_Type_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Message_Type_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Message_Type_Stream_Cursor_Value_Input = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -10543,6 +10699,12 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + export type Messages_Types_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -16185,8 +16347,14 @@ export type Query_Root = { genesis: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** fetch data from the table: "modules" */ @@ -16399,6 +16567,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -16409,6 +16595,16 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; @@ -16770,8 +16966,16 @@ export type Subscription_Root = { message: Array; /** fetch data from the table in a streaming manner: "message" */ message_stream: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; + /** fetch data from the table in a streaming manner: "message_type" */ + message_type_stream: Array; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** fetch data from the table: "modules" */ @@ -17096,6 +17300,31 @@ export type Subscription_RootMessage_StreamArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_StreamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -17106,6 +17335,16 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; @@ -20022,6 +20261,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -20473,6 +20742,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-neutron/src/graphql/types/provider_types.ts b/apps/web-neutron/src/graphql/types/provider_types.ts index 57815e1a8d..b937d49523 100644 --- a/apps/web-neutron/src/graphql/types/provider_types.ts +++ b/apps/web-neutron/src/graphql/types/provider_types.ts @@ -10382,6 +10382,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -10425,6 +10427,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -10453,6 +10456,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -10518,6 +10522,158 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** Streaming cursor of the table "message_type" */ +export type Message_Type_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Message_Type_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Message_Type_Stream_Cursor_Value_Input = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -10543,6 +10699,12 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + export type Messages_Types_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -16185,8 +16347,14 @@ export type Query_Root = { genesis: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** fetch data from the table: "modules" */ @@ -16399,6 +16567,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -16409,6 +16595,16 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; @@ -16770,8 +16966,16 @@ export type Subscription_Root = { message: Array; /** fetch data from the table in a streaming manner: "message" */ message_stream: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; + /** fetch data from the table in a streaming manner: "message_type" */ + message_type_stream: Array; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** fetch data from the table: "modules" */ @@ -17096,6 +17300,31 @@ export type Subscription_RootMessage_StreamArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_StreamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -17106,6 +17335,16 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_Types_By_AddressArgs = { args: Messages_Types_By_Address_Args; distinct_on?: InputMaybe>; diff --git a/apps/web-neutron/src/screens/account_details/components/other_tokens/components/desktop/index.tsx b/apps/web-neutron/src/screens/account_details/components/other_tokens/components/desktop/index.tsx new file mode 100644 index 0000000000..6c29552563 --- /dev/null +++ b/apps/web-neutron/src/screens/account_details/components/other_tokens/components/desktop/index.tsx @@ -0,0 +1,62 @@ +import Table from '@mui/material/Table'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableHead from '@mui/material/TableHead'; +import TableRow from '@mui/material/TableRow'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import { FC } from 'react'; +import { formatNumber } from '@/utils/format_token'; +import type { OtherTokenType } from '@/screens/account_details/types'; +import { columns } from '@/screens/account_details/components/other_tokens/components/desktop/utils'; + +type DesktopProps = { + className?: string; + items?: OtherTokenType[]; +}; + +const Desktop: FC = ({ className, items }) => { + const { t } = useAppTranslation('accounts'); + + const formattedItems = items?.map((x, i) => ({ + key: i, + token: x.denom.toUpperCase(), + available: formatNumber(x.available.value, x.available.exponent), + })); + + return ( +
+ + + + {columns.map((column) => ( + + {t(column.key)} + + ))} + + + + {formattedItems?.map((row) => ( + + {columns.map((column) => ( + + {row[column.key as keyof typeof row]} + + ))} + + ))} + +
+
+ ); +}; + +export default Desktop; diff --git a/apps/web-neutron/src/screens/account_details/components/other_tokens/components/mobile/index.tsx b/apps/web-neutron/src/screens/account_details/components/other_tokens/components/mobile/index.tsx new file mode 100644 index 0000000000..a7120b3146 --- /dev/null +++ b/apps/web-neutron/src/screens/account_details/components/other_tokens/components/mobile/index.tsx @@ -0,0 +1,68 @@ +import Divider from '@mui/material/Divider'; +import Typography from '@mui/material/Typography'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import { FC, Fragment } from 'react'; +import { formatNumber } from '@/utils/format_token'; +import type { OtherTokenType } from '@/screens/account_details/types'; +import useStyles from '@/screens/account_details/components/other_tokens/components/mobile/styles'; + +type MobileProps = { + className?: string; + items?: OtherTokenType[]; +}; + +const Mobile: FC = ({ className, items }) => { + const { classes } = useStyles(); + const { t } = useAppTranslation('accounts'); + return ( +
+ {items?.map((x, i) => { + const available = formatNumber(x.available.value, x.available.exponent); + + const isLast = !items || i === items.length - 1; + return ( + // eslint-disable-next-line react/no-array-index-key + +
+
+ + {t('token')} + + + {x.denom.toUpperCase()} + +
+
+ + {t('available')} + + + {available} + +
+
+ + {t('reward')} + + + 0 + +
+
+ + {t('commission')} + + + 0 + +
+
+ {!isLast && } +
+ ); + })} +
+ ); +}; + +export default Mobile; diff --git a/apps/web-neutron/src/screens/account_details/components/overview/index.tsx b/apps/web-neutron/src/screens/account_details/components/overview/index.tsx new file mode 100644 index 0000000000..bf73801094 --- /dev/null +++ b/apps/web-neutron/src/screens/account_details/components/overview/index.tsx @@ -0,0 +1,139 @@ +import Box from '@/components/box'; +import { useWindowOrigin } from '@/hooks/use_window'; +import { useOverview } from '@/screens/account_details/components/overview/hooks'; +import useStyles from '@/screens/account_details/components/overview/styles'; +import { useDisplayStyles } from '@/styles/useSharedStyles'; +import { getMiddleEllipsis } from '@/utils/get_middle_ellipsis'; +import Dialog from '@mui/material/Dialog'; +import Typography from '@mui/material/Typography'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import { QRCodeSVG } from 'qrcode.react'; +import { FC } from 'react'; +import { + EmailIcon, + EmailShareButton, + FacebookIcon, + FacebookShareButton, + TelegramIcon, + TelegramShareButton, + TwitterIcon, + TwitterShareButton, + WhatsappIcon, + WhatsappShareButton, +} from 'react-share'; +import CopyIcon from 'shared-utils/assets/icon-copy.svg'; +import ShareIcon from 'shared-utils/assets/icon-share.svg'; + +type OverviewProps = { + className?: string; + withdrawalAddress: string; + address: string; +}; + +const Overview: FC = ({ className, address, withdrawalAddress }) => { + const { location } = useWindowOrigin(); + const { classes, cx } = useStyles(); + const display = useDisplayStyles().classes; + const { t } = useAppTranslation('accounts'); + const { open, handleClose, handleOpen, handleCopyToClipboard } = useOverview(t); + + const url = `${location}/accounts/${address}`; + const hashTags = ['bigdipperexplorer', 'bigdipper']; + return ( + <> + + + + {t('scanForAddress')} + + +
+ {t('shareTo')} +
+ + + + + + + + + + + + + + + +
+
+
+
+ +
+ + {t('address')} + +
+ handleCopyToClipboard(address)} + className={classes.actionIcons} + /> + + + {address} + + {getMiddleEllipsis(address, { + beginning: 15, + ending: 5, + })} + + +
+
+
+ + {t('rewardAddress')} + +
+ handleCopyToClipboard(withdrawalAddress)} + /> + + {withdrawalAddress} + + {getMiddleEllipsis(withdrawalAddress, { + beginning: 15, + ending: 5, + })} + + +
+
+
+ + ); +}; +export default Overview; diff --git a/apps/web-neutron/src/screens/account_details/components/staking/hooks.ts b/apps/web-neutron/src/screens/account_details/components/staking/hooks.ts deleted file mode 100644 index 2cc9c1012f..0000000000 --- a/apps/web-neutron/src/screens/account_details/components/staking/hooks.ts +++ /dev/null @@ -1,390 +0,0 @@ -import Big from 'big.js'; -import { useRouter } from 'next/router'; -import numeral from 'numeral'; -import * as R from 'ramda'; -import { SyntheticEvent, useCallback, useEffect, useState } from 'react'; -import chainConfig from '@/chainConfig'; -import { useValidatorsQuery, ValidatorsQuery } from '@/graphql/types/general_types'; -import { - useAccountDelegationsQuery, - useAccountRedelegationsQuery, - useAccountUndelegationsQuery, - useValidatorAddressesQuery, - useValidatorConsensusAddressesListQuery, - useValidatorProviderOperatorAddressesListQuery, -} from '@/graphql/types/provider_types'; -import type { - DelegationType, - RedelegationType, - StakingState, -} from '@/screens/account_details/components/staking/types'; -import type { RewardsType } from '@/screens/account_details/types'; -import { ValidatorType } from '@/screens/validators/components/list/types'; -import { formatToken } from '@/utils/format_token'; -import { getDenom } from '@/utils/get_denom'; - -const { primaryTokenUnit, prefix } = chainConfig(); - -export const ROWS_PER_PAGE = 10; - -export const formatDelegations = ( - data: Array<{ - validator_address?: string; - coins?: MsgCoin[]; - }>, - validatorsCommission: Pick[], - rewards: RewardsType -) => - data - .map((x): DelegationType => { - const validator = x?.validator_address ?? ''; - const delegation = getDenom(x.coins, primaryTokenUnit); - return { - validator, - commission: - numeral( - validatorsCommission.find((val) => val.validator === validator)?.commission?.toFixed(3) - ).value() ?? 0, - amount: formatToken(delegation.amount, delegation.denom), - reward: rewards[validator], - }; - }) - .sort((a, b) => (Big(a.amount?.value).gt(b.amount?.value) ? -1 : 1)); - -export const formatRedelegations = ( - data: Array<{ - entries?: Array<{ balance: string | number; completion_time?: string }>; - validator_src_address?: string; - validator_dst_address?: string; - }> -) => { - const results: RedelegationType[] = []; - data.forEach((x) => { - x.entries?.forEach((y) => { - results.push({ - from: x?.validator_src_address ?? '', - to: x?.validator_dst_address ?? '', - amount: formatToken(y.balance, primaryTokenUnit), - completionTime: y?.completion_time ?? '', - }); - }); - }); - - results.sort((a, b) => (a.completionTime < b.completionTime ? -1 : 1)); - - return results; -}; - -export const formatUnbondings = ( - data: Array<{ - entries?: Array<{ balance: string | number; completion_time?: string }>; - validator_address?: string; - }> -) => { - const results: Array<{ validator: string; amount: TokenUnit; completionTime: string }> = []; - data.forEach((x) => { - x?.entries?.forEach((y) => { - results.push({ - validator: x?.validator_address ?? '', - amount: formatToken(y.balance, primaryTokenUnit), - completionTime: y?.completion_time ?? '', - }); - }); - }); - - results.sort((a, b) => (a.completionTime < b.completionTime ? -1 : 1)); - - return results; -}; - -export const useStaking = ( - rewards: RewardsType, - delegationsPage: number, - redelegationsPage: number, - unbondingsPage: number, - addressParam: string -) => { - const router = useRouter(); - const [state, setState] = useState({ - tab: 0, - }); - - const [validatorsCommission, setValidatorsCommission] = useState< - Pick[] - >([]); - - // ========================== - // Fetch Data - // ========================== - useValidatorsQuery({ - onCompleted: (data) => { - formatValidators(data); - }, - }); - - // return a list of all validators with their address and commission rate - const formatValidators = useCallback( - (data: ValidatorsQuery): { items: Pick[] } => { - const formattedItems: Pick[] = data.ccv_validator - .filter((x) => x.validator?.validatorInfo) - .map((x) => ({ - validator: x.validator?.validatorInfo?.operatorAddress ?? '', - commission: (x?.validator?.validatorCommissions?.[0]?.commission ?? 0) * 100, - })); - - setValidatorsCommission(formattedItems); - - return { - items: formattedItems, - }; - }, - [] - ); - - const { data: valAddressesInfo } = useValidatorAddressesQuery(); - - const address = - addressParam || - (Array.isArray(router?.query?.address) - ? router.query.address[0] - : router?.query?.address ?? ''); - - const [providerAddress, setProviderAddress] = useState(address); - - const { data: addresses } = useValidatorConsensusAddressesListQuery({ - variables: { address: providerAddress }, - }); - - const { data: cosmosvaloperAddresses } = useValidatorProviderOperatorAddressesListQuery({ - variables: { address: providerAddress }, - }); - - useEffect(() => { - let provider = ''; - if (valAddressesInfo?.ccv_validator) { - if (providerAddress.startsWith(prefix.consensus)) { - // const {data: addresses} = useValidatorConsensusAddressesListQuery(providerAddress); - if (addresses) { - // const { ccv_validator: { provider_self_delegate_address }} = addresses[0]; - provider = addresses.ccv_validator?.[0].provider_self_delegate_address; - } else { - provider = address; - } - setProviderAddress(provider); - } else if (providerAddress.startsWith(prefix.account)) { - const matchingValidator = valAddressesInfo.ccv_validator.find( - (x) => x.consumer_self_delegate_address === providerAddress - ); - if (matchingValidator) { - provider = matchingValidator.provider_self_delegate_address ?? ''; - } else { - provider = address; - } - setProviderAddress(provider); - } else if (providerAddress.startsWith('cosmosvaloper')) { - if (cosmosvaloperAddresses) { - provider = cosmosvaloperAddresses.ccv_validator?.[0].provider_self_delegate_address; - } - // const matchingValidator = valAddressesInfo.ccv_validator.find((x) => x.validator?.validatorInfo?.operatorAddress === providerAddress); - else { - provider = address; - } - setProviderAddress(provider); - } - } - }, [address, addresses, cosmosvaloperAddresses, providerAddress, valAddressesInfo]); - - // ===================================== - // delegations - // ===================================== - const { - data: delegationsData, - loading: delegationsLoading, - error: delegationsError, - refetch: delegationsRefetch, - } = useAccountDelegationsQuery({ - variables: { - address: providerAddress, - limit: ROWS_PER_PAGE, - offset: delegationsPage * ROWS_PER_PAGE, - }, - }); - useEffect(() => { - if (delegationsLoading) return; - if (delegationsError) { - delegationsRefetch({ pagination: false }); - } - }, [delegationsError, delegationsLoading, delegationsRefetch]); - useAccountDelegationsQuery({ - variables: { - address: providerAddress, - limit: ROWS_PER_PAGE, - offset: (delegationsPage + 1) * ROWS_PER_PAGE, - }, - }); - - const [delegationsPagination, setDelegationsPagination] = useState(); - const { - data: dData, - error: dError, - refetch: dRefetch, - } = useAccountDelegationsQuery({ - variables: { - address: providerAddress, - limit: 0, - offset: 0, - pagination: true, - }, - skip: delegationsPagination !== undefined, - }); - useEffect(() => { - if (dError) { - dRefetch(); - } else if (dData) { - setDelegationsPagination(dData?.bdjuno_provider?.delegations?.pagination?.total ?? 0); - } - }, [dData, dError, dRefetch]); - - // ===================================== - // redelegations - // ===================================== - const { - data: redelegationsData, - loading: redelegationsLoading, - error: redelegationsError, - refetch: redelegationsRefetch, - } = useAccountRedelegationsQuery({ - variables: { - address: providerAddress, - limit: ROWS_PER_PAGE, - offset: redelegationsPage * ROWS_PER_PAGE, - }, - }); - useEffect(() => { - if (redelegationsLoading) return; - if (redelegationsError) { - redelegationsRefetch({ pagination: false }); - } - }, [redelegationsError, redelegationsLoading, redelegationsRefetch]); - useAccountRedelegationsQuery({ - variables: { - address: providerAddress, - limit: ROWS_PER_PAGE, - offset: (redelegationsPage + 1) * ROWS_PER_PAGE, - }, - }); - - const [redelegationsPagination, setRedelegationsPagination] = useState(); - const { - data: rData, - error: rError, - refetch: rRefetch, - } = useAccountRedelegationsQuery({ - variables: { - address: providerAddress, - limit: 0, - offset: 0, - pagination: true, - }, - skip: redelegationsPagination !== undefined, - }); - useEffect(() => { - if (rError) { - rRefetch(); - } else if (rData) { - setRedelegationsPagination(rData?.bdjuno_provider?.redelegations?.pagination?.total ?? 0); - } - }, [rData, rError, rRefetch]); - - // ===================================== - // unbondings - // ===================================== - const { - data: undelegationsData, - loading: undelegationsLoading, - error: undelegationsError, - refetch: undelegationsRefetch, - } = useAccountUndelegationsQuery({ - variables: { - address: providerAddress, - limit: ROWS_PER_PAGE, - offset: unbondingsPage * ROWS_PER_PAGE, - }, - }); - useEffect(() => { - if (undelegationsLoading) return; - if (undelegationsError) { - undelegationsRefetch({ pagination: false }); - } - }, [undelegationsError, undelegationsLoading, undelegationsRefetch]); - useAccountUndelegationsQuery({ - variables: { - address: providerAddress, - limit: ROWS_PER_PAGE, - offset: (unbondingsPage + 1) * ROWS_PER_PAGE, - }, - }); - - const [undelegationsPagination, setUndelegationsPagination] = useState(); - const { - data: uData, - error: uError, - refetch: uRefetch, - } = useAccountUndelegationsQuery({ - variables: { - address: providerAddress, - limit: 0, - offset: 0, - pagination: true, - }, - skip: undelegationsPagination !== undefined, - }); - useEffect(() => { - if (uError) { - uRefetch(); - } else if (uData) { - setUndelegationsPagination(uData?.bdjuno_provider?.undelegations?.pagination?.total ?? 0); - } - }, [uData, uError, uRefetch]); - - const handleTabChange = useCallback( - (_event: SyntheticEvent, newValue: number) => { - setState((prevState) => { - const newState = { ...prevState, tab: newValue }; - return R.equals(prevState, newState) ? prevState : newState; - }); - }, - [] - ); - - return { - state, - delegations: { - loading: delegationsLoading, - count: delegationsPagination, - data: formatDelegations( - delegationsData?.bdjuno_provider?.delegations?.delegations ?? [], - validatorsCommission, - rewards - ), - error: delegationsError, - }, - redelegations: { - loading: redelegationsLoading, - count: redelegationsPagination, - data: formatRedelegations( - redelegationsData?.bdjuno_provider?.redelegations?.redelegations ?? [] - ), - error: redelegationsError, - }, - unbondings: { - loading: undelegationsLoading, - count: undelegationsPagination, - data: formatUnbondings( - undelegationsData?.bdjuno_provider?.undelegations?.undelegations ?? [] - ), - error: undelegationsError, - }, - handleTabChange, - }; -}; diff --git a/apps/web-neutron/src/screens/account_details/hooks.ts b/apps/web-neutron/src/screens/account_details/hooks.ts index 9177ee2d3c..69271244f1 100644 --- a/apps/web-neutron/src/screens/account_details/hooks.ts +++ b/apps/web-neutron/src/screens/account_details/hooks.ts @@ -9,14 +9,7 @@ import type { BalanceType, OtherTokenType, } from '@/screens/account_details/types'; -import { - useAccountWithdrawalAddress, - useAvailableBalances, - useCommission, - useDelegationBalance, - useRewards, - useUnbondingBalance, -} from '@/screens/account_details/utils'; +import { useAccountWithdrawalAddress, useAvailableBalances } from '@/screens/account_details/utils'; import { formatToken } from '@/utils/format_token'; import { getDenom } from '@/utils/get_denom'; import { useValidatorAddressesQuery } from '@/graphql/types/provider_types'; @@ -45,37 +38,12 @@ const initialState: AccountDetailState = { }, balance: { available: defaultTokenUnit, - delegate: defaultTokenUnit, - unbonding: defaultTokenUnit, - reward: defaultTokenUnit, - commission: defaultTokenUnit, total: defaultTokenUnit, }, - rewards: {}, }; type Data = { - delegationRewards?: unknown; accountBalances?: unknown; - delegationBalance?: unknown; - unbondingBalance?: unknown; - commission?: unknown; -}; - -// ============================ -// rewards -// ============================ -const formatRewards = (_data: Data) => { - const rewardsDict: { [key: string]: TokenUnit } = {}; - // log all the rewards - // data?.delegationRewards?.forEach((x) => { - // if (!x) return; - // const coins = x.coins ?? []; - // const denomAmount = getDenom(coins, primaryTokenUnit); - // const denomFormat = formatToken(denomAmount.amount, primaryTokenUnit); - // rewardsDict[x.validatorAddress ?? ''] = denomFormat; - // }); - return rewardsDict; }; // ============================ @@ -84,45 +52,10 @@ const formatRewards = (_data: Data) => { const formatBalance = (data: Data): BalanceType => { const available = getDenom(R.pathOr([], ['accountBalances', 'coins'], data), primaryTokenUnit); const availableAmount = formatToken(available.amount, primaryTokenUnit); - const delegate = getDenom(R.pathOr([], ['delegationBalance', 'coins'], data), primaryTokenUnit); - const delegateAmount = formatToken(delegate.amount, primaryTokenUnit); - - const unbonding = getDenom(R.pathOr([], ['unbondingBalance', 'coins'], data), primaryTokenUnit); - const unbondingAmount = formatToken(unbonding.amount, primaryTokenUnit); - - const rewards = '0'; - // data.delegationRewards?.reduce((a: BigSource, b: unknown) => { - // if (!b) return a; - // const coins = R.pathOr([], ['coins'], b); - // const dsmCoins = getDenom(coins, primaryTokenUnit); - - // return Big(a).plus(dsmCoins.amount).toPrecision(); - // }, '0') ?? '0'; - const rewardsAmount = formatToken(rewards, primaryTokenUnit); - - // const commission = getDenom( - // R.pathOr['coins']>>( - // [], - // ['commission', 'coins'], - // data - // ), - // primaryTokenUnit - // ); - const commissionAmount = formatToken(0, primaryTokenUnit); - - const total = Big(availableAmount.value) - .plus(delegateAmount.value) - .plus(unbondingAmount.value) - .plus(rewardsAmount.value) - .plus(commissionAmount.value) - .toFixed(tokenUnits?.[primaryTokenUnit].exponent); + const total = Big(availableAmount.value).toFixed(tokenUnits?.[primaryTokenUnit].exponent); const balance: BalanceType = { available: availableAmount, - delegate: delegateAmount, - unbonding: unbondingAmount, - reward: rewardsAmount, - commission: commissionAmount, total: { value: total, displayDenom: availableAmount.displayDenom, @@ -148,42 +81,16 @@ const formatOtherTokens = (data: Data) => { otherTokenUnits.add(x.denom); }); - // rewards tokens - const rewards = R.pathOr }>>([], ['delegationRewards'], data); - - rewards.forEach((x) => { - x.coins?.forEach((y) => { - otherTokenUnits.add(y.denom); - }); - }); - - // commission tokens - const commission = R.pathOr([], ['commission', 'coins'], data); - - commission.forEach((x) => { - otherTokenUnits.add(x.denom); - }); - // remove the primary token unit thats being shown in balance otherTokenUnits.delete(primaryTokenUnit); otherTokenUnits.forEach((x: string) => { const availableRawAmount = getDenom(available, x); const availableAmount = formatToken(availableRawAmount.amount, x); - const rewardsRawAmount = rewards.reduce((a, b) => { - const coins = R.pathOr>([], ['coins'], b); - const denom = getDenom(coins, x); - return Big(a).plus(denom.amount).toPrecision(); - }, '0'); - const rewardAmount = formatToken(rewardsRawAmount, x); - const commissionRawAmount = getDenom(commission, x); - const commissionAmount = formatToken(commissionRawAmount.amount, x); otherTokens.push({ denom: tokenUnits?.[x]?.display ?? x, available: availableAmount, - reward: rewardAmount, - commission: commissionAmount, }); }); @@ -202,15 +109,13 @@ const formatAllBalance = (data: Data) => { balanceLoading: false, }; - stateChange.rewards = formatRewards(data); - stateChange.balance = formatBalance(data); formatOtherTokens(data); stateChange.otherTokens = formatOtherTokens(data); - return stateChange; + return stateChange as AccountDetailState; }; export const useAccountDetails = () => { @@ -219,7 +124,7 @@ export const useAccountDetails = () => { const handleSetState = useCallback( (stateChange: (prevState: AccountDetailState) => AccountDetailState) => { - setState((prevState) => { + setState((prevState: AccountDetailState) => { const newState = stateChange(prevState); return R.equals(prevState, newState) ? prevState : newState; }); @@ -298,39 +203,15 @@ export const useAccountDetails = () => { [dataDesmosProfile, loadingDesmosProfile] ); - const commission = useCommission(providerAddress); const available = useAvailableBalances(providerAddress); - const delegation = useDelegationBalance(providerAddress); - const unbonding = useUnbondingBalance(providerAddress); - const rewards = useRewards(providerAddress); useEffect(() => { const formattedRawData: { - commission?: any; accountBalances?: any; - delegationBalance?: any; - unbondingBalance?: any; - delegationRewards?: any; } = {}; - formattedRawData.commission = R.pathOr({ coins: [] }, ['commission'], commission); formattedRawData.accountBalances = R.pathOr({ coins: [] }, ['accountBalances'], available); - formattedRawData.delegationBalance = R.pathOr( - { coins: [] }, - ['bdjuno_provider', 'delegationBalance'], - delegation - ); - formattedRawData.unbondingBalance = R.pathOr( - { coins: [] }, - ['bdjuno_provider', 'unbondingBalance'], - unbonding - ); - formattedRawData.delegationRewards = R.pathOr( - [], - ['bdjuno_provider', 'delegationRewards'], - rewards - ); handleSetState((prevState) => ({ ...prevState, ...formatAllBalance(formattedRawData) })); - }, [commission, available, delegation, unbonding, rewards, handleSetState]); + }, [available, handleSetState]); // ========================== // Fetch Data diff --git a/apps/web-neutron/src/screens/account_details/index.tsx b/apps/web-neutron/src/screens/account_details/index.tsx index 677a5f7eae..03e563192a 100644 --- a/apps/web-neutron/src/screens/account_details/index.tsx +++ b/apps/web-neutron/src/screens/account_details/index.tsx @@ -15,6 +15,12 @@ const AccountDetails = () => { const { classes } = useStyles(); const { state } = useAccountDetails(); + const nullBalance: TokenUnit = { + displayDenom: 'neutron', + baseDenom: 'untrn', + exponent: 6, + value: '0', + }; return ( <> { + - {/* */} - + diff --git a/apps/web-neutron/src/screens/account_details/types.ts b/apps/web-neutron/src/screens/account_details/types.ts new file mode 100644 index 0000000000..b2c91835d7 --- /dev/null +++ b/apps/web-neutron/src/screens/account_details/types.ts @@ -0,0 +1,31 @@ +export interface OverviewType { + address: string; + withdrawalAddress: string; +} + +export interface BalanceType { + available: TokenUnit; + total: TokenUnit; +} + +export interface OtherTokenType { + denom: string; + available: TokenUnit; +} + +export interface RewardsType { + [value: string]: TokenUnit[]; +} + +export interface AccountDetailState { + loading: boolean; + balanceLoading: boolean; + exists: boolean; + desmosProfile: DesmosProfile | null; + overview: OverviewType; + balance: BalanceType; + otherTokens: { + data: OtherTokenType[]; + count: number; + }; +} diff --git a/apps/web-neutron/src/screens/account_details/utils.tsx b/apps/web-neutron/src/screens/account_details/utils.tsx index ff5bdc868e..6e5ef90e74 100644 --- a/apps/web-neutron/src/screens/account_details/utils.tsx +++ b/apps/web-neutron/src/screens/account_details/utils.tsx @@ -1,42 +1,6 @@ import { useEffect, useMemo } from 'react'; -import { - useAccountCommissionQuery, - useAccountDelegationBalanceQuery, - useAccountDelegationRewardsQuery, - useAccountUnbondingBalanceQuery, - useAccountWithdrawalAddressQuery, -} from '@/graphql/types/provider_types'; +import { useAccountWithdrawalAddressQuery } from '@/graphql/types/provider_types'; import { useAccountBalancesQuery } from '@/graphql/types/general_types'; -import { toValidatorAddress } from '@/utils/prefix_convert'; - -export const useCommission = (address?: string) => { - /* Converting the address to a validator address. */ - let validatorAddress = ''; - try { - if (address) validatorAddress = toValidatorAddress(address); - } catch (e) { - console.error(e); - } - - const defaultReturnValue = useMemo( - () => ({ - commission: { - coins: [], - }, - }), - [] - ); - const { data, error, refetch } = useAccountCommissionQuery({ - variables: { - validatorAddress, - }, - skip: !address, - }); - useEffect(() => { - if (error) refetch(); - }, [error, refetch]); - return data ?? defaultReturnValue; -}; export const useAccountWithdrawalAddress = (address?: string) => { const defaultReturnValue = useMemo( @@ -81,59 +45,3 @@ export const useAvailableBalances = (address?: string) => { }, [error, refetch]); return data ?? defaultReturnValue; }; - -export const useDelegationBalance = (address?: string) => { - const defaultReturnValue = useMemo( - () => ({ - delegationBalance: { - coins: [], - }, - }), - [] - ); - const { data, error, refetch } = useAccountDelegationBalanceQuery({ - variables: { - address: address ?? '', - }, - skip: !address, - }); - useEffect(() => { - if (error) refetch(); - }, [error, refetch]); - return data ?? defaultReturnValue; -}; - -export const useUnbondingBalance = (address?: string) => { - const defaultReturnValue = useMemo( - () => ({ - unbondingBalance: { - coins: [], - }, - }), - [] - ); - const { data, error, refetch } = useAccountUnbondingBalanceQuery({ - variables: { - address: address ?? '', - }, - skip: !address, - }); - useEffect(() => { - if (error) refetch(); - }, [error, refetch]); - return data ?? defaultReturnValue; -}; - -export const useRewards = (address?: string) => { - const defaultReturnValue = useMemo(() => ({ delegationRewards: [] }), []); - const { data, error, refetch } = useAccountDelegationRewardsQuery({ - variables: { - address: address ?? '', - }, - skip: !address, - }); - useEffect(() => { - if (error) refetch(); - }, [error, refetch]); - return data ?? defaultReturnValue; -}; diff --git a/apps/web-neutron/src/screens/home/components/hero/components/online_voting_power/index.tsx b/apps/web-neutron/src/screens/home/components/hero/components/online_voting_power/index.tsx new file mode 100644 index 0000000000..4d1650fbdd --- /dev/null +++ b/apps/web-neutron/src/screens/home/components/hero/components/online_voting_power/index.tsx @@ -0,0 +1,82 @@ +import Typography from '@mui/material/Typography'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import numeral from 'numeral'; +import { FC } from 'react'; +import chainConfig from '@/chainConfig'; +import useStyles from '@/screens/home/components/hero/components/online_voting_power/styles'; +import { useOnlineVotingPower } from '@/screens/home/components/hero/components/online_voting_power/hooks'; + +const OnlineVotingPower: FC = () => { + const { t } = useAppTranslation('home'); + const { state } = useOnlineVotingPower(); + + const { chainName } = chainConfig(); + + const votingPowerPercent = + // eslint-disable-next-line no-nested-ternary + chainName === 'wormhole' + ? numeral((state.activeValidators / state.votingPower) * 100) + : state.totalVotingPower === 0 + ? numeral(0) + : numeral((state.votingPower / state.totalVotingPower) * 100); + + const { classes } = useStyles({ percentage: votingPowerPercent.format('0') }); + + return ( +
+ {t('onlineVotingPower')} +
+ + {`${votingPowerPercent.format('0,0.00', (n) => Math.floor(n))}%`} + + + {numeral(state.votingPower).format('0,0')} /{' '} + {state.totalVotingPower === 0 + ? numeral(state.votingPower).format('0,0') + : numeral(state.totalVotingPower).format('0,0')} + +
+
+
+
+
+
+ + {t('validators')} + + + {numeral(state.activeValidators).format('0,0')} + +
+
+ + {t('votingPowerPercent')} + + + {`${votingPowerPercent.format('0,0.00', (n) => Math.floor(n))}%`} + +
+
+ + {t('votingPower')} + + + {numeral(state.votingPower).format('0,0')} + +
+ {state.totalVotingPower === 0 ? null : ( +
+ + {t('totalVotingPower')} + + + {numeral(state.totalVotingPower).format('0,0')} + +
+ )} +
+
+ ); +}; + +export default OnlineVotingPower; diff --git a/apps/web-neutron/src/screens/validator_details/components/voting_power/index.tsx b/apps/web-neutron/src/screens/validator_details/components/voting_power/index.tsx new file mode 100644 index 0000000000..ed1e0f6d80 --- /dev/null +++ b/apps/web-neutron/src/screens/validator_details/components/voting_power/index.tsx @@ -0,0 +1,89 @@ +import Typography from '@mui/material/Typography'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import Link from 'next/link'; +import numeral from 'numeral'; +import { FC } from 'react'; +import chainConfig from '@/chainConfig'; +import { BLOCK_DETAILS } from '@/utils/go_to_page'; +import useStyles from '@/screens/validator_details/components/voting_power/styles'; +import Box from '@/components/box'; +import { useOnlineVotingPower } from '@/screens/home/components/hero/components/online_voting_power/hooks'; +import Loading from '@/components/loading'; +import type { VotingPowerType } from '@/screens/validator_details/types'; + +type VotingPowerProps = { + className?: string; + data: VotingPowerType; + status?: number; + loading: boolean; +}; + +const VotingPower: FC = ({ className, data, status, loading }) => { + const { t } = useAppTranslation('validators'); + const { state } = useOnlineVotingPower(); + const { chainName } = chainConfig(); + + const validatorVotingPower = status === 3 ? numeral(data.self).format('0,0') : '0'; + + const votingPowerPercent = + // eslint-disable-next-line no-nested-ternary + status === 3 + ? chainName === 'wormhole' + ? numeral((Number(validatorVotingPower) / state.activeValidators) * 100) + : numeral((data.self / (numeral(data.overall.value).value() ?? 0)) * 100) + : numeral(0); + + const { classes, cx } = useStyles({ + percentage: parseFloat(votingPowerPercent.format('0', Math.floor)), + }); + return ( + + {t('votingPower')} + {loading ? ( + + ) : ( + <> +
+ + {`${votingPowerPercent.format('0,0.00')}%`} + + + {chainName === 'wormhole' + ? `${validatorVotingPower} / ${state.activeValidators}` + : `${validatorVotingPower} / ${numeral(data.overall.value).format('0,0')}`} + +
+
+
+
+
+ + {t('block')} + + + {numeral(data.height).format('0,0')} + +
+
+ + {t('votingPower')} + + + {validatorVotingPower} + +
+
+ + {t('votingPowerPercent')} + + + {`${votingPowerPercent.format('0,0.00')}%`} + +
+ + )} + + ); +}; + +export default VotingPower; diff --git a/apps/web-neutron/src/screens/validator_details/hooks.ts b/apps/web-neutron/src/screens/validator_details/hooks.ts index 23fa3a2b15..102a84e7a4 100644 --- a/apps/web-neutron/src/screens/validator_details/hooks.ts +++ b/apps/web-neutron/src/screens/validator_details/hooks.ts @@ -47,7 +47,7 @@ const initialState: ValidatorDetailsState = { }; // ============================ -// overview +// Overview // ============================ const formatOverview = (data: ValidatorDetailsQuery) => { const operatorAddress = data?.ccv_validator?.[0]?.consumer_operator_address ?? ''; @@ -68,7 +68,7 @@ const formatOverview = (data: ValidatorDetailsQuery) => { }; // ============================ -// status +// Status // ============================ const formatStatus = (data: ValidatorDetailsQuery) => { const slashingParams = SlashingParams.fromJson( @@ -94,7 +94,7 @@ const formatStatus = (data: ValidatorDetailsQuery) => { }; // ============================ -// votingPower +// Voting Power // ============================ const formatVotingPower = (data: ValidatorDetailsQuery) => { const validator = data?.ccv_validator?.[0]?.ccv_validator_info?.validator; @@ -172,7 +172,6 @@ function formatAccountQuery(data: ValidatorDetailsQuery): Partial { ) : ( )} - + ; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2946,6 +2948,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -2997,6 +3000,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3083,6 +3087,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3135,6 +3275,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5277,10 +5429,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5822,6 +5986,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5842,6 +6024,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7108,10 +7330,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7567,6 +7801,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7587,6 +7839,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11975,6 +12267,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12913,6 +13235,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-nym/src/screens/transactions/__snapshots__/index.test.tsx.snap b/apps/web-nym/src/screens/transactions/__snapshots__/index.test.tsx.snap index c72ee34b52..91cf5385db 100644 --- a/apps/web-nym/src/screens/transactions/__snapshots__/index.test.tsx.snap +++ b/apps/web-nym/src/screens/transactions/__snapshots__/index.test.tsx.snap @@ -46,64 +46,10 @@ exports[`screen: Transactions matches snapshot 1`] = ` id="TransactionsList" isItemLoaded={[Function]} isNextPageLoading={false} - itemCount={1} + itemCount={0} loadMoreItems={[Function]} loadNextPage={[Function]} - transactions={ - [ - { - "hash": "D223E2E4E4FD29868D1034EFE5FB162EAB78B4CCE1D53EFD4F34A40608FB6C4B", - "height": 432022, - "messages": { - "count": 2, - "items": [ - { - "amounts": [ - { - "baseDenom": "unyx", - "displayDenom": "unyx", - "exponent": 0, - "value": "0", - }, - ], - "category": "distribution", - "delegatorAddress": "desmos18kvwy5hzcu3ss08lcfcnx0eajuecg69ujmkwjr", - "json": { - "@type": "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - "delegator_address": "desmos18kvwy5hzcu3ss08lcfcnx0eajuecg69ujmkwjr", - "validator_address": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - "type": "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - "validatorAddress": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - { - "amounts": [ - { - "baseDenom": "unyx", - "displayDenom": "unyx", - "exponent": 0, - "value": "0", - }, - ], - "category": "distribution", - "json": { - "@type": "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", - "validator_address": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - "type": "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", - "validatorAddress": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - ], - }, - "success": true, - "timestamp": "2021-05-28T00:08:33.700487", - "type": [ - "Withdraw Delegator Reward", - "Withdraw Validator Commission", - ], - }, - ] - } + transactions={[]} />
diff --git a/apps/web-osmosis/src/graphql/general/message_types.graphql b/apps/web-osmosis/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-osmosis/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-osmosis/src/graphql/general/proposal_details.graphql b/apps/web-osmosis/src/graphql/general/proposal_details.graphql index 231f3fdfee..346c6cc288 100644 --- a/apps/web-osmosis/src/graphql/general/proposal_details.graphql +++ b/apps/web-osmosis/src/graphql/general/proposal_details.graphql @@ -8,7 +8,6 @@ query ProposalDetails($proposalId: Int) { proposalId: id submitTime: submit_time metadata - summary depositEndTime: deposit_end_time votingStartTime: voting_start_time votingEndTime: voting_end_time diff --git a/apps/web-osmosis/src/graphql/types/general_types.ts b/apps/web-osmosis/src/graphql/types/general_types.ts index de9da2e3ee..6781d68bb4 100644 --- a/apps/web-osmosis/src/graphql/types/general_types.ts +++ b/apps/web-osmosis/src/graphql/types/general_types.ts @@ -2843,6 +2843,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -2923,6 +2925,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -2969,6 +2972,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -3044,6 +3048,142 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3098,23 +3238,12 @@ export type Messages_By_Single_Address_Args = { types?: InputMaybe; }; -export type Messages_By_Types_Args = { +export type Messages_By_Type_Args = { limit?: InputMaybe; offset?: InputMaybe; types?: InputMaybe; }; -export type Messages_Get_Types_Args = { - limit?: InputMaybe; - offset?: InputMaybe; -}; - -export type Messages_Get_Types_New_Args = { - addresses?: InputMaybe; - limit?: InputMaybe; - offset?: InputMaybe; -}; - export type Messages_Types_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -5193,6 +5322,10 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -5201,18 +5334,10 @@ export type Query_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; - /** execute function "messages_by_types" which returns "message" */ - messages_by_types: Array; - /** execute function "messages_by_types" and query aggregates on result of table type "message" */ - messages_by_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types" which returns "message" */ - messages_get_types: Array; - /** execute function "messages_get_types" and query aggregates on result of table type "message" */ - messages_get_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types_new" which returns "message" */ - messages_get_types_new: Array; - /** execute function "messages_get_types_new" and query aggregates on result of table type "message" */ - messages_get_types_new_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ @@ -5749,48 +5874,26 @@ export type Query_RootMessage_AggregateArgs = { }; -export type Query_RootMessages_By_AddressArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootMessages_By_Address_AggregateArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Query_RootMessages_By_Single_AddressArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Query_RootMessages_By_Single_Address_AggregateArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Query_RootMessages_By_TypesArgs = { - args: Messages_By_Types_Args; +export type Query_RootMessages_By_AddressArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5799,8 +5902,8 @@ export type Query_RootMessages_By_TypesArgs = { }; -export type Query_RootMessages_By_Types_AggregateArgs = { - args: Messages_By_Types_Args; +export type Query_RootMessages_By_Address_AggregateArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5809,8 +5912,8 @@ export type Query_RootMessages_By_Types_AggregateArgs = { }; -export type Query_RootMessages_Get_TypesArgs = { - args: Messages_Get_Types_Args; +export type Query_RootMessages_By_Single_AddressArgs = { + args: Messages_By_Single_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5819,8 +5922,8 @@ export type Query_RootMessages_Get_TypesArgs = { }; -export type Query_RootMessages_Get_Types_AggregateArgs = { - args: Messages_Get_Types_Args; +export type Query_RootMessages_By_Single_Address_AggregateArgs = { + args: Messages_By_Single_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5829,8 +5932,8 @@ export type Query_RootMessages_Get_Types_AggregateArgs = { }; -export type Query_RootMessages_Get_Types_NewArgs = { - args: Messages_Get_Types_New_Args; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -5839,8 +5942,8 @@ export type Query_RootMessages_Get_Types_NewArgs = { }; -export type Query_RootMessages_Get_Types_New_AggregateArgs = { - args: Messages_Get_Types_New_Args; +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7139,6 +7242,10 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -7147,18 +7254,10 @@ export type Subscription_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; - /** execute function "messages_by_types" which returns "message" */ - messages_by_types: Array; - /** execute function "messages_by_types" and query aggregates on result of table type "message" */ - messages_by_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types" which returns "message" */ - messages_get_types: Array; - /** execute function "messages_get_types" and query aggregates on result of table type "message" */ - messages_get_types_aggregate: Message_Aggregate; - /** execute function "messages_get_types_new" which returns "message" */ - messages_get_types_new: Array; - /** execute function "messages_get_types_new" and query aggregates on result of table type "message" */ - messages_get_types_new_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_types_by_address" which returns "message" */ messages_types_by_address: Array; /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ @@ -7596,48 +7695,26 @@ export type Subscription_RootMessage_AggregateArgs = { }; -export type Subscription_RootMessages_By_AddressArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_Address_AggregateArgs = { - args: Messages_By_Address_Args; - distinct_on?: InputMaybe>; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Subscription_RootMessages_By_Single_AddressArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; -export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { - args: Messages_By_Single_Address_Args; - distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; - order_by?: InputMaybe>; - where?: InputMaybe; -}; - - -export type Subscription_RootMessages_By_TypesArgs = { - args: Messages_By_Types_Args; +export type Subscription_RootMessages_By_AddressArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7646,8 +7723,8 @@ export type Subscription_RootMessages_By_TypesArgs = { }; -export type Subscription_RootMessages_By_Types_AggregateArgs = { - args: Messages_By_Types_Args; +export type Subscription_RootMessages_By_Address_AggregateArgs = { + args: Messages_By_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7656,8 +7733,8 @@ export type Subscription_RootMessages_By_Types_AggregateArgs = { }; -export type Subscription_RootMessages_Get_TypesArgs = { - args: Messages_Get_Types_Args; +export type Subscription_RootMessages_By_Single_AddressArgs = { + args: Messages_By_Single_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7666,8 +7743,8 @@ export type Subscription_RootMessages_Get_TypesArgs = { }; -export type Subscription_RootMessages_Get_Types_AggregateArgs = { - args: Messages_Get_Types_Args; +export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { + args: Messages_By_Single_Address_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7676,8 +7753,8 @@ export type Subscription_RootMessages_Get_Types_AggregateArgs = { }; -export type Subscription_RootMessages_Get_Types_NewArgs = { - args: Messages_Get_Types_New_Args; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -7686,8 +7763,8 @@ export type Subscription_RootMessages_Get_Types_NewArgs = { }; -export type Subscription_RootMessages_Get_Types_New_AggregateArgs = { - args: Messages_Get_Types_New_Args; +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; distinct_on?: InputMaybe>; limit?: InputMaybe; offset?: InputMaybe; @@ -12821,6 +12898,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: string }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }>, mintParams: Array<{ __typename?: 'mint_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12846,7 +12953,7 @@ export type ProposalDetailsQueryVariables = Exact<{ }>; -export type ProposalDetailsQuery = { proposal: Array<{ __typename?: 'proposal', title: string, description: string, status?: string | null, content: any, metadata?: string | null, summary?: string | null, proposer: string, proposalId: number, submitTime: any, depositEndTime?: any | null, votingStartTime?: any | null, votingEndTime?: any | null }> }; +export type ProposalDetailsQuery = { proposal: Array<{ __typename?: 'proposal', title: string, description: string, status?: string | null, content: any, metadata?: string | null, proposer: string, proposalId: number, submitTime: any, depositEndTime?: any | null, votingStartTime?: any | null, votingEndTime?: any | null }> }; export type ProposalDetailsTallyQueryVariables = Exact<{ proposalId?: InputMaybe; @@ -13762,6 +13869,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( @@ -13921,7 +14196,6 @@ export const ProposalDetailsDocument = gql` proposalId: id submitTime: submit_time metadata - summary depositEndTime: deposit_end_time votingStartTime: voting_start_time votingEndTime: voting_end_time diff --git a/apps/web-persistence/src/graphql/general/message_types.graphql b/apps/web-persistence/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-persistence/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-persistence/src/graphql/types/general_types.ts b/apps/web-persistence/src/graphql/types/general_types.ts index c2765b70fb..8d29e9bbed 100644 --- a/apps/web-persistence/src/graphql/types/general_types.ts +++ b/apps/web-persistence/src/graphql/types/general_types.ts @@ -1486,6 +1486,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1529,6 +1531,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1557,6 +1560,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1771,6 +1775,12 @@ export type Messages_By_Type_Args = { types?: InputMaybe; }; +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -3123,6 +3133,8 @@ export type Query_Root = { messages_by_address: Array; /** execute function "messages_by_type" which returns "message" */ messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3521,6 +3533,16 @@ export type Query_RootMessages_By_TypeArgs = { }; +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4317,6 +4339,8 @@ export type Subscription_Root = { messages_by_address: Array; /** execute function "messages_by_type" which returns "message" */ messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4629,6 +4653,16 @@ export type Subscription_RootMessages_By_TypeArgs = { }; +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -8498,6 +8532,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -9454,6 +9518,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-persistence/src/screens/proposal_details/components/votes_graph/index.tsx b/apps/web-persistence/src/screens/proposal_details/components/votes_graph/index.tsx new file mode 100644 index 0000000000..ca5b6176a5 --- /dev/null +++ b/apps/web-persistence/src/screens/proposal_details/components/votes_graph/index.tsx @@ -0,0 +1,92 @@ +import Box from '@/components/box'; +import InfoPopover from '@/components/info_popover'; +import QuorumExplanation from '@/screens/proposal_details/components/votes_graph/components/quorum_explanation'; +import { useVotesGraph } from '@/screens/proposal_details/components/votes_graph/hooks'; +import useStyles from '@/screens/proposal_details/components/votes_graph/styles'; +import { formatGraphData } from '@/screens/proposal_details/components/votes_graph/utils'; +import Typography from '@mui/material/Typography'; +import Big from 'big.js'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import dynamic from 'next/dynamic'; +import numeral from 'numeral'; +import { FC } from 'react'; +import { Cell, Pie, PieChart } from 'recharts'; + +const DynamicPieChart = dynamic(() => Promise.resolve(PieChart), { ssr: false }); + +const VotesGraph: FC = (props) => { + const { classes, cx, theme } = useStyles(); + const { t } = useAppTranslation('proposals'); + const { state } = useVotesGraph(); + const { votes } = state; + const { quorum } = state; + + const total = Big(votes.yes.value) + .plus(votes.no.value) + .plus(votes.veto.value) + .plus(votes.abstain.value); + + const formattedData = formatGraphData({ + data: votes, + theme, + total, + }); + const bonded = Big(state.bonded?.value || 0); + const totalVotedFormat = numeral(total.toFixed(2)).format('0,0.[00]'); + const totalBondedFormat = numeral(bonded.toNumber()).format('0,0.[00]'); + const totalVotedPercent = + total.gt(0) && !bonded.eq(0) + ? `${numeral(Big(total.toFixed(2)).div(bonded)?.times(100).toFixed(2)).format('0.[00]')}%` + : '0%'; + + return ( + +
+ + + {formattedData.map((entry, index) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + + +
+
+
+ + {t('votedTotalCaption', { + totalVotedPercent, + })} + + + {totalVotedFormat} / {totalBondedFormat} + +
+ + {formattedData + .filter((x) => String(x.name) !== 'empty') + .map((x) => ( +
+ + {t(x.name)} ({x.percentage}) + + {x.display} +
+ ))} +
+
+ } /> +
+
+ ); +}; + +export default VotesGraph; diff --git a/apps/web-persistence/src/screens/proposal_details/components/votes_graph/types.ts b/apps/web-persistence/src/screens/proposal_details/components/votes_graph/types.ts new file mode 100644 index 0000000000..52371b2fe3 --- /dev/null +++ b/apps/web-persistence/src/screens/proposal_details/components/votes_graph/types.ts @@ -0,0 +1,11 @@ +export interface VotesType { + yes: TokenUnit; + no: TokenUnit; + abstain: TokenUnit; + veto: TokenUnit; +} +export interface VotesGraphState { + votes: VotesType; + bonded: TokenUnit; + quorum: string; +} diff --git a/apps/web-provenance/src/graphql/general/message_types.graphql b/apps/web-provenance/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-provenance/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-provenance/src/graphql/types/general_types.ts b/apps/web-provenance/src/graphql/types/general_types.ts index 22e4c746ad..0155c60338 100644 --- a/apps/web-provenance/src/graphql/types/general_types.ts +++ b/apps/web-provenance/src/graphql/types/general_types.ts @@ -3175,6 +3175,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -3259,6 +3261,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3310,6 +3313,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3396,6 +3400,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3448,6 +3588,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5591,10 +5743,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -6163,6 +6327,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -6183,6 +6365,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7255,10 +7477,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7741,6 +7975,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7761,6 +8013,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11986,6 +12278,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12976,6 +13298,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-quasar/src/graphql/general/message_types.graphql b/apps/web-quasar/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-quasar/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-quasar/src/graphql/types/general_types.ts b/apps/web-quasar/src/graphql/types/general_types.ts index 3fbacc0582..1a4430c556 100644 --- a/apps/web-quasar/src/graphql/types/general_types.ts +++ b/apps/web-quasar/src/graphql/types/general_types.ts @@ -185,6 +185,10 @@ export type Account = { __typename?: 'account'; address: Scalars['String']; /** An array relationship */ + feeGrantAllowancesByGranterAddress: Array; + /** An array relationship */ + fee_grant_allowances: Array; + /** An array relationship */ proposal_deposits: Array; /** An array relationship */ proposal_votes: Array; @@ -198,6 +202,30 @@ export type Account = { vesting_account?: Maybe; /** An array relationship */ vesting_accounts: Array; + /** An array relationship */ + wasm_contracts: Array; + /** An aggregate relationship */ + wasm_contracts_aggregate: Wasm_Contract_Aggregate; +}; + + +/** columns and relationships of "account" */ +export type AccountFeeGrantAllowancesByGranterAddressArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "account" */ +export type AccountFee_Grant_AllowancesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; }; @@ -260,29 +288,55 @@ export type AccountVesting_AccountsArgs = { where?: InputMaybe; }; + +/** columns and relationships of "account" */ +export type AccountWasm_ContractsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** columns and relationships of "account" */ +export type AccountWasm_Contracts_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "account". All fields are combined with a logical 'AND'. */ export type Account_Bool_Exp = { _and?: InputMaybe>; _not?: InputMaybe; _or?: InputMaybe>; address?: InputMaybe; + feeGrantAllowancesByGranterAddress?: InputMaybe; + fee_grant_allowances?: InputMaybe; proposal_deposits?: InputMaybe; proposal_votes?: InputMaybe; proposals?: InputMaybe; validator_infos?: InputMaybe; vesting_account?: InputMaybe; vesting_accounts?: InputMaybe; + wasm_contracts?: InputMaybe; }; /** Ordering options when selecting data from "account". */ export type Account_Order_By = { address?: InputMaybe; + feeGrantAllowancesByGranterAddress_aggregate?: InputMaybe; + fee_grant_allowances_aggregate?: InputMaybe; proposal_deposits_aggregate?: InputMaybe; proposal_votes_aggregate?: InputMaybe; proposals_aggregate?: InputMaybe; validator_infos_aggregate?: InputMaybe; vesting_account?: InputMaybe; vesting_accounts_aggregate?: InputMaybe; + wasm_contracts_aggregate?: InputMaybe; }; /** select columns of table "account" */ @@ -1077,6 +1131,26 @@ export type Fee_Grant_AllowanceAllowanceArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Avg_Order_By = { + height?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "fee_grant_allowance". All fields are combined with a logical 'AND'. */ export type Fee_Grant_Allowance_Bool_Exp = { _and?: InputMaybe>; @@ -1090,6 +1164,20 @@ export type Fee_Grant_Allowance_Bool_Exp = { height?: InputMaybe; }; +/** order by max() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Max_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + +/** order by min() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Min_Order_By = { + grantee_address?: InputMaybe; + granter_address?: InputMaybe; + height?: InputMaybe; +}; + /** Ordering options when selecting data from "fee_grant_allowance". */ export type Fee_Grant_Allowance_Order_By = { allowance?: InputMaybe; @@ -1112,6 +1200,41 @@ export enum Fee_Grant_Allowance_Select_Column { Height = 'height' } +/** order by stddev() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Stddev_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by sum() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Sum_Order_By = { + height?: InputMaybe; +}; + +/** order by var_pop() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Pop_Order_By = { + height?: InputMaybe; +}; + +/** order by var_samp() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Var_Samp_Order_By = { + height?: InputMaybe; +}; + +/** order by variance() on columns of table "fee_grant_allowance" */ +export type Fee_Grant_Allowance_Variance_Order_By = { + height?: InputMaybe; +}; + /** columns and relationships of "genesis" */ export type Genesis = { __typename?: 'genesis'; @@ -1265,7 +1388,11 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; + /** An object relationship */ + transactionByPartitionIdTransactionHash?: Maybe; transaction_hash: Scalars['String']; type: Scalars['String']; value: Scalars['jsonb']; @@ -1277,6 +1404,27 @@ export type MessageValueArgs = { path?: InputMaybe; }; +/** order by aggregate values of table "message" */ +export type Message_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** order by avg() on columns of table "message" */ +export type Message_Avg_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + /** Boolean expression to filter rows from the table "message". All fields are combined with a logical 'AND'. */ export type Message_Bool_Exp = { _and?: InputMaybe>; @@ -1285,18 +1433,38 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; }; +/** order by max() on columns of table "message" */ +export type Message_Max_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + +/** order by min() on columns of table "message" */ +export type Message_Min_Order_By = { + height?: InputMaybe; + index?: InputMaybe; + transaction_hash?: InputMaybe; + type?: InputMaybe; +}; + /** Ordering options when selecting data from "message". */ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -1318,6 +1486,184 @@ export enum Message_Select_Column { Value = 'value' } +/** order by stddev() on columns of table "message" */ +export type Message_Stddev_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_pop() on columns of table "message" */ +export type Message_Stddev_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by stddev_samp() on columns of table "message" */ +export type Message_Stddev_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by sum() on columns of table "message" */ +export type Message_Sum_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + +/** order by var_pop() on columns of table "message" */ +export type Message_Var_Pop_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by var_samp() on columns of table "message" */ +export type Message_Var_Samp_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + +/** order by variance() on columns of table "message" */ +export type Message_Variance_Order_By = { + height?: InputMaybe; + index?: InputMaybe; +}; + export type Messages_By_Address_Args = { addresses?: InputMaybe; limit?: InputMaybe; @@ -1325,6 +1671,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2674,8 +3032,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3016,6 +3382,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3026,6 +3410,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -3783,8 +4187,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4039,6 +4451,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4049,6 +4479,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4970,6 +5420,8 @@ export type Transaction = { logs?: Maybe; memo?: Maybe; messages: Scalars['jsonb']; + /** An array relationship */ + messagesByTransactionHashPartitionId: Array; raw_log?: Maybe; signatures: Scalars['_text']; signer_infos: Scalars['jsonb']; @@ -4995,6 +5447,16 @@ export type TransactionMessagesArgs = { }; +/** columns and relationships of "transaction" */ +export type TransactionMessagesByTransactionHashPartitionIdArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + /** columns and relationships of "transaction" */ export type TransactionSigner_InfosArgs = { path?: InputMaybe; @@ -5036,6 +5498,7 @@ export type Transaction_Bool_Exp = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByTransactionHashPartitionId?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe<_Text_Comparison_Exp>; signer_infos?: InputMaybe; @@ -5073,6 +5536,7 @@ export type Transaction_Order_By = { logs?: InputMaybe; memo?: InputMaybe; messages?: InputMaybe; + messagesByTransactionHashPartitionId_aggregate?: InputMaybe; raw_log?: InputMaybe; signatures?: InputMaybe; signer_infos?: InputMaybe; @@ -6697,6 +7161,8 @@ export type Wasm_Code_Variance_Fields = { /** columns and relationships of "wasm_contract" */ export type Wasm_Contract = { __typename?: 'wasm_contract'; + /** An object relationship */ + account: Account; admin?: Maybe; code_id: Scalars['bigint']; contract_address: Scalars['String']; @@ -6813,6 +7279,7 @@ export type Wasm_Contract_Bool_Exp = { _and?: InputMaybe>; _not?: InputMaybe; _or?: InputMaybe>; + account?: InputMaybe; admin?: InputMaybe; code_id?: InputMaybe; contract_address?: InputMaybe; @@ -6890,6 +7357,7 @@ export type Wasm_Contract_Min_Order_By = { /** Ordering options when selecting data from "wasm_contract". */ export type Wasm_Contract_Order_By = { + account?: InputMaybe; admin?: InputMaybe; code_id?: InputMaybe; contract_address?: InputMaybe; @@ -7536,6 +8004,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -8474,6 +8972,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-quicksilver/src/graphql/general/message_types.graphql b/apps/web-quicksilver/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-quicksilver/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-quicksilver/src/graphql/types/general_types.ts b/apps/web-quicksilver/src/graphql/types/general_types.ts index 4b99e411ce..335b85c829 100644 --- a/apps/web-quicksilver/src/graphql/types/general_types.ts +++ b/apps/web-quicksilver/src/graphql/types/general_types.ts @@ -1477,6 +1477,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1520,6 +1522,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1548,6 +1551,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1595,6 +1599,142 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -1620,6 +1760,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -2975,8 +3127,16 @@ export type Query_Root = { interchainstaking_params_by_pk?: Maybe; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3332,6 +3492,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3342,6 +3520,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4073,8 +4271,16 @@ export type Subscription_Root = { interchainstaking_params_by_pk?: Maybe; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4344,6 +4550,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4354,6 +4578,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7519,6 +7763,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -8464,6 +8738,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-regen/src/graphql/general/message_types.graphql b/apps/web-regen/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-regen/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-regen/src/graphql/types/general_types.ts b/apps/web-regen/src/graphql/types/general_types.ts index b8e7d251ae..359ec6adcb 100644 --- a/apps/web-regen/src/graphql/types/general_types.ts +++ b/apps/web-regen/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3143,6 +3283,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5272,10 +5424,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5811,6 +5975,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5831,6 +6013,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7060,10 +7282,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7513,6 +7747,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7533,6 +7785,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11763,6 +12055,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12701,6 +13023,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-rizon/src/graphql/general/message_types.graphql b/apps/web-rizon/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-rizon/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-rizon/src/graphql/types/general_types.ts b/apps/web-rizon/src/graphql/types/general_types.ts index 4f9b1f2b37..eacb88acac 100644 --- a/apps/web-rizon/src/graphql/types/general_types.ts +++ b/apps/web-rizon/src/graphql/types/general_types.ts @@ -2738,9 +2738,13 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; + /** An object relationship */ + transactionByPartitionIdTransactionHash?: Maybe; transaction_hash: Scalars['String']; type: Scalars['String']; value: Scalars['jsonb']; @@ -2798,8 +2802,10 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -2830,8 +2836,10 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; + transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; type?: InputMaybe; value?: InputMaybe; @@ -2887,6 +2895,142 @@ export type Message_Sum_Fields = { partition_id?: Maybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -2918,6 +3062,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5033,10 +5189,22 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5568,6 +5736,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5588,6 +5774,46 @@ export type Query_RootMessages_By_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -6636,10 +6862,22 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ messages_by_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7085,6 +7323,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7105,6 +7361,46 @@ export type Subscription_RootMessages_By_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11278,6 +11574,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12216,6 +12542,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-stride/src/graphql/general/message_types.graphql b/apps/web-stride/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-stride/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-stride/src/graphql/types/general_types.ts b/apps/web-stride/src/graphql/types/general_types.ts index 506f95f92f..c30108a4ba 100644 --- a/apps/web-stride/src/graphql/types/general_types.ts +++ b/apps/web-stride/src/graphql/types/general_types.ts @@ -1929,6 +1929,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1972,6 +1974,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -2000,6 +2003,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -2065,6 +2069,158 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** Streaming cursor of the table "message_type" */ +export type Message_Type_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Message_Type_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Message_Type_Stream_Cursor_Value_Input = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -2098,6 +2254,18 @@ export type Messages_By_Single_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -8344,10 +8512,18 @@ export type Query_Root = { inflation_by_pk?: Maybe; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_single_address" which returns "message" */ messages_by_single_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -8722,6 +8898,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -8742,6 +8936,26 @@ export type Query_RootMessages_By_Single_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -9530,10 +9744,20 @@ export type Subscription_Root = { message: Array; /** fetch data from the table in a streaming manner: "message" */ message_stream: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; + /** fetch data from the table in a streaming manner: "message_type" */ + message_type_stream: Array; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_single_address" which returns "message" */ messages_by_single_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table in a streaming manner: "mint_params" */ @@ -9990,6 +10214,31 @@ export type Subscription_RootMessage_StreamArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_StreamArgs = { + batch_size: Scalars['Int']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -10010,6 +10259,26 @@ export type Subscription_RootMessages_By_Single_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -13066,6 +13335,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -14021,6 +14320,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web-wormhole/src/graphql/general/message_types.graphql b/apps/web-wormhole/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web-wormhole/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web-wormhole/src/graphql/types/general_types.ts b/apps/web-wormhole/src/graphql/types/general_types.ts index 9af3fe8dbd..fb79591e82 100644 --- a/apps/web-wormhole/src/graphql/types/general_types.ts +++ b/apps/web-wormhole/src/graphql/types/general_types.ts @@ -1673,6 +1673,8 @@ export type Message = { index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; /** An object relationship */ + message_type?: Maybe; + /** An object relationship */ transaction?: Maybe; /** An object relationship */ transactionByPartitionIdTransactionHash?: Maybe; @@ -1716,6 +1718,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1744,6 +1747,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; transaction_hash?: InputMaybe; @@ -1791,6 +1795,142 @@ export type Message_Sum_Order_By = { index?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** order by var_pop() on columns of table "message" */ export type Message_Var_Pop_Order_By = { height?: InputMaybe; @@ -1816,6 +1956,18 @@ export type Messages_By_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -3175,8 +3327,16 @@ export type Query_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -3568,6 +3728,24 @@ export type Query_RootMessageArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -3578,6 +3756,26 @@ export type Query_RootMessages_By_AddressArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -4390,8 +4588,16 @@ export type Subscription_Root = { inflation: Array; /** fetch data from the table: "message" */ message: Array; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch data from the table: "modules" */ @@ -4697,6 +4903,24 @@ export type Subscription_RootMessageArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -4707,6 +4931,26 @@ export type Subscription_RootMessages_By_AddressArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -8555,6 +8799,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -9493,6 +9767,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/apps/web/src/graphql/general/message_types.graphql b/apps/web/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/apps/web/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/apps/web/src/graphql/types/general_types.ts b/apps/web/src/graphql/types/general_types.ts index a697046747..029837f080 100644 --- a/apps/web/src/graphql/types/general_types.ts +++ b/apps/web/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3151,11 +3291,23 @@ export type Messages_By_Single_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + export type Messages_Get_Types_Args = { limit?: InputMaybe; offset?: InputMaybe; }; +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5289,6 +5441,10 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -5297,10 +5453,18 @@ export type Query_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_get_types" which returns "message" */ messages_get_types: Array; /** execute function "messages_get_types" and query aggregates on result of table type "message" */ messages_get_types_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5843,6 +6007,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5883,6 +6065,26 @@ export type Query_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_Get_TypesArgs = { args: Messages_Get_Types_Args; distinct_on?: InputMaybe>; @@ -5903,6 +6105,26 @@ export type Query_RootMessages_Get_Types_AggregateArgs = { }; +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7146,6 +7368,10 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -7154,10 +7380,18 @@ export type Subscription_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_get_types" which returns "message" */ messages_get_types: Array; /** execute function "messages_get_types" and query aggregates on result of table type "message" */ messages_get_types_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7607,6 +7841,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7647,6 +7899,26 @@ export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_Get_TypesArgs = { args: Messages_Get_Types_Args; distinct_on?: InputMaybe>; @@ -7667,6 +7939,26 @@ export type Subscription_RootMessages_Get_Types_AggregateArgs = { }; +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11897,6 +12189,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12835,6 +13157,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/packages/shared-utils/assets/icon-filter-transactions.svg b/packages/shared-utils/assets/icon-filter-transactions.svg new file mode 100644 index 0000000000..a3d1f8752b --- /dev/null +++ b/packages/shared-utils/assets/icon-filter-transactions.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/shared-utils/assets/icon-search.svg b/packages/shared-utils/assets/icon-search.svg new file mode 100644 index 0000000000..acf3791c19 --- /dev/null +++ b/packages/shared-utils/assets/icon-search.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/ui/public/locales/en/common.json b/packages/ui/public/locales/en/common.json index 1ec4f8f51b..8770cc8f2d 100644 --- a/packages/ui/public/locales/en/common.json +++ b/packages/ui/public/locales/en/common.json @@ -89,5 +89,8 @@ "loginSuccessMsg": "The system will automatically redirect to the previous \npage in 3 seconds.", "connectWalletConnect": "Connect Wallet Connect", "scanWalletConnectQR": "Please scan the QR with a WalletConnect compatible Wallet.", - "walletTitle": "Connected wallets" + "walletTitle": "Connected wallets", + "searchType": "Search type", + "selectAll": "Select All", + "filter": "Filter" } diff --git a/packages/ui/public/locales/it/common.json b/packages/ui/public/locales/it/common.json index 2cc8d202ba..99a37e788a 100644 --- a/packages/ui/public/locales/it/common.json +++ b/packages/ui/public/locales/it/common.json @@ -89,5 +89,8 @@ "loginSuccessMsg": "The system will automatically redirect to the previous \npage in 3 seconds.", "connectWalletConnect": "Connect Wallet Connect", "scanWalletConnectQR": "Please scan the QR with a WalletConnect compatible Wallet.", - "walletTitle": "Connected wallets" + "walletTitle": "Connected wallets", + "searchType": "Tipo di ricerca", + "selectAll": "Seleziona tutto", + "filter": "Filtro" } diff --git a/packages/ui/public/locales/pl/common.json b/packages/ui/public/locales/pl/common.json index f058d8fe15..6b17d9e467 100644 --- a/packages/ui/public/locales/pl/common.json +++ b/packages/ui/public/locales/pl/common.json @@ -89,5 +89,8 @@ "loginSuccessMsg": "The system will automatically redirect to the previous \npage in 3 seconds.", "connectWalletConnect": "Connect Wallet Connect", "scanWalletConnectQR": "Please scan the QR with a WalletConnect compatible Wallet.", - "walletTitle": "Connected wallets" + "walletTitle": "Connected wallets", + "searchType": "Wyszukaj typ", + "selectAll": "Wybierz wszystko", + "filter": "Filtruj" } diff --git a/packages/ui/public/locales/zhs/common.json b/packages/ui/public/locales/zhs/common.json index 184bb3a585..1c4867952d 100644 --- a/packages/ui/public/locales/zhs/common.json +++ b/packages/ui/public/locales/zhs/common.json @@ -89,5 +89,8 @@ "loginSuccessMsg": "The system will automatically redirect to the previous \npage in 3 seconds.", "connectWalletConnect": "Connect Wallet Connect", "scanWalletConnectQR": "Please scan the QR with a WalletConnect compatible Wallet.", - "walletTitle": "Connected wallets" + "walletTitle": "Connected wallets", + "searchType": "搜索类型", + "selectAll": "全选", + "filter": "过滤器" } diff --git a/packages/ui/public/locales/zht/common.json b/packages/ui/public/locales/zht/common.json index cc6751ad17..e5841dc887 100644 --- a/packages/ui/public/locales/zht/common.json +++ b/packages/ui/public/locales/zht/common.json @@ -87,5 +87,8 @@ "loginSuccessMsg": "The system will automatically redirect to the previous \npage in 3 seconds.", "connectWalletConnect": "Connect Wallet Connect", "scanWalletConnectQR": "Please scan the QR with a WalletConnect compatible Wallet.", - "walletTitle": "Connected wallets" + "walletTitle": "Connected wallets", + "searchType": "搜尋類型", + "selectAll": "全選", + "filter": "過濾器" } diff --git a/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/hooks.ts b/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/hooks.ts new file mode 100644 index 0000000000..7e35e2c4ea --- /dev/null +++ b/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/hooks.ts @@ -0,0 +1,34 @@ +import { ChangeEventHandler, KeyboardEventHandler, useState } from 'react'; + +export const useTxTypeSearch = (callback: (value: string, clear?: () => void) => void) => { + const [value, setValue] = useState(''); + const handleOnChange: ChangeEventHandler = (e) => { + const newValue = e?.target?.value ?? ''; + setValue(newValue); + callback(newValue, clear); + }; + + const handleOnSubmit = () => { + callback(value, clear); + }; + + const handleKeyDown: KeyboardEventHandler = (e) => { + const shift = e?.shiftKey; + const isEnter = e?.keyCode === 13 || e?.key === 'Enter'; + if (isEnter && !shift) { + e.preventDefault(); + callback(value, clear); + } + }; + + const clear = () => { + setValue(''); + }; + + return { + handleOnChange, + handleOnSubmit, + value, + handleKeyDown, + }; +}; diff --git a/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/index.tsx b/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/index.tsx new file mode 100644 index 0000000000..8e0da13137 --- /dev/null +++ b/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/index.tsx @@ -0,0 +1,37 @@ +import InputAdornment from '@mui/material/InputAdornment'; +import InputBase from '@mui/material/InputBase'; +import { FC } from 'react'; +import { useTxTypeSearch } from '@/components/transaction_type_filter/components/transaction_type_search/hooks'; +import useStyles from '@/components/transaction_type_filter/components/transaction_type_search/styles'; +import IconSearch from 'shared-utils/assets/icon-search.svg'; + +type TxTypeSearchProps = { + className?: string; + placeholder: string; + callback: (value: string) => void; +}; + +const TxTypeSearch: FC = ({ className, placeholder, callback }) => { + const { classes, cx } = useStyles(); + const { handleOnSubmit, handleOnChange, handleKeyDown, value } = useTxTypeSearch(callback); + return ( +
+ + + + } + /> + + ); +}; + +export default TxTypeSearch; diff --git a/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/styles.ts b/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/styles.ts new file mode 100644 index 0000000000..3a22d5343c --- /dev/null +++ b/packages/ui/src/components/transaction_type_filter/components/transaction_type_search/styles.ts @@ -0,0 +1,25 @@ +import { makeStyles } from 'tss-react/mui'; + +const useStyles = makeStyles()(theme => ({ + root: { + '& .MuiInputBase-root': { + width: '300px', + height: '32px', + background: + theme.palette.mode === 'dark' ? theme.palette.divider : theme.palette.background.default, + padding: theme.spacing(0.4, 1.2), + borderRadius: '8px', + }, + '& .MuiInputBase-input': { + textOverflow: 'ellipsis', + '&::placeholder': { + color: theme.palette.custom.fonts.fontFour, + }, + }, + }, + iconSearch: { + fill: 'none', + }, +})); + +export default useStyles; diff --git a/packages/ui/src/components/transaction_type_filter/hooks.ts b/packages/ui/src/components/transaction_type_filter/hooks.ts new file mode 100644 index 0000000000..fc9b8346b6 --- /dev/null +++ b/packages/ui/src/components/transaction_type_filter/hooks.ts @@ -0,0 +1,279 @@ +// useTransactionTypeFilter hook +import { useEffect, useMemo, useState, ChangeEvent, useCallback } from 'react'; +import { useMessageTypesQuery, useMsgTypesByAddressQuery } from '@/graphql/types/general_types'; +import { SetterOrUpdater, useRecoilState } from 'recoil'; +import { writeFilter, writeOpenDialog, writeSelectedMsgTypes } from '@/recoil/transactions_filter'; +import { useRouter } from 'next/router'; + +// Define types for message type and message types +export type MessageType = { + __typename: string; + type: string; + module: string; + label: string; +}; + +export type MessageTypes = { + message_type: MessageType; +}; + +export const useTransactionTypeFilter = () => { + const router = useRouter(); + + // Fetch message types data based on address or all message types + const { + data: messageTypesData, + error: messageTypesError, + loading: messageTypesLoading, + refetch: messageTypesRefetch, + } = useMessageTypesQuery(); + const { + data: msgTypesByAddressData, + error: msgTypesByAddressError, + loading: msgTypesByAddressLoading, + refetch: msgTypesByAddressRefetch, + } = useMsgTypesByAddressQuery({ + variables: { + addresses: `{${router.query.address}}` as string, + }, + }); + + // Determine page context + const isAccountsPage = useMemo(() => window.location.pathname.includes('/accounts'), []); + const isValidatorDetailsPage = useMemo( + () => window.location.pathname.includes('/validators/'), + [] + ); + + // Determine data, error, loading, and refetch function based on page context + const data = isAccountsPage || isValidatorDetailsPage ? msgTypesByAddressData : messageTypesData; + const error = + isAccountsPage || isValidatorDetailsPage ? msgTypesByAddressError : messageTypesError; + const loading = + isAccountsPage || isValidatorDetailsPage ? msgTypesByAddressLoading : messageTypesLoading; + const refetch = + isAccountsPage || isValidatorDetailsPage ? msgTypesByAddressRefetch : messageTypesRefetch; + + // State for filtered message types and selected filters + const [filteredTypes, setFilteredTypes] = useState<{ module: string; msgTypes: MessageType[] }[]>( + [] + ); + const [selectedFilters, setSelectedFilters] = useState([]); + const [selectAllChecked, setSelectAllChecked] = useState(false); + + // Recoil state for managing filters and dialog state + const [, setFilter] = useRecoilState(writeFilter) as [string, SetterOrUpdater]; + const [, setSelectedMsgs] = useRecoilState(writeSelectedMsgTypes) as [ + string[], + SetterOrUpdater + ]; + const [__, setOpenDialog] = useRecoilState(writeOpenDialog) as [ + boolean, + SetterOrUpdater + ]; + + // Fetch data again if there's an error + useEffect(() => { + if (error) refetch(); + }, [error, refetch]); + + // Open and cancel dialog functions + const handleOpen = () => { + setOpenDialog(true); + }; + + const handleCancel = () => { + setOpenDialog(false); + }; + + // Merge all messages by label for transactions page + const mergeAllMsgsByLabelForTxsPage = (messages: MessageType[] | undefined): MessageType[] => { + // Initialize label map + const labelMap: { [key: string]: string } = {}; + + // Iterate over messages to merge by label + messages?.forEach((message) => { + if (!labelMap[message.label]) { + labelMap[message.label] = message.type; + } else { + labelMap[message.label] += `,${message.type}`; + } + }); + + // Initialize reduced messages array + const reducedMessages: MessageType[] = []; + + // Iterate over label map to create reduced messages + Object.entries(labelMap).forEach(([label, type]) => { + reducedMessages.push({ + __typename: 'message_type', + type, + module: messages?.find((msg) => msg.label === label)?.module || '', + label, + }); + }); + + return reducedMessages; + }; + + // Merge messages by label for address pages + const mergeAddressMsgsByLabel = (messages: MessageTypes[] | undefined): MessageType[] => { + // Initialize label map + const labelMap: { [key: string]: string } = {}; + + // Iterate over messages to merge by label + messages?.forEach((message) => { + if (!labelMap[message?.message_type?.label]) { + labelMap[message?.message_type?.label] = message?.message_type?.type; + } else { + labelMap[message?.message_type?.label] += `,${message?.message_type?.type}`; + } + }); + + // Initialize reduced messages array + const reducedMessages: MessageType[] = []; + + // Iterate over label map to create reduced messages + Object.entries(labelMap).forEach(([label, type]) => { + reducedMessages.push({ + __typename: 'message_type', + type, + module: + messages?.find((msg) => msg?.message_type?.label === label)?.message_type?.module || '', + label, + }); + }); + + return reducedMessages; + }; + + // Format message types based on page context + const formatTypes = useCallback( + ( + messages: MessageTypes[] | MessageType[] | null | undefined + ): { module: string; msgTypes: MessageType[] }[] => { + if (!messages) { + return []; + } + const msgs = [...messages]; + + // Merge labels based on page context + const updatedMessages = + isAccountsPage || isValidatorDetailsPage + ? mergeAddressMsgsByLabel(msgs as MessageTypes[]) + : mergeAllMsgsByLabelForTxsPage(msgs as MessageType[]); + + // Initialize module messages map + const moduleMessagesMap: { [key: string]: MessageType[] } = {}; + + // Iterate over updated messages to group by module + updatedMessages.forEach((msgType) => { + if (!moduleMessagesMap[msgType.module]) { + moduleMessagesMap[msgType.module] = []; + } + if (!moduleMessagesMap[msgType.module].some((msg) => msg.label === msgType.label)) { + moduleMessagesMap[msgType.module].push(msgType); + } + }); + + return Object.entries(moduleMessagesMap).map(([module, msgTypes]) => ({ + module, + msgTypes, + })); + }, + [isAccountsPage, isValidatorDetailsPage] + ); + + // Handle filtering transactions based on selected filters + const handleFilterTxs = () => { + const str = selectedFilters.join(','); + const query = `{${str}}`; + setFilter(query); + setSelectedFilters(selectedFilters); + setSelectAllChecked(false); + handleCancel(); + }; + + // Handle selection of transaction types + const handleTxTypeSelection = (event: ChangeEvent) => { + const { checked, value } = event.target; + if (checked) { + setSelectedFilters((prevFilters) => [...prevFilters, value]); + setSelectedMsgs((prevFilters) => [...prevFilters, value]); + } else { + setSelectedFilters((prevFilters) => prevFilters.filter((item) => item !== value)); + setSelectedMsgs((prevFilters) => prevFilters.filter((item) => item !== value)); + setSelectAllChecked(false); + } + }; + + // Handle selection of all transaction types + const handleSelectAllTxTypes = (event: ChangeEvent) => { + const { checked } = event.target; + setSelectAllChecked(checked); + if (checked) { + const allTypes = filteredTypes.flatMap((msgData) => msgData.msgTypes.map((msg) => msg.type)); + setSelectedFilters(allTypes); + setSelectedMsgs(allTypes); + } else { + setSelectedFilters([]); + setSelectedMsgs([]); + } + }; + + // Memoized computation of message type list + const msgTypeList = useMemo(() => { + const typesList = formatTypes( + isAccountsPage || isValidatorDetailsPage + ? (data?.msgTypes as MessageTypes[]) + : (data?.msgTypes as MessageType[]) + ); + typesList.sort((a, b) => a.module.localeCompare(b.module)); + setFilteredTypes(typesList); + return typesList; + }, [data?.msgTypes, formatTypes, isAccountsPage, isValidatorDetailsPage]); + + // Function to search/filter transaction types + const txTypeSearchFilter = useCallback( + (value: string) => { + const parsedValue = value.replace(/\s+/g, '').toLowerCase(); + if (parsedValue === '' || parsedValue === null) { + const typesList = formatTypes( + isAccountsPage || isValidatorDetailsPage + ? (data?.msgTypes as MessageTypes[]) + : (data?.msgTypes as MessageType[]) + ); + typesList.sort((a, b) => a.module.localeCompare(b.module)); + setFilteredTypes(typesList); + } else { + const typesList = formatTypes( + isAccountsPage || isValidatorDetailsPage + ? (data?.msgTypes as MessageTypes[]) + : (data?.msgTypes as MessageType[]) + ); + typesList.sort((a, b) => a.module.localeCompare(b.module)); + const types = typesList.filter( + (v: { module: string; msgTypes: { type: string; label: string }[] }) => + v.msgTypes.some((ms) => ms.type.toLowerCase().indexOf(parsedValue) !== -1) + ); + setFilteredTypes(types); + } + }, + [data?.msgTypes, formatTypes, isAccountsPage, isValidatorDetailsPage] + ); + + return { + data, + loading, + msgTypeList, + filteredTypes, + selectedFilters, + selectAllChecked, + txTypeSearchFilter, + handleCancel, + handleOpen, + handleFilterTxs, + handleTxTypeSelection, + handleSelectAllTxTypes, + }; +}; diff --git a/packages/ui/src/components/transaction_type_filter/index.tsx b/packages/ui/src/components/transaction_type_filter/index.tsx new file mode 100644 index 0000000000..25d2f6e7a0 --- /dev/null +++ b/packages/ui/src/components/transaction_type_filter/index.tsx @@ -0,0 +1,153 @@ +import React, { FC } from 'react'; +import Dialog from '@mui/material/Dialog'; +import DialogContent from '@mui/material/DialogContent'; +import DialogTitle from '@mui/material/DialogTitle'; +import Typography from '@mui/material/Typography'; +import useAppTranslation from '@/hooks/useAppTranslation'; +import FilterTxsIcon from 'shared-utils/assets/icon-filter-transactions.svg'; +import { useTransactionTypeFilter, MessageType } from '@/components/transaction_type_filter/hooks'; +import DialogActions from '@mui/material/DialogActions'; +import Button from '@mui/material/Button'; +import TxTypeSearch from '@/components/transaction_type_filter/components/transaction_type_search'; +import { useRecoilValue } from 'recoil'; +import { readOpenDialog, readSelectedMsgTypes } from '@/recoil/transactions_filter'; +import Checkbox from '@mui/material/Checkbox'; +import Loading from '@/components/loading'; +import useStyles from './styles'; + +const FilterTxsByType: FC = () => { + const { classes } = useStyles(); + const { t } = useAppTranslation('common'); + const { + loading, + filteredTypes, + txTypeSearchFilter, + selectAllChecked, + handleFilterTxs, + handleTxTypeSelection, + handleSelectAllTxTypes, + handleCancel, + handleOpen, + } = useTransactionTypeFilter(); + + const open = useRecoilValue(readOpenDialog) ?? false; + const selectedMsgTypes = useRecoilValue(readSelectedMsgTypes); + + return ( + <> +
+ +
+ + +
+ {t('filter')} +
+
+ +
+
+ {t('selectAll')} + +
+
+ + {!loading ? ( + filteredTypes?.map((msgData) => ( +
+
+ + {msgData?.module?.includes('ibc') + ? msgData.module.charAt(0).toUpperCase() + + msgData.module.charAt(1).toUpperCase() + + msgData.module.charAt(2).toUpperCase() + + msgData.module.slice(3) + : msgData?.module} + +
+
+
+ {msgData?.msgTypes + ?.slice(0, Math.ceil(msgData.msgTypes.length / 2)) + .map((msg: MessageType) => ( +
+ + handleTxTypeSelection(e)} + /> + + {msg?.label + ? msg?.label + .substring(3) + .match(/[A-Z][a-z]+|[0-9]+/g) + ?.join(' ') + : ''} + + +
+ ))} +
+
+ {msgData?.msgTypes + ?.slice(Math.ceil(msgData.msgTypes.length / 2)) + .map((msg: MessageType) => ( +
+ + handleTxTypeSelection(e)} + /> + + {msg?.label + ? msg?.label + .substring(3) + .match(/[A-Z][a-z]+|[0-9]+/g) + ?.join(' ') + : ''} + + +
+ ))} +
+
+
+ )) + ) : ( +
+ +
+ )} +
+ + + +
+ + ); +}; + +export default FilterTxsByType; diff --git a/packages/ui/src/components/transaction_type_filter/styles.ts b/packages/ui/src/components/transaction_type_filter/styles.ts new file mode 100644 index 0000000000..2e80f9e39e --- /dev/null +++ b/packages/ui/src/components/transaction_type_filter/styles.ts @@ -0,0 +1,132 @@ +import { makeStyles } from 'tss-react/mui'; + +const useStyles = makeStyles()((theme) => ({ + checkBox: { + height: '16px', + marginTop: '0.5px', + marginRight: '8px', + width: '16px', + '& svg': { + height: '16px', + width: '16px', + }, + }, + column: { + flexBasis: 'calc(50% - 20px)', + }, + columnContainer: { + display: 'flex', + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'space-between', + }, + dialog: { + zIndex: '1', + '& .MuiDialog-paper': { + borderRadius: '8px', + height: '650px', + width: '500px', + }, + }, + header: { + alignItems: 'center', + display: 'flex', + justifyContent: 'space-between', + paddingBottom: '30px', + paddingTop: '30px', + '& .MuiButtonBase-root': { + padding: 0, + }, + }, + icon: { + '& svg': { + fill: theme.palette.custom.general.icon, + '& path': { + fill: theme.palette.custom.general.icon, + }, + }, + display: 'inline-flex', + marginLeft: theme.spacing(5), + position: 'absolute', + width: '20px', + '&:hover': { + cursor: 'pointer', + }, + }, + loading: { + marginTop: theme.spacing(25), + }, + moduleName: { + paddingBottom: theme.spacing(1), + paddingTop: theme.spacing(3), + '& .MuiTypography-root': { + color: theme.palette.primary.main, + display: 'flex', + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 590, + letterSpacing: '-0.544px', + lineHeight: '20px', + textTransform: 'capitalize', + }, + }, + moduleNameTypography: { + display: 'flex', + fontSize: '16px', + }, + msgLabel: { + color: theme.palette.text.secondary, + display: 'flex', + fontFamily: 'Helvetica Neue', + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 400, + letterSpacing: '0.024px', + lineHeight: '19.09px', + }, + msgOption: { + color: theme.palette.custom.fonts.fontFour, + display: 'flex', + fontFamily: 'Helvetica Neue', + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 400, + letterSpacing: '0.024px', + }, + msgType: { + display: 'flex', + paddingBottom: theme.spacing(0.5), + }, + selectAll: { + alignItems: 'center', + display: 'flex', + left: '401px', + position: 'absolute', + top: '70px', + '& .MuiTypography-root': { + color: theme.palette.text.secondary, + display: 'flex', + fontSize: '14px', + fontStyle: 'normal', + fontWeight: 400, + letterSpacing: '-0.544px', + lineHeight: '16px', + textTransform: 'capitalize', + }, + '& svg': { + height: '16px', + marginRight: '8px', + marginTop: '-3px', + width: '16px', + }, + }, + selectAllText: { + marginRight: '10px', + }, + title: { + alignItems: 'center', + display: 'flex', + }, +})); + +export default useStyles; diff --git a/packages/ui/src/components/transactions_list/components/desktop/index.tsx b/packages/ui/src/components/transactions_list/components/desktop/index.tsx index 59d43128d7..d161f1f294 100644 --- a/packages/ui/src/components/transactions_list/components/desktop/index.tsx +++ b/packages/ui/src/components/transactions_list/components/desktop/index.tsx @@ -13,10 +13,34 @@ import Typography from '@mui/material/Typography'; import useAppTranslation from '@/hooks/useAppTranslation'; import Link from 'next/link'; import numeral from 'numeral'; -import { FC, LegacyRef } from 'react'; +import React, { FC, MutableRefObject, LegacyRef } from 'react'; import AutoSizer from 'react-virtualized-auto-sizer'; import { VariableSizeGrid as Grid } from 'react-window'; import InfiniteLoader from 'react-window-infinite-loader'; +import FilterTxsByType from '@/components/transaction_type_filter'; +import NoData from '@/components/no_data'; + +const useRenderHeaderCell = ({ + columnIndex, + style, +}: { + columnIndex: number; + style: React.CSSProperties; +}) => { + const { key, align } = columns[columnIndex]; + const isTypeKey = key === 'type'; + const { t } = useAppTranslation('transactions'); + const { classes } = useStyles(); + + return ( +
+ + {t(key)} + + {isTypeKey && } +
+ ); +}; const Desktop: FC = ({ className, @@ -25,10 +49,8 @@ const Desktop: FC = ({ isItemLoaded, transactions, }) => { - const { gridRef, columnRef, onResize, getColumnWidth, getRowHeight } = useGrid(columns); - + const { gridRef, onResize, getColumnWidth, getRowHeight, columnRef } = useGrid(columns); const { classes, cx } = useStyles(); - const { t } = useAppTranslation('transactions'); const items = transactions.map((x) => ({ block: ( @@ -54,6 +76,18 @@ const Desktop: FC = ({ time: , messages: numeral(x.messages.count).format('0,0'), })); + + // Default isItemLoaded function + const defaultIsItemLoaded = () => true; + + // Render NoData component if itemCount is 0 + const noDataComponent = + itemCount === 0 ? ( +
+ +
+ ) : null; + return (
@@ -71,30 +105,15 @@ const Desktop: FC = ({ rowHeight={() => 50} width={width ?? 0} > - {({ columnIndex, style }) => { - const { key, align } = columns[columnIndex]; - - return ( -
- - {t(key)} - -
- ); - }} + {useRenderHeaderCell} {/* ======================================= */} {/* Table Body */} {/* ======================================= */} true)} + isItemLoaded={isItemLoaded ?? defaultIsItemLoaded} itemCount={itemCount} - loadMoreItems={ - loadMoreItems ?? - (() => { - // do nothing - }) - } + loadMoreItems={loadMoreItems ?? (() => Promise.resolve())} > {({ onItemsRendered, ref }) => ( = ({ visibleStopIndex: visibleRowStopIndex, }); }} - ref={mergeRefs(gridRef, ref)} + ref={mergeRefs(gridRef, ref) as MutableRefObject | null>} columnCount={columns.length} columnWidth={(index) => getColumnWidth(width ?? 0, index)} height={(height ?? 0) - 50} @@ -159,6 +178,7 @@ const Desktop: FC = ({ )}
+ {noDataComponent}
); }; diff --git a/packages/ui/src/components/transactions_list/components/desktop/styles.ts b/packages/ui/src/components/transactions_list/components/desktop/styles.ts index 6076b5e990..85c742b615 100644 --- a/packages/ui/src/components/transactions_list/components/desktop/styles.ts +++ b/packages/ui/src/components/transactions_list/components/desktop/styles.ts @@ -11,6 +11,9 @@ const useStyles = makeStyles()((theme) => ({ body: { color: theme.palette.custom.fonts.fontTwo, }, + noData: { + marginTop: '120px', + }, })); export default useStyles; diff --git a/packages/ui/src/components/transactions_list/index.tsx b/packages/ui/src/components/transactions_list/index.tsx index e0c8caf9ed..100343c484 100644 --- a/packages/ui/src/components/transactions_list/index.tsx +++ b/packages/ui/src/components/transactions_list/index.tsx @@ -1,6 +1,5 @@ import { FC } from 'react'; import Loading from '@/components/loading'; -import NoData from '@/components/no_data'; import Desktop from '@/components/transactions_list/components/desktop'; import Mobile from '@/components/transactions_list/components/mobile'; import type { TransactionsListState } from '@/components/transactions_list/types'; @@ -30,7 +29,7 @@ const TransactionsList: FC = (props) => { }; if (!itemCount) { - return isNextPageLoading ? : ; + if (isNextPageLoading) return ; } return ( diff --git a/packages/ui/src/graphql/general/message_types.graphql b/packages/ui/src/graphql/general/message_types.graphql new file mode 100644 index 0000000000..3c77d65242 --- /dev/null +++ b/packages/ui/src/graphql/general/message_types.graphql @@ -0,0 +1,49 @@ +query MessageTypes{ + msgTypes: message_type{ + type + module + label + } +} + +query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type{ + label + module + type + } + } +} + +subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + +query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type(args: {types: $types, limit: $limit, offset: $offset}) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} \ No newline at end of file diff --git a/packages/ui/src/graphql/types/general_types.ts b/packages/ui/src/graphql/types/general_types.ts index 401d702310..397c9e3796 100644 --- a/packages/ui/src/graphql/types/general_types.ts +++ b/packages/ui/src/graphql/types/general_types.ts @@ -2870,6 +2870,8 @@ export type Message = { height: Scalars['bigint']; index: Scalars['bigint']; involved_accounts_addresses: Scalars['_text']; + /** An object relationship */ + message_type?: Maybe; partition_id: Scalars['bigint']; /** An object relationship */ transaction?: Maybe; @@ -2954,6 +2956,7 @@ export type Message_Bool_Exp = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe<_Text_Comparison_Exp>; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3005,6 +3008,7 @@ export type Message_Order_By = { height?: InputMaybe; index?: InputMaybe; involved_accounts_addresses?: InputMaybe; + message_type?: InputMaybe; partition_id?: InputMaybe; transaction?: InputMaybe; transactionByPartitionIdTransactionHash?: InputMaybe; @@ -3091,6 +3095,142 @@ export type Message_Sum_Order_By = { partition_id?: InputMaybe; }; +/** columns and relationships of "message_type" */ +export type Message_Type = { + __typename?: 'message_type'; + height: Scalars['bigint']; + label: Scalars['String']; + module: Scalars['String']; + type: Scalars['String']; +}; + +/** aggregated selection of "message_type" */ +export type Message_Type_Aggregate = { + __typename?: 'message_type_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_Fields = { + __typename?: 'message_type_aggregate_fields'; + avg?: Maybe; + count: Scalars['Int']; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "message_type" */ +export type Message_Type_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Message_Type_Avg_Fields = { + __typename?: 'message_type_avg_fields'; + height?: Maybe; +}; + +/** Boolean expression to filter rows from the table "message_type". All fields are combined with a logical 'AND'. */ +export type Message_Type_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Message_Type_Max_Fields = { + __typename?: 'message_type_max_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** aggregate min on columns */ +export type Message_Type_Min_Fields = { + __typename?: 'message_type_min_fields'; + height?: Maybe; + label?: Maybe; + module?: Maybe; + type?: Maybe; +}; + +/** Ordering options when selecting data from "message_type". */ +export type Message_Type_Order_By = { + height?: InputMaybe; + label?: InputMaybe; + module?: InputMaybe; + type?: InputMaybe; +}; + +/** select columns of table "message_type" */ +export enum Message_Type_Select_Column { + /** column name */ + Height = 'height', + /** column name */ + Label = 'label', + /** column name */ + Module = 'module', + /** column name */ + Type = 'type' +} + +/** aggregate stddev on columns */ +export type Message_Type_Stddev_Fields = { + __typename?: 'message_type_stddev_fields'; + height?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Message_Type_Stddev_Pop_Fields = { + __typename?: 'message_type_stddev_pop_fields'; + height?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Message_Type_Stddev_Samp_Fields = { + __typename?: 'message_type_stddev_samp_fields'; + height?: Maybe; +}; + +/** aggregate sum on columns */ +export type Message_Type_Sum_Fields = { + __typename?: 'message_type_sum_fields'; + height?: Maybe; +}; + +/** aggregate var_pop on columns */ +export type Message_Type_Var_Pop_Fields = { + __typename?: 'message_type_var_pop_fields'; + height?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Message_Type_Var_Samp_Fields = { + __typename?: 'message_type_var_samp_fields'; + height?: Maybe; +}; + +/** aggregate variance on columns */ +export type Message_Type_Variance_Fields = { + __typename?: 'message_type_variance_fields'; + height?: Maybe; +}; + /** aggregate var_pop on columns */ export type Message_Var_Pop_Fields = { __typename?: 'message_var_pop_fields'; @@ -3151,11 +3291,23 @@ export type Messages_By_Single_Address_Args = { types?: InputMaybe; }; +export type Messages_By_Type_Args = { + limit?: InputMaybe; + offset?: InputMaybe; + types?: InputMaybe; +}; + export type Messages_Get_Types_Args = { limit?: InputMaybe; offset?: InputMaybe; }; +export type Messages_Types_By_Address_Args = { + addresses?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}; + /** columns and relationships of "mint_params" */ export type Mint_Params = { __typename?: 'mint_params'; @@ -5289,6 +5441,10 @@ export type Query_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -5297,10 +5453,18 @@ export type Query_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_get_types" which returns "message" */ messages_get_types: Array; /** execute function "messages_get_types" and query aggregates on result of table type "message" */ messages_get_types_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -5843,6 +6007,24 @@ export type Query_RootMessage_AggregateArgs = { }; +export type Query_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -5883,6 +6065,26 @@ export type Query_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Query_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMessages_Get_TypesArgs = { args: Messages_Get_Types_Args; distinct_on?: InputMaybe>; @@ -5903,6 +6105,26 @@ export type Query_RootMessages_Get_Types_AggregateArgs = { }; +export type Query_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -7146,6 +7368,10 @@ export type Subscription_Root = { message: Array; /** fetch aggregated fields from the table: "message" */ message_aggregate: Message_Aggregate; + /** fetch data from the table: "message_type" */ + message_type: Array; + /** fetch aggregated fields from the table: "message_type" */ + message_type_aggregate: Message_Type_Aggregate; /** execute function "messages_by_address" which returns "message" */ messages_by_address: Array; /** execute function "messages_by_address" and query aggregates on result of table type "message" */ @@ -7154,10 +7380,18 @@ export type Subscription_Root = { messages_by_single_address: Array; /** execute function "messages_by_single_address" and query aggregates on result of table type "message" */ messages_by_single_address_aggregate: Message_Aggregate; + /** execute function "messages_by_type" which returns "message" */ + messages_by_type: Array; + /** execute function "messages_by_type" and query aggregates on result of table type "message" */ + messages_by_type_aggregate: Message_Aggregate; /** execute function "messages_get_types" which returns "message" */ messages_get_types: Array; /** execute function "messages_get_types" and query aggregates on result of table type "message" */ messages_get_types_aggregate: Message_Aggregate; + /** execute function "messages_types_by_address" which returns "message" */ + messages_types_by_address: Array; + /** execute function "messages_types_by_address" and query aggregates on result of table type "message" */ + messages_types_by_address_aggregate: Message_Aggregate; /** fetch data from the table: "mint_params" */ mint_params: Array; /** fetch aggregated fields from the table: "mint_params" */ @@ -7607,6 +7841,24 @@ export type Subscription_RootMessage_AggregateArgs = { }; +export type Subscription_RootMessage_TypeArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessage_Type_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_By_AddressArgs = { args: Messages_By_Address_Args; distinct_on?: InputMaybe>; @@ -7647,6 +7899,26 @@ export type Subscription_RootMessages_By_Single_Address_AggregateArgs = { }; +export type Subscription_RootMessages_By_TypeArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_By_Type_AggregateArgs = { + args: Messages_By_Type_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMessages_Get_TypesArgs = { args: Messages_Get_Types_Args; distinct_on?: InputMaybe>; @@ -7667,6 +7939,26 @@ export type Subscription_RootMessages_Get_Types_AggregateArgs = { }; +export type Subscription_RootMessages_Types_By_AddressArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMessages_Types_By_Address_AggregateArgs = { + args: Messages_Types_By_Address_Args; + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootMint_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -11897,6 +12189,36 @@ export type MarketDataQueryVariables = Exact<{ export type MarketDataQuery = { communityPool: Array<{ __typename?: 'community_pool', coins: any }>, inflation: Array<{ __typename?: 'inflation', value: any }>, tokenPrice: Array<{ __typename?: 'token_price', price: any, marketCap: any }>, supply: Array<{ __typename?: 'supply', coins: any }>, bondedTokens: Array<{ __typename?: 'staking_pool', bonded_tokens: string }>, distributionParams: Array<{ __typename?: 'distribution_params', params: any }> }; +export type MessageTypesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type MessageTypesQuery = { msgTypes: Array<{ __typename?: 'message_type', type: string, module: string, label: string }> }; + +export type MsgTypesByAddressQueryVariables = Exact<{ + addresses?: InputMaybe; +}>; + + +export type MsgTypesByAddressQuery = { msgTypes: Array<{ __typename?: 'message', message_type?: { __typename?: 'message_type', label: string, module: string, type: string } | null }> }; + +export type MessagesByTypesListenerSubscriptionVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesListenerSubscription = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + +export type MessagesByTypesQueryVariables = Exact<{ + types?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; +}>; + + +export type MessagesByTypesQuery = { messagesByTypes: Array<{ __typename?: 'message', transaction?: { __typename?: 'transaction', height: any, hash: string, success: boolean, messages: any, logs?: any | null, block: { __typename?: 'block', height: any, timestamp: any } } | null }> }; + export type GetMessagesByAddressQueryVariables = Exact<{ address?: InputMaybe; limit?: InputMaybe; @@ -12835,6 +13157,174 @@ export function useMarketDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions export type MarketDataQueryHookResult = ReturnType; export type MarketDataLazyQueryHookResult = ReturnType; export type MarketDataQueryResult = Apollo.QueryResult; +export const MessageTypesDocument = gql` + query MessageTypes { + msgTypes: message_type { + type + module + label + } +} + `; + +/** + * __useMessageTypesQuery__ + * + * To run a query within a React component, call `useMessageTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessageTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessageTypesQuery({ + * variables: { + * }, + * }); + */ +export function useMessageTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessageTypesDocument, options); + } +export function useMessageTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessageTypesDocument, options); + } +export type MessageTypesQueryHookResult = ReturnType; +export type MessageTypesLazyQueryHookResult = ReturnType; +export type MessageTypesQueryResult = Apollo.QueryResult; +export const MsgTypesByAddressDocument = gql` + query MsgTypesByAddress($addresses: _text = "{}") { + msgTypes: messages_types_by_address(args: {addresses: $addresses}) { + message_type { + label + module + type + } + } +} + `; + +/** + * __useMsgTypesByAddressQuery__ + * + * To run a query within a React component, call `useMsgTypesByAddressQuery` and pass it any options that fit your needs. + * When your component renders, `useMsgTypesByAddressQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMsgTypesByAddressQuery({ + * variables: { + * addresses: // value for 'addresses' + * }, + * }); + */ +export function useMsgTypesByAddressQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MsgTypesByAddressDocument, options); + } +export function useMsgTypesByAddressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MsgTypesByAddressDocument, options); + } +export type MsgTypesByAddressQueryHookResult = ReturnType; +export type MsgTypesByAddressLazyQueryHookResult = ReturnType; +export type MsgTypesByAddressQueryResult = Apollo.QueryResult; +export const MessagesByTypesListenerDocument = gql` + subscription MessagesByTypesListener($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesListenerSubscription__ + * + * To run a query within a React component, call `useMessagesByTypesListenerSubscription` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesListenerSubscription` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesListenerSubscription({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesListenerSubscription(baseOptions?: Apollo.SubscriptionHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useSubscription(MessagesByTypesListenerDocument, options); + } +export type MessagesByTypesListenerSubscriptionHookResult = ReturnType; +export type MessagesByTypesListenerSubscriptionResult = Apollo.SubscriptionResult; +export const MessagesByTypesDocument = gql` + query MessagesByTypes($types: _text = "{}", $limit: bigint = 7, $offset: bigint = 0) { + messagesByTypes: messages_by_type( + args: {types: $types, limit: $limit, offset: $offset} + ) { + transaction { + height + hash + success + messages + logs + block { + height + timestamp + } + } + } +} + `; + +/** + * __useMessagesByTypesQuery__ + * + * To run a query within a React component, call `useMessagesByTypesQuery` and pass it any options that fit your needs. + * When your component renders, `useMessagesByTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useMessagesByTypesQuery({ + * variables: { + * types: // value for 'types' + * limit: // value for 'limit' + * offset: // value for 'offset' + * }, + * }); + */ +export function useMessagesByTypesQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(MessagesByTypesDocument, options); + } +export function useMessagesByTypesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(MessagesByTypesDocument, options); + } +export type MessagesByTypesQueryHookResult = ReturnType; +export type MessagesByTypesLazyQueryHookResult = ReturnType; +export type MessagesByTypesQueryResult = Apollo.QueryResult; export const GetMessagesByAddressDocument = gql` query GetMessagesByAddress($address: _text, $limit: bigint = 50, $offset: bigint = 0, $types: _text = "{}") { messagesByAddress: messages_by_address( diff --git a/packages/ui/src/graphql/types/profile_types.ts b/packages/ui/src/graphql/types/profile_types.ts index a9b6ca4d07..74bd78a56a 100644 --- a/packages/ui/src/graphql/types/profile_types.ts +++ b/packages/ui/src/graphql/types/profile_types.ts @@ -18,6 +18,19 @@ export type Scalars = { timestamp: any; }; +/** Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. */ +export type Boolean_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 "Int". All fields are combined with logical 'AND'. */ export type Int_Comparison_Exp = { _eq?: InputMaybe; @@ -605,11 +618,21 @@ export type Profile = { bio: Scalars['String']; /** An array relationship */ chain_links: Array; + /** An object relationship */ + counters?: Maybe; cover_pic: Scalars['String']; creation_time: Scalars['timestamp']; dtag: Scalars['String']; + /** Computed field that tells whether the current Hasura user has blocked this profile */ + has_user_blocked?: Maybe; /** An array relationship */ incoming_dtag_transfer_requests: Array; + /** Computed field that tells whether the given profile has blocked the current Hasura user */ + is_user_blocked_by?: Maybe; + /** A computed field that tells whether the given Hasura user is followed by this profile */ + is_user_followed_by?: Maybe; + /** A computed field that tells whether the current Hasura user is following this profile */ + is_user_following?: Maybe; nickname: Scalars['String']; /** An array relationship */ outgoing_dtag_transfer_requests: Array; @@ -687,15 +710,65 @@ export type Profile_Bool_Exp = { applications_links?: InputMaybe; bio?: InputMaybe; chain_links?: InputMaybe; + counters?: InputMaybe; cover_pic?: InputMaybe; creation_time?: InputMaybe; dtag?: InputMaybe; + has_user_blocked?: InputMaybe; incoming_dtag_transfer_requests?: InputMaybe; + is_user_blocked_by?: InputMaybe; + is_user_followed_by?: InputMaybe; + is_user_following?: InputMaybe; nickname?: InputMaybe; outgoing_dtag_transfer_requests?: InputMaybe; profile_pic?: InputMaybe; }; +/** columns and relationships of "profile_counters" */ +export type Profile_Counters = { + __typename?: 'profile_counters'; + application_links_count: Scalars['bigint']; + blocks_count: Scalars['bigint']; + chain_links_count: Scalars['bigint']; + profile_address: Scalars['String']; + relationships_count: Scalars['bigint']; +}; + +/** Boolean expression to filter rows from the table "profile_counters". All fields are combined with a logical 'AND'. */ +export type Profile_Counters_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + application_links_count?: InputMaybe; + blocks_count?: InputMaybe; + chain_links_count?: InputMaybe; + profile_address?: InputMaybe; + relationships_count?: InputMaybe; +}; + +/** Ordering options when selecting data from "profile_counters". */ +export type Profile_Counters_Order_By = { + application_links_count?: InputMaybe; + blocks_count?: InputMaybe; + chain_links_count?: InputMaybe; + profile_address?: InputMaybe; + relationships_count?: InputMaybe; +}; + +/** select columns of table "profile_counters" */ +export enum Profile_Counters_Select_Column { + /** column name */ + ApplicationLinksCount = 'application_links_count', + /** column name */ + BlocksCount = 'blocks_count', + /** column name */ + ChainLinksCount = 'chain_links_count', + /** column name */ + ProfileAddress = 'profile_address', + /** column name */ + RelationshipsCount = 'relationships_count' +} + /** aggregate max on columns */ export type Profile_Max_Fields = { __typename?: 'profile_max_fields'; @@ -726,10 +799,15 @@ export type Profile_Order_By = { applications_links_aggregate?: InputMaybe; bio?: InputMaybe; chain_links_aggregate?: InputMaybe; + counters?: InputMaybe; cover_pic?: InputMaybe; creation_time?: InputMaybe; dtag?: InputMaybe; + has_user_blocked?: InputMaybe; incoming_dtag_transfer_requests_aggregate?: InputMaybe; + is_user_blocked_by?: InputMaybe; + is_user_followed_by?: InputMaybe; + is_user_following?: InputMaybe; nickname?: InputMaybe; outgoing_dtag_transfer_requests_aggregate?: InputMaybe; profile_pic?: InputMaybe; @@ -806,6 +884,8 @@ export type Query_Root = { profile_aggregate: Profile_Aggregate; /** fetch data from the table: "profile" using primary key columns */ profile_by_pk?: Maybe; + /** fetch data from the table: "profile_counters" */ + profile_counters: Array; /** fetch data from the table: "profiles_params" */ profiles_params: Array; /** fetch data from the table: "user_block" */ @@ -903,6 +983,15 @@ export type Query_RootProfile_By_PkArgs = { }; +export type Query_RootProfile_CountersArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Query_RootProfiles_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; @@ -960,6 +1049,8 @@ export type Subscription_Root = { profile_aggregate: Profile_Aggregate; /** fetch data from the table: "profile" using primary key columns */ profile_by_pk?: Maybe; + /** fetch data from the table: "profile_counters" */ + profile_counters: Array; /** fetch data from the table: "profiles_params" */ profiles_params: Array; /** fetch data from the table: "user_block" */ @@ -1057,6 +1148,15 @@ export type Subscription_RootProfile_By_PkArgs = { }; +export type Subscription_RootProfile_CountersArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + export type Subscription_RootProfiles_ParamsArgs = { distinct_on?: InputMaybe>; limit?: InputMaybe; diff --git a/packages/ui/src/recoil/settings/selectors.ts b/packages/ui/src/recoil/settings/selectors.ts index 3b9d32e693..6ed66559c5 100644 --- a/packages/ui/src/recoil/settings/selectors.ts +++ b/packages/ui/src/recoil/settings/selectors.ts @@ -1,7 +1,13 @@ import { DefaultValue, ReadOnlySelectorOptions, selector } from 'recoil'; import { atomState } from '@/recoil/settings/atom'; import type { Date, TimeFormat, Theme, Tx } from '@/recoil/settings/types'; -import { DATE_KEY, setItem, THEME_KEY, TX_KEY, TIME_FORMAT_KEY } from '@/utils/localstorage'; +import { + DATE_KEY, + setItem, + THEME_KEY, + TX_KEY, + TIME_FORMAT_KEY, +} from '@/utils/localstorage'; import { mergeStateChange } from '@/utils/merge_state_change'; const getTheme: ReadOnlySelectorOptions['get'] = ({ get }): Theme => { diff --git a/packages/ui/src/recoil/transactions_filter/atom.ts b/packages/ui/src/recoil/transactions_filter/atom.ts new file mode 100644 index 0000000000..ddd8bf65ad --- /dev/null +++ b/packages/ui/src/recoil/transactions_filter/atom.ts @@ -0,0 +1,13 @@ +import { atom } from 'recoil'; +import type { AtomState } from '@/recoil/transactions_filter/types'; + +const initialState: AtomState = { + filter: '{}', + openDialog: false, + selectedMsgTypes: [], +}; + +export const atomState = atom({ + key: 'txsFilter', + default: initialState, +}); diff --git a/packages/ui/src/recoil/transactions_filter/hooks.ts b/packages/ui/src/recoil/transactions_filter/hooks.ts new file mode 100644 index 0000000000..686f211d0b --- /dev/null +++ b/packages/ui/src/recoil/transactions_filter/hooks.ts @@ -0,0 +1,21 @@ +import { useEffect } from 'react'; +import { useRecoilState } from 'recoil'; +import { atomState } from '@/recoil/transactions_filter/atom'; +import type { AtomState } from '@/recoil/transactions_filter/types'; + +const isClient = typeof window === 'object'; + +export const useTxsFilterRecoil = () => { + const [txsFilter, setTxsFilter] = useRecoilState(atomState); + + useEffect(() => { + if (isClient) { + const initTxsFilter: AtomState = { + filter: '{}', + openDialog: false, + selectedMsgTypes: [], + }; + setTxsFilter(initTxsFilter); + } + }, [setTxsFilter, txsFilter.filter, txsFilter.openDialog, txsFilter.selectedMsgTypes]); +}; diff --git a/packages/ui/src/recoil/transactions_filter/index.ts b/packages/ui/src/recoil/transactions_filter/index.ts new file mode 100644 index 0000000000..ac848aad92 --- /dev/null +++ b/packages/ui/src/recoil/transactions_filter/index.ts @@ -0,0 +1,11 @@ +export { atomState } from '@/recoil/transactions_filter/atom'; +export { useTxsFilterRecoil } from '@/recoil/transactions_filter/hooks'; +export { + readFilter, + writeFilter, + writeOpenDialog, + readOpenDialog, + readSelectedMsgTypes, + writeSelectedMsgTypes, +} from '@/recoil/transactions_filter/selectors'; +export type { AtomState } from '@/recoil/transactions_filter/types'; diff --git a/packages/ui/src/recoil/transactions_filter/selectors.ts b/packages/ui/src/recoil/transactions_filter/selectors.ts new file mode 100644 index 0000000000..cd2be28ea6 --- /dev/null +++ b/packages/ui/src/recoil/transactions_filter/selectors.ts @@ -0,0 +1,72 @@ +import { DefaultValue, ReadOnlySelectorOptions, selector } from 'recoil'; +import { atomState } from '@/recoil/transactions_filter/atom'; +import { mergeStateChange } from '@/utils/merge_state_change'; + +const getFilter: ReadOnlySelectorOptions['get'] = ({ get }) => { + const state = get(atomState); + return state.filter; +}; + +export const writeFilter = selector({ + key: 'txsFilter.write.filter', + get: getFilter, + set: ({ get, set }, newFilter) => { + if (newFilter instanceof DefaultValue) return; + const prevState = get(atomState); + const newState = mergeStateChange(prevState, { + filter: newFilter, + }); + set(atomState, newState); + }, +}); + +export const readFilter = selector({ + key: 'txsFilter.read.filter', + get: getFilter, +}); + +const getOpenDialog: ReadOnlySelectorOptions['get'] = ({ get }) => { + const state = get(atomState); + return state.openDialog; +}; + +export const writeOpenDialog = selector({ + key: 'txsFilter.write.openDialog', + get: getOpenDialog, + set: ({ get, set }, newOpenDialogValue) => { + if (newOpenDialogValue instanceof DefaultValue) return; + const prevState = get(atomState); + const newState = mergeStateChange(prevState, { + openDialog: newOpenDialogValue, + }); + set(atomState, newState); + }, +}); + +export const readOpenDialog = selector({ + key: 'txsFilter.read.openDialog', + get: getOpenDialog, +}); + +const getSelectedMsgTypes: ReadOnlySelectorOptions['get'] = ({ get }) => { + const state = get(atomState); + return state.selectedMsgTypes; +}; + +export const writeSelectedMsgTypes = selector({ + key: 'txsFilter.write.selectedMsgTypes', + get: getSelectedMsgTypes, + set: ({ get, set }, newSelectedMsgTypes) => { + if (newSelectedMsgTypes instanceof DefaultValue) return; + const prevState = get(atomState); + const newState = mergeStateChange(prevState, { + selectedMsgTypes: newSelectedMsgTypes, + }); + set(atomState, newState); + }, +}); + +export const readSelectedMsgTypes = selector({ + key: 'txsFilter.read.selectedMsgTypes', + get: getSelectedMsgTypes, +}); diff --git a/packages/ui/src/recoil/transactions_filter/types.ts b/packages/ui/src/recoil/transactions_filter/types.ts new file mode 100644 index 0000000000..887da1d943 --- /dev/null +++ b/packages/ui/src/recoil/transactions_filter/types.ts @@ -0,0 +1,5 @@ +export interface AtomState { + filter: string; + openDialog: boolean; + selectedMsgTypes: string[]; +} diff --git a/packages/ui/src/screens/account_details/components/other_tokens/components/desktop/index.tsx b/packages/ui/src/screens/account_details/components/other_tokens/components/desktop/index.tsx index 7bee641658..73107d69d5 100644 --- a/packages/ui/src/screens/account_details/components/other_tokens/components/desktop/index.tsx +++ b/packages/ui/src/screens/account_details/components/other_tokens/components/desktop/index.tsx @@ -20,7 +20,7 @@ const Desktop: FC = ({ className, items }) => { const formattedItems = items?.map((x, i) => ({ key: i, token: x.denom.toUpperCase(), - commission: formatNumber(x.commission.value, x.commission.exponent), + commission: x.commission ? formatNumber(x.commission.value, x.commission.exponent) : '', available: formatNumber(x.available.value, x.available.exponent), reward: x.reward ? formatNumber(x.reward.value, x.reward.exponent) : '', })); diff --git a/packages/ui/src/screens/account_details/components/other_tokens/components/mobile/index.tsx b/packages/ui/src/screens/account_details/components/other_tokens/components/mobile/index.tsx index a77d21331d..6aa3676d58 100644 --- a/packages/ui/src/screens/account_details/components/other_tokens/components/mobile/index.tsx +++ b/packages/ui/src/screens/account_details/components/other_tokens/components/mobile/index.tsx @@ -19,7 +19,9 @@ const Mobile: FC = ({ className, items }) => { {items?.map((x, i) => { const available = formatNumber(x.available.value, x.available.exponent); const reward = x.reward ? formatNumber(x.reward.value, x.reward.exponent) : ''; - const commission = formatNumber(x.commission.value, x.commission.exponent); + const commission = x.commission + ? formatNumber(x.commission.value, x.commission.exponent) + : ''; const isLast = !items || i === items.length - 1; return ( // eslint-disable-next-line react/no-array-index-key diff --git a/packages/ui/src/screens/account_details/components/transactions/hooks.ts b/packages/ui/src/screens/account_details/components/transactions/hooks.ts index 7a529a89e0..83e7fe7bc0 100644 --- a/packages/ui/src/screens/account_details/components/transactions/hooks.ts +++ b/packages/ui/src/screens/account_details/components/transactions/hooks.ts @@ -8,6 +8,8 @@ import { } from '@/graphql/types/general_types'; import type { TransactionState } from '@/screens/account_details/components/transactions/types'; import { convertMsgType } from '@/utils/convert_msg_type'; +import { useRecoilValue } from 'recoil'; +import { readFilter } from '@/recoil/transactions_filter'; const LIMIT = 50; @@ -50,6 +52,7 @@ export function useTransactions() { isNextPageLoading: true, offsetCount: 0, }); + const msgTypes = useRecoilValue(readFilter); const isFirst = useRef(true); // reset state when address changes @@ -65,7 +68,7 @@ export function useTransactions() { offsetCount: 0, })); } - }, [router?.query?.address]); + }, [router?.query?.address, msgTypes]); const handleSetState = (stateChange: (prevState: TransactionState) => TransactionState) => { setState((prevState) => { @@ -79,6 +82,7 @@ export function useTransactions() { limit: LIMIT + 1, // to check if more exist offset: 0, address: `{${router?.query?.address ?? ''}}`, + types: msgTypes, }, onCompleted: (data) => { const itemsLength = data.messagesByAddress.length; diff --git a/packages/ui/src/screens/account_details/components/transactions/index.tsx b/packages/ui/src/screens/account_details/components/transactions/index.tsx index 4779314a14..d5fd7c8d87 100644 --- a/packages/ui/src/screens/account_details/components/transactions/index.tsx +++ b/packages/ui/src/screens/account_details/components/transactions/index.tsx @@ -1,11 +1,12 @@ import Typography from '@mui/material/Typography'; import useAppTranslation from '@/hooks/useAppTranslation'; -import { FC } from 'react'; -import { useRecoilValue } from 'recoil'; +import { FC, useEffect } from 'react'; +import { useRecoilValue, SetterOrUpdater, useRecoilState } from 'recoil'; import Box from '@/components/box'; import TransactionsList from '@/components/transactions_list'; import TransactionsListDetails from '@/components/transactions_list_details'; import { readTx } from '@/recoil/settings'; +import { writeFilter, writeSelectedMsgTypes } from '@/recoil/transactions_filter'; import { useTransactions } from '@/screens/account_details/components/transactions/hooks'; import useStyles from '@/screens/account_details/components/transactions/styles'; @@ -19,6 +20,16 @@ const Transactions: FC = (props) => { const loadMoreItems = state.isNextPageLoading ? () => null : loadNextPage; const isItemLoaded = (index: number) => !state.hasNextPage || index < state.data.length; const itemCount = state.hasNextPage ? state.data.length + 1 : state.data.length; + const [, setMsgTypes] = useRecoilState(writeFilter) as [string, SetterOrUpdater]; + const [, setSelectedMsgs] = useRecoilState(writeSelectedMsgTypes) as [ + string[], + SetterOrUpdater + ]; + useEffect(() => { + setMsgTypes('{}'); + setSelectedMsgs([]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); return ( diff --git a/packages/ui/src/screens/proposal_details/components/overview/index.tsx b/packages/ui/src/screens/proposal_details/components/overview/index.tsx index 2a7606c073..1cb0ca4d2b 100644 --- a/packages/ui/src/screens/proposal_details/components/overview/index.tsx +++ b/packages/ui/src/screens/proposal_details/components/overview/index.tsx @@ -1,10 +1,9 @@ +import { FC, useCallback } from 'react'; +import { useRecoilValue } from 'recoil'; import Divider from '@mui/material/Divider'; import Typography from '@mui/material/Typography'; -import useAppTranslation from '@/hooks/useAppTranslation'; import numeral from 'numeral'; import * as R from 'ramda'; -import { FC, useCallback } from 'react'; -import { useRecoilValue } from 'recoil'; import Box from '@/components/box'; import Markdown from '@/components/markdown'; import Name from '@/components/name'; @@ -19,15 +18,20 @@ import type { OverviewType } from '@/screens/proposal_details/types'; import { getProposalType } from '@/screens/proposal_details/utils'; import dayjs, { formatDayJs } from '@/utils/dayjs'; import { formatNumber, formatToken } from '@/utils/format_token'; +import useAppTranslation from '@/hooks/useAppTranslation'; + +type OverviewProps = { + className?: string; + overview: OverviewType; +}; -const Overview: FC<{ className?: string; overview: OverviewType }> = ({ className, overview }) => { +const Overview: FC = ({ className, overview }) => { const dateFormat = useRecoilValue(readDate); const timeFormat = useRecoilValue(readTimeFormat); const { classes, cx } = useStyles(); const { t } = useAppTranslation('proposals'); const type = getProposalType(R.pathOr('', ['@type'], overview.content)); - const { address: proposerAddress, name: proposerName } = useProfileRecoil(overview.proposer); const { name: recipientName } = useProfileRecoil(overview?.content?.recipient); const proposerMoniker = proposerName || overview.proposer; diff --git a/packages/ui/src/screens/proposals/hooks.ts b/packages/ui/src/screens/proposals/hooks.ts index 918cdd5d99..588bf2e7e5 100644 --- a/packages/ui/src/screens/proposals/hooks.ts +++ b/packages/ui/src/screens/proposals/hooks.ts @@ -4,16 +4,16 @@ import * as R from 'ramda'; import { useCallback, useState } from 'react'; import xss from 'xss'; -const formatProposals = (data: ProposalsQuery) => - data?.proposals.map((x): ProposalType => { - const description = xss(x?.description.replace(/\\n\s?/g, '
')); - return { - description, - id: x.proposalId, - title: x.title, - status: x.status ?? '', - }; - }); +const formatProposals = (data?: ProposalsQuery): ProposalType[] => { + if (!data?.proposals) return []; + + return data.proposals.map((x) => ({ + description: xss(x?.description?.replace(/\\n\s?/g, '
')) ?? '', + id: x.proposalId, + title: x.title ?? '', + status: x.status ?? '', + })); +}; export const useProposals = () => { const [state, setState] = useState({ diff --git a/packages/ui/src/screens/transactions/__snapshots__/index.test.tsx.snap b/packages/ui/src/screens/transactions/__snapshots__/index.test.tsx.snap index e4b8128bc7..91cf5385db 100644 --- a/packages/ui/src/screens/transactions/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/screens/transactions/__snapshots__/index.test.tsx.snap @@ -46,64 +46,10 @@ exports[`screen: Transactions matches snapshot 1`] = ` id="TransactionsList" isItemLoaded={[Function]} isNextPageLoading={false} - itemCount={1} + itemCount={0} loadMoreItems={[Function]} loadNextPage={[Function]} - transactions={ - [ - { - "hash": "D223E2E4E4FD29868D1034EFE5FB162EAB78B4CCE1D53EFD4F34A40608FB6C4B", - "height": 432022, - "messages": { - "count": 2, - "items": [ - { - "amounts": [ - { - "baseDenom": "udsm", - "displayDenom": "udsm", - "exponent": 0, - "value": "0", - }, - ], - "category": "distribution", - "delegatorAddress": "desmos18kvwy5hzcu3ss08lcfcnx0eajuecg69ujmkwjr", - "json": { - "@type": "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - "delegator_address": "desmos18kvwy5hzcu3ss08lcfcnx0eajuecg69ujmkwjr", - "validator_address": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - "type": "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", - "validatorAddress": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - { - "amounts": [ - { - "baseDenom": "udsm", - "displayDenom": "udsm", - "exponent": 0, - "value": "0", - }, - ], - "category": "distribution", - "json": { - "@type": "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", - "validator_address": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - "type": "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", - "validatorAddress": "desmosvaloper18kvwy5hzcu3ss08lcfcnx0eajuecg69uvk76c3", - }, - ], - }, - "success": true, - "timestamp": "2021-05-28T00:08:33.700487", - "type": [ - "Withdraw Delegator Reward", - "Withdraw Validator Commission", - ], - }, - ] - } + transactions={[]} /> diff --git a/packages/ui/src/screens/transactions/hooks.ts b/packages/ui/src/screens/transactions/hooks.ts index 72c3fe7565..3244415090 100644 --- a/packages/ui/src/screens/transactions/hooks.ts +++ b/packages/ui/src/screens/transactions/hooks.ts @@ -1,13 +1,15 @@ import * as R from 'ramda'; -import { useState } from 'react'; +import { useState, useEffect, useCallback } from 'react'; import { convertMsgsToModels } from '@/components/msg/utils'; import { - TransactionsListenerSubscription, - useTransactionsListenerSubscription, - useTransactionsQuery, + useMessagesByTypesListenerSubscription, + MessagesByTypesListenerSubscription, + useMessagesByTypesQuery, } from '@/graphql/types/general_types'; import type { TransactionsState } from '@/screens/transactions/types'; import { convertMsgType } from '@/utils/convert_msg_type'; +import { useRecoilValue } from 'recoil'; +import { readFilter } from '@/recoil/transactions_filter'; // This is a bandaid as it can get extremely // expensive if there is too much data @@ -20,30 +22,34 @@ const uniqueAndSort = R.pipe( R.sort(R.descend((r) => r?.height)) ); -const formatTransactions = (data: TransactionsListenerSubscription): TransactionsState['items'] => { - let formattedData = data.transactions; - if (data.transactions.length === 51) { - formattedData = data.transactions.slice(0, 51); +const formatTransactions = ( + data: MessagesByTypesListenerSubscription +): TransactionsState['items'] => { + if (!data?.messagesByTypes) return []; + + let formattedData = data.messagesByTypes; + if (data.messagesByTypes.length === 51) { + formattedData = data.messagesByTypes.slice(0, 51); } return formattedData.map((x) => { - const messages = convertMsgsToModels(x); + const messages = convertMsgsToModels(x.transaction); const msgType = - x.messages?.map((eachMsg: unknown) => { + x.transaction?.messages?.map((eachMsg: any) => { const eachMsgType = R.pathOr('none type', ['@type'], eachMsg); return eachMsgType ?? ''; }) ?? []; const convertedMsgType = convertMsgType(msgType); return { - height: x.height, - hash: x.hash, + height: x.transaction?.height ?? 0, + hash: x.transaction?.hash ?? '', type: convertedMsgType, messages: { - count: x.messages.length, + count: x.transaction?.messages?.length ?? 0, items: messages, }, - success: x.success, - timestamp: x.block.timestamp, + success: x.transaction?.success ?? false, + timestamp: x.transaction?.block?.timestamp ?? '', }; }); }; @@ -56,25 +62,37 @@ export const useTransactions = () => { isNextPageLoading: true, items: [], }); + const msgTypes = useRecoilValue(readFilter); - const handleSetState = (stateChange: (prevState: TransactionsState) => TransactionsState) => { - setState((prevState) => { - const newState = stateChange(prevState); - return R.equals(prevState, newState) ? prevState : newState; - }); - }; + const handleSetState = useCallback( + (stateChange: (prevState: TransactionsState) => TransactionsState) => { + setState((prevState) => { + const newState = stateChange(prevState); + return R.equals(prevState, newState) ? prevState : newState; + }); + }, + [] + ); + useEffect(() => { + handleSetState((prevState) => ({ + ...prevState, + loading: true, + items: [], + hasNextPage: false, + isNextPageLoading: false, + })); + }, [handleSetState, msgTypes]); // ================================ // tx subscription // ================================ - useTransactionsListenerSubscription({ + useMessagesByTypesListenerSubscription({ variables: { - limit: 1, - offset: 0, + types: msgTypes ?? '{}', }, onData: (data) => { const newItems = uniqueAndSort([ - ...(data.data.data ? formatTransactions(data.data.data) : []), + ...(data?.data?.data ? formatTransactions(data.data.data) : []), ...state.items, ]); handleSetState((prevState) => ({ @@ -89,17 +107,18 @@ export const useTransactions = () => { // tx query // ================================ const LIMIT = 51; - const transactionQuery = useTransactionsQuery({ + const transactionQuery = useMessagesByTypesQuery({ variables: { limit: LIMIT, offset: 1, + types: msgTypes ?? '{}', }, onError: () => { handleSetState((prevState) => ({ ...prevState, loading: false })); }, onCompleted: (data) => { - const itemsLength = data.transactions.length; - const newItems = uniqueAndSort([...state.items, ...formatTransactions(data)]); + const itemsLength = data.messagesByTypes.length; + const newItems = uniqueAndSort([...state.items, ...(formatTransactions(data) ?? [])]); handleSetState((prevState) => ({ ...prevState, loading: false, @@ -121,12 +140,8 @@ export const useTransactions = () => { }, }) .then(({ data }) => { - const itemsLength = data.transactions.length; - const newItems = uniqueAndSort([ - ...state.items, - ...formatTransactions(data), - ]) as TransactionsState['items']; - // set new state + const itemsLength = data?.messagesByTypes.length; + const newItems = uniqueAndSort([...state.items, ...(formatTransactions(data) ?? [])]); handleSetState((prevState) => ({ ...prevState, items: newItems, diff --git a/packages/ui/src/screens/transactions/index.tsx b/packages/ui/src/screens/transactions/index.tsx index 82f861c781..117fe8aff3 100644 --- a/packages/ui/src/screens/transactions/index.tsx +++ b/packages/ui/src/screens/transactions/index.tsx @@ -1,14 +1,16 @@ import { NextSeo } from 'next-seo'; import useAppTranslation from '@/hooks/useAppTranslation'; -import { useRecoilValue } from 'recoil'; +import { SetterOrUpdater, useRecoilState, useRecoilValue } from 'recoil'; import Box from '@/components/box'; import Layout from '@/components/layout'; import LoadAndExist from '@/components/load_and_exist'; import TransactionsList from '@/components/transactions_list'; import TransactionsListDetails from '@/components/transactions_list_details'; import { readTx } from '@/recoil/settings'; +import { writeFilter, writeSelectedMsgTypes } from '@/recoil/transactions_filter'; import { useTransactions } from '@/screens/transactions/hooks'; import useStyles from '@/screens/transactions/styles'; +import { useEffect } from 'react'; const Transactions = () => { const txListFormat = useRecoilValue(readTx); @@ -18,6 +20,17 @@ const Transactions = () => { const loadMoreItems = state.isNextPageLoading ? () => null : loadNextPage; const isItemLoaded = (index: number) => !state.hasNextPage || index < state.items.length; const itemCount = state.hasNextPage ? state.items.length + 1 : state.items.length; + const [, setMsgTypes] = useRecoilState(writeFilter) as [string, SetterOrUpdater]; + const [, setSelectedMsgs] = useRecoilState(writeSelectedMsgTypes) as [ + string[], + SetterOrUpdater + ]; + useEffect(() => { + setMsgTypes('{}'); + setSelectedMsgs([]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + return ( <> { + setState((prevState) => ({ + ...prevState, + data: [], + hasNextPage: false, + isNextPageLoading: true, + offsetCount: 0, + })); + }, [router?.query?.address, msgTypes]); const handleSetState = (stateChange: (prevState: TransactionState) => TransactionState) => { setState((prevState) => { @@ -63,6 +76,7 @@ export function useTransactions() { limit: LIMIT + 1, // to check if more exist offset: 0, address: `{${router?.query?.address ?? ''}}`, + types: msgTypes, }, onCompleted: (data) => { const itemsLength = data.messagesByAddress.length; diff --git a/packages/ui/src/screens/validator_details/components/transactions/index.tsx b/packages/ui/src/screens/validator_details/components/transactions/index.tsx index c60e22009c..847c3823e1 100644 --- a/packages/ui/src/screens/validator_details/components/transactions/index.tsx +++ b/packages/ui/src/screens/validator_details/components/transactions/index.tsx @@ -1,11 +1,12 @@ import Typography from '@mui/material/Typography'; import useAppTranslation from '@/hooks/useAppTranslation'; -import { FC } from 'react'; -import { useRecoilValue } from 'recoil'; +import { FC, useEffect } from 'react'; +import { SetterOrUpdater, useRecoilState, useRecoilValue } from 'recoil'; import Box from '@/components/box'; import TransactionsList from '@/components/transactions_list'; import TransactionsListDetails from '@/components/transactions_list_details'; import { readTx } from '@/recoil/settings'; +import { writeFilter, writeSelectedMsgTypes } from '@/recoil/transactions_filter'; import { useTransactions } from '@/screens/validator_details/components/transactions/hooks'; import useStyles from '@/screens/validator_details/components/transactions/styles'; @@ -20,6 +21,18 @@ const Transactions: FC = (props) => { const isItemLoaded = (index: number) => !state.hasNextPage || index < state.data.length; const itemCount = state.hasNextPage ? state.data.length + 1 : state.data.length; + const [, setMsgTypes] = useRecoilState(writeFilter) as [string, SetterOrUpdater]; + const [, setSelectedMsgs] = useRecoilState(writeSelectedMsgTypes) as [ + string[], + SetterOrUpdater + ]; + useEffect(() => { + setMsgTypes('{}'); + setSelectedMsgs([]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ( {t('transactions')}