From 322ade6a4468f8e7b77aa6a16a31cf1319fd511a Mon Sep 17 00:00:00 2001 From: Ignacio Date: Wed, 28 Feb 2024 18:53:53 +0800 Subject: [PATCH] chore: improve transactions --- apps/web-namada/src/graphql/general/transactions.graphql | 1 + apps/web-namada/src/graphql/types/general_types.ts | 3 ++- .../src/screens/home/components/transactions/hooks.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/web-namada/src/graphql/general/transactions.graphql b/apps/web-namada/src/graphql/general/transactions.graphql index 3ca58dedf4..6fd325dc59 100644 --- a/apps/web-namada/src/graphql/general/transactions.graphql +++ b/apps/web-namada/src/graphql/general/transactions.graphql @@ -6,6 +6,7 @@ subscription TransactionsListener($limit: Int = 7, $offset: Int = 0) { block { timestamp } + tx_type } } diff --git a/apps/web-namada/src/graphql/types/general_types.ts b/apps/web-namada/src/graphql/types/general_types.ts index 8b02e24f59..56f8f7b4f1 100644 --- a/apps/web-namada/src/graphql/types/general_types.ts +++ b/apps/web-namada/src/graphql/types/general_types.ts @@ -2481,7 +2481,7 @@ export type TransactionsListenerSubscriptionVariables = Exact<{ }>; -export type TransactionsListenerSubscription = { transactions: Array<{ __typename?: 'transaction', height: any, hash: string, success: boolean, block?: { __typename?: 'block', timestamp: any } | null }> }; +export type TransactionsListenerSubscription = { transactions: Array<{ __typename?: 'transaction', height: any, hash: string, success: boolean, tx_type: string, block?: { __typename?: 'block', timestamp: any } | null }> }; export type TransactionsQueryVariables = Exact<{ limit?: InputMaybe; @@ -2785,6 +2785,7 @@ export const TransactionsListenerDocument = gql` block { timestamp } + tx_type } } `; diff --git a/apps/web-namada/src/screens/home/components/transactions/hooks.ts b/apps/web-namada/src/screens/home/components/transactions/hooks.ts index 193cff3eda..8a380f3023 100644 --- a/apps/web-namada/src/screens/home/components/transactions/hooks.ts +++ b/apps/web-namada/src/screens/home/components/transactions/hooks.ts @@ -19,9 +19,10 @@ const formatTransactions = (data: TransactionsListenerSubscription) => return { height: x.height, hash: x.hash, - type: convertedMsgType, + type: [x.tx_type], success: x.success, timestamp: x.block?.timestamp, + tx_type: x.tx_type, messages: 0, }; }) ?? [];