From 9b4f6952811bf5257f6a2f41219a2fb0d47875ce Mon Sep 17 00:00:00 2001 From: Beast Date: Tue, 6 Oct 2026 10:56:58 +0800 Subject: [PATCH] feat: remove total supply --- src/__generated__/gql.ts | 8 ++++---- src/__generated__/graphql.ts | 5 ----- src/api/chain-status.tsx | 3 +-- .../features/landing/hero/chain-stats/ChainStats.tsx | 9 +-------- .../features/landing/hero/chain-stats/hook.tsx | 1 - src/schemas/chain-status.ts | 1 - 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/__generated__/gql.ts b/src/__generated__/gql.ts index 57bbc34..f8dbaa4 100644 --- a/src/__generated__/gql.ts +++ b/src/__generated__/gql.ts @@ -18,7 +18,7 @@ type Documents = { '\n query GetBlockById($height: Int!, $hash: String!) {\n blocks: block(\n where: {\n _or: [{ height: { _eq: $height } }, { hash: { _eq: $hash } }]\n }\n ) {\n id\n hash\n height\n reward\n timestamp\n extrinsics(order_by: { index_in_block: asc }) {\n id\n pallet\n call\n success\n fee\n timestamp\n indexInBlock: index_in_block\n signer {\n id\n }\n }\n }\n minerRewards: miner_reward(\n where: {\n block: {\n _or: [{ height: { _eq: $height } }, { hash: { _eq: $hash } }]\n }\n }\n ) {\n reward\n timestamp\n miner {\n id\n }\n block {\n height\n hash\n }\n }\n rewardTransfers: unified_transaction(\n where: {\n type: { _eq: "IMMEDIATE" }\n hash: { _is_null: true }\n block: {\n _or: [{ height: { _eq: $height } }, { hash: { _eq: $hash } }]\n }\n }\n ) {\n amount\n detail_id\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': typeof types.GetBlockByIdDocument; '\n query GetBlockStats($startDate: timestamptz!, $endDate: timestamptz!) {\n chain: chain_stats_by_pk(id: "global") {\n block_height\n finalized_block_height\n }\n minedIn24Hours: block_aggregate(\n where: { timestamp: { _gte: $startDate, _lte: $endDate } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n }\n ': typeof types.GetBlockStatsDocument; '\n query GetCancelledReversibleTransactionByTxId($tx_id: String!) {\n cancelledReversibleTransactions: cancelled_reversible_transfer(\n where: { tx_id: { _eq: $tx_id } }\n ) {\n timestamp\n tx_id\n block {\n height\n }\n cancelledBy {\n id\n }\n extrinsic {\n id\n pallet\n call\n }\n scheduledTransfer {\n amount\n scheduled_at\n fee\n from {\n id\n }\n to {\n id\n }\n }\n }\n }\n ': typeof types.GetCancelledReversibleTransactionByTxIdDocument; - '\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n': typeof types.GetHomeChainStatsDocument; + '\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n': typeof types.GetHomeChainStatsDocument; '\n query GetStatus {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_executed_transfers\n total_immediate_transfers\n total_scheduled_transfers\n total_cancelled_transfers\n }\n }\n ': typeof types.GetStatusDocument; '\n query GetErrorEvents(\n $limit: Int\n $offset: Int\n $orderBy: [error_event_order_by!]\n $where: error_event_bool_exp\n ) {\n errorEvents: error_event(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n error_docs\n error_module\n error_name\n error_type\n extrinsic {\n id\n pallet\n call\n }\n id\n timestamp\n block {\n height\n }\n }\n meta: error_event_aggregate(where: $where) {\n aggregate {\n totalCount: count\n }\n }\n }\n ': typeof types.GetErrorEventsDocument; '\n query GetErrorEventsStats(\n $startDate: timestamptz!\n $endDate: timestamptz!\n ) {\n last24Hour: error_event_aggregate(\n where: { timestamp: { _gte: $startDate, _lte: $endDate } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n allTime: chain_stats_by_pk(id: "global") {\n total_error_events\n }\n }\n ': typeof types.GetErrorEventsStatsDocument; @@ -120,7 +120,7 @@ const documents: Documents = { types.GetBlockStatsDocument, '\n query GetCancelledReversibleTransactionByTxId($tx_id: String!) {\n cancelledReversibleTransactions: cancelled_reversible_transfer(\n where: { tx_id: { _eq: $tx_id } }\n ) {\n timestamp\n tx_id\n block {\n height\n }\n cancelledBy {\n id\n }\n extrinsic {\n id\n pallet\n call\n }\n scheduledTransfer {\n amount\n scheduled_at\n fee\n from {\n id\n }\n to {\n id\n }\n }\n }\n }\n ': types.GetCancelledReversibleTransactionByTxIdDocument, - '\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n': + '\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n': types.GetHomeChainStatsDocument, '\n query GetStatus {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_executed_transfers\n total_immediate_transfers\n total_scheduled_transfers\n total_cancelled_transfers\n }\n }\n ': types.GetStatusDocument, @@ -347,8 +347,8 @@ export function gql( * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function gql( - source: '\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n' -): (typeof documents)['\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n']; + source: '\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n' +): (typeof documents)['\n query GetHomeChainStats(\n $last24HourWhere: unified_transaction_bool_exp!\n $last24HourTransferredWhere: unified_transaction_bool_exp!\n $dayLimit: Int!\n ) {\n status: chain_stats_by_pk(id: "global") {\n block_height\n total_accounts\n total_deposit_accounts\n total_immediate_transfers\n total_scheduled_transfers\n total_executed_transfers\n total_cancelled_transfers\n circulating_supply\n max_supply\n total_transferred_amount\n }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\n }\n }\n last24HourTransferred: unified_transaction_aggregate(\n where: $last24HourTransferredWhere\n ) {\n aggregate {\n sum {\n amount\n }\n }\n }\n dailyStats: daily_chain_stats(order_by: { date: desc }, limit: $dayLimit) {\n id\n date\n blocks_count\n tx_count\n active_accounts\n transferred_amount\n }\n }\n']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/src/__generated__/graphql.ts b/src/__generated__/graphql.ts index fcf38d4..2e41790 100644 --- a/src/__generated__/graphql.ts +++ b/src/__generated__/graphql.ts @@ -10451,7 +10451,6 @@ export type GetHomeChainStatsQuery = { total_cancelled_transfers: number; circulating_supply: any; max_supply: any; - total_supply: any; total_transferred_amount: any; } | null; last24Hour: { @@ -14062,10 +14061,6 @@ export const GetHomeChainStatsDocument = { name: { kind: 'Name', value: 'circulating_supply' } }, { kind: 'Field', name: { kind: 'Name', value: 'max_supply' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'total_supply' } - }, { kind: 'Field', name: { kind: 'Name', value: 'total_transferred_amount' } diff --git a/src/api/chain-status.tsx b/src/api/chain-status.tsx index 12da33e..5538ced 100644 --- a/src/api/chain-status.tsx +++ b/src/api/chain-status.tsx @@ -14,7 +14,7 @@ import { withExcludedRewardTransfers } from '@/utils/unified-transaction-filters'; -const GET_HOME_STATS = gql` +export const GET_HOME_STATS = gql` query GetHomeChainStats( $last24HourWhere: unified_transaction_bool_exp! $last24HourTransferredWhere: unified_transaction_bool_exp! @@ -30,7 +30,6 @@ const GET_HOME_STATS = gql` total_cancelled_transfers circulating_supply max_supply - total_supply total_transferred_amount } last24Hour: unified_transaction_aggregate(where: $last24HourWhere) { diff --git a/src/components/features/landing/hero/chain-stats/ChainStats.tsx b/src/components/features/landing/hero/chain-stats/ChainStats.tsx index 32a1a8f..d5623ef 100644 --- a/src/components/features/landing/hero/chain-stats/ChainStats.tsx +++ b/src/components/features/landing/hero/chain-stats/ChainStats.tsx @@ -65,7 +65,6 @@ export const ChainStats: React.FC = () => { totalTransferred, last24HourTransferred, maxSupply, - totalSupply, circulatingSupply } = useChainStats(); @@ -122,19 +121,13 @@ export const ChainStats: React.FC = () => { /> - + - { totalTransferred: status?.total_transferred_amount, last24HourTransferred, maxSupply: status?.max_supply, - totalSupply: status?.total_supply, circulatingSupply: status?.circulating_supply }; }; diff --git a/src/schemas/chain-status.ts b/src/schemas/chain-status.ts index fc1949c..d603b22 100644 --- a/src/schemas/chain-status.ts +++ b/src/schemas/chain-status.ts @@ -38,7 +38,6 @@ export interface HomeChainStatsStatus { total_cancelled_transfers: number; circulating_supply: string; max_supply: string; - total_supply: string; total_transferred_amount: string; }