From 2579532eeb24c79f9d89cc4b1049d8d23048a34c Mon Sep 17 00:00:00 2001 From: Beast Date: Sat, 3 Oct 2026 17:16:27 +0800 Subject: [PATCH] feat: update filter query --- src/__generated__/gql.ts | 88 +- src/__generated__/graphql.ts | 1619 +++++++++-------- src/api/accounts.test.ts | 23 + src/api/accounts.tsx | 8 +- .../common/table-columns/ACCOUNT_COLUMNS.tsx | 4 +- .../AccountInformation.tsx | 2 +- src/schemas/account.ts | 10 +- src/utils/account-type-filter.test.ts | 4 +- src/utils/account-type-filter.ts | 4 +- 9 files changed, 908 insertions(+), 854 deletions(-) create mode 100644 src/api/accounts.test.ts diff --git a/src/__generated__/gql.ts b/src/__generated__/gql.ts index a127ef6..57bbc34 100644 --- a/src/__generated__/gql.ts +++ b/src/__generated__/gql.ts @@ -14,14 +14,11 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ * Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size */ type Documents = { - '\n query GetAccounts(\n $limit: Int\n $offset: Int\n $orderBy: [account_order_by!]\n ) {\n accounts: account(limit: $limit, offset: $offset, order_by: $orderBy) {\n id\n free\n frozen\n reserved\n is_high_security\n is_guardian\n is_multisig\n }\n meta: chain_stats_by_pk(id: "global") {\n totalCount: total_accounts\n }\n }\n ': typeof types.GetAccountsDocument; - '\n query GetAccountById($id: String!) {\n account: account_by_pk(id: $id) {\n id\n free\n frozen\n reserved\n }\n accountStats: account_stats_by_pk(id: $id) {\n total_cancelled_transfers\n total_executed_transfers\n total_immediate_transfers\n total_mined_blocks\n total_rewards\n total_scheduled_transfers\n }\n multisig: multisig_by_pk(id: $id) {\n id\n }\n guardian: high_security_set_aggregate(\n where: { who: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n beneficiaries: high_security_set_aggregate(\n where: { guardian: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n }\n ': typeof types.GetAccountByIdDocument; - '\n query GetAccountsStats($startDate: timestamptz!, $endDate: timestamptz!) {\n all: chain_stats_by_pk(id: "global") {\n total_accounts\n }\n\n recentlyActive: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n sent: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n\n recentlyDeposited: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n received: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n }\n ': typeof types.GetAccountsStatsDocument; '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [block_order_by!]!\n $where: block_bool_exp\n ) {\n blocks: block(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n id\n hash\n height\n reward\n timestamp\n mined_by_id\n extrinsics {\n id\n }\n }\n meta: chain_stats_by_pk(id: "global") {\n totalCount: block_height\n }\n }\n ': typeof types.GetBlocksDocument; '\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 $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 }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\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 }\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_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; @@ -83,7 +80,12 @@ type Documents = { '\n query SearchNumeric($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: unified_transaction(\n limit: $limit\n where: { detail_id: { _like: $keyword } }\n ) {\n id\n type\n hash\n detail_id\n block {\n height\n hash\n }\n }\n blocks: block(limit: $limit, where: { height: { _eq: $keyword_number } }) {\n height\n }\n }\n': typeof types.SearchNumericDocument; '\n query SearchText($keyword: String, $limit: Int) {\n accounts: account(limit: $limit, where: { id: { _like: $keyword } }) {\n id\n }\n errorEvents: error_event(\n limit: $limit\n where: {\n _or: [\n { error_type: { _ilike: $keyword } }\n { error_name: { _ilike: $keyword } }\n ]\n }\n ) {\n extrinsic {\n id\n pallet\n call\n }\n }\n }\n': typeof types.SearchTextDocument; '\n query GetExtrinsicByHash($hash: String!) {\n extrinsics: extrinsic(where: { id: { _eq: $hash } }) {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n transfersByExtrinsic: transfer(\n where: { extrinsic: { id: { _eq: $hash } } }\n order_by: { timestamp: asc }\n ) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n transfersById: transfer(where: { id: { _eq: $hash } }) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n }\n ': typeof types.GetExtrinsicByHashDocument; + '\n query GetVestingScheduleStats {\n meta: vesting_schedule_aggregate {\n aggregate {\n count\n sum {\n total\n claimed\n }\n }\n }\n }\n': typeof types.GetVestingScheduleStatsDocument; + '\n query GetVestingScheduleChart($limit: Int!) {\n schedules: vesting_schedule(limit: $limit) {\n id\n start\n cliff\n end\n total\n }\n }\n': typeof types.GetVestingScheduleChartDocument; + '\n query GetVestingSchedules(\n $limit: Int\n $offset: Int\n $orderBy: [vesting_schedule_order_by!]\n ) {\n schedules: vesting_schedule(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n beneficiary\n total\n claimed\n start\n cliff\n end\n last_claim_at\n }\n meta: vesting_schedule_aggregate {\n aggregate {\n totalCount: count\n }\n }\n }\n': typeof types.GetVestingSchedulesDocument; '\n query GetWormholeExtrinsicById($id: String!) {\n wormholeExtrinsicById: wormhole_extrinsic_by_pk(id: $id) {\n id\n extrinsic {\n id\n pallet\n call\n }\n total_amount\n output_count\n timestamp\n privacy_score\n privacy_score01_pct\n privacy_score1_pct\n privacy_score5_pct\n privacy_label\n pool_snapshot\n block {\n id\n height\n hash\n timestamp\n }\n outputs {\n id\n exitAccount {\n id\n }\n amount\n }\n }\n wormholeNullifiers: wormhole_nullifier(\n where: { wormholeExtrinsic: { id: { _eq: $id } } }\n ) {\n nullifier\n nullifier_hash\n }\n }\n': typeof types.GetWormholeExtrinsicByIdDocument; + '\n query AccountPartySamples {\n busiest: account_stats(\n limit: 1\n order_by: { total_immediate_transfers: desc }\n ) {\n id\n total_immediate_transfers\n }\n quietest: account_stats(\n limit: 1\n where: { total_immediate_transfers: { _gt: 0 } }\n order_by: [{ total_immediate_transfers: asc }, { id: asc }]\n ) {\n id\n }\n topMiner: account_stats(\n limit: 1\n order_by: { total_mined_blocks: desc }\n ) {\n id\n total_mined_blocks\n }\n }\n ': typeof types.AccountPartySamplesDocument; + '\n query Accounts($limit: Int) {\n account(limit: $limit) {\n id\n }\n }\n': typeof types.AccountsDocument; '\n query BusyAccounts($limit: Int!) {\n account_stats(\n limit: $limit\n order_by: { total_immediate_transfers: desc }\n ) {\n id\n total_immediate_transfers\n total_mined_blocks\n }\n }\n ': typeof types.BusyAccountsDocument; '\n query MinerAccount {\n account_stats(limit: 1, order_by: { total_mined_blocks: desc }) {\n id\n total_mined_blocks\n }\n }\n ': typeof types.MinerAccountDocument; '\n query DiscoveryIds($limit: Int!) {\n account(limit: $limit, order_by: { id: desc }) {\n id\n }\n }\n ': typeof types.DiscoveryIdsDocument; @@ -102,6 +104,7 @@ type Documents = { '\n query SampleSignerApproved {\n multisig_signer_approved(limit: 1, order_by: { timestamp: desc }) {\n extrinsic {\n id\n }\n }\n }\n ': typeof types.SampleSignerApprovedDocument; '\n query SampleProposalExecuted {\n executed_multisig_proposal(limit: 1, order_by: { timestamp: desc }) {\n extrinsic {\n id\n }\n }\n }\n ': typeof types.SampleProposalExecutedDocument; '\n query SampleProposalCancelled {\n cancelled_multisig_proposal(limit: 1, order_by: { timestamp: desc }) {\n extrinsic {\n id\n }\n }\n }\n ': typeof types.SampleProposalCancelledDocument; + '\n query NetworkFloor {\n __typename\n }\n': typeof types.NetworkFloorDocument; '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [transfer_order_by!]\n $where: transfer_bool_exp\n ) {\n transactions: transfer(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n extrinsic {\n id\n }\n }\n }\n': typeof types.GetTransactionsDocument; '\n query GetCancelledReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [cancelled_reversible_transfer_order_by!]\n $where: cancelled_reversible_transfer_bool_exp\n ) {\n cancelledReversibleTransactions: cancelled_reversible_transfer(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n tx_id\n }\n }\n': typeof types.GetCancelledReversibleTransactionsDocument; '\n query GetExecutedReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [executed_reversible_transfer_order_by!]\n $where: executed_reversible_transfer_bool_exp\n ) {\n executedReversibleTransactions: executed_reversible_transfer(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n tx_id\n }\n }\n': typeof types.GetExecutedReversibleTransactionsDocument; @@ -109,12 +112,6 @@ type Documents = { '\n query GetWormholeExtrinsics(\n $limit: Int\n $offset: Int\n $orderBy: [wormhole_extrinsic_order_by!]!\n $where: wormhole_extrinsic_bool_exp\n ) {\n wormholeExtrinsics: wormhole_extrinsic(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n id\n }\n }\n': typeof types.GetWormholeExtrinsicsDocument; }; const documents: Documents = { - '\n query GetAccounts(\n $limit: Int\n $offset: Int\n $orderBy: [account_order_by!]\n ) {\n accounts: account(limit: $limit, offset: $offset, order_by: $orderBy) {\n id\n free\n frozen\n reserved\n is_high_security\n is_guardian\n is_multisig\n }\n meta: chain_stats_by_pk(id: "global") {\n totalCount: total_accounts\n }\n }\n ': - types.GetAccountsDocument, - '\n query GetAccountById($id: String!) {\n account: account_by_pk(id: $id) {\n id\n free\n frozen\n reserved\n }\n accountStats: account_stats_by_pk(id: $id) {\n total_cancelled_transfers\n total_executed_transfers\n total_immediate_transfers\n total_mined_blocks\n total_rewards\n total_scheduled_transfers\n }\n multisig: multisig_by_pk(id: $id) {\n id\n }\n guardian: high_security_set_aggregate(\n where: { who: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n beneficiaries: high_security_set_aggregate(\n where: { guardian: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n }\n ': - types.GetAccountByIdDocument, - '\n query GetAccountsStats($startDate: timestamptz!, $endDate: timestamptz!) {\n all: chain_stats_by_pk(id: "global") {\n total_accounts\n }\n\n recentlyActive: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n sent: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n\n recentlyDeposited: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n received: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n }\n ': - types.GetAccountsStatsDocument, '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [block_order_by!]!\n $where: block_bool_exp\n ) {\n blocks: block(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n id\n hash\n height\n reward\n timestamp\n mined_by_id\n extrinsics {\n id\n }\n }\n meta: chain_stats_by_pk(id: "global") {\n totalCount: block_height\n }\n }\n ': types.GetBlocksDocument, '\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 ': @@ -123,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 $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 }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\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 }\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_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, @@ -247,8 +244,18 @@ const documents: Documents = { types.SearchTextDocument, '\n query GetExtrinsicByHash($hash: String!) {\n extrinsics: extrinsic(where: { id: { _eq: $hash } }) {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n transfersByExtrinsic: transfer(\n where: { extrinsic: { id: { _eq: $hash } } }\n order_by: { timestamp: asc }\n ) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n transfersById: transfer(where: { id: { _eq: $hash } }) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n }\n ': types.GetExtrinsicByHashDocument, + '\n query GetVestingScheduleStats {\n meta: vesting_schedule_aggregate {\n aggregate {\n count\n sum {\n total\n claimed\n }\n }\n }\n }\n': + types.GetVestingScheduleStatsDocument, + '\n query GetVestingScheduleChart($limit: Int!) {\n schedules: vesting_schedule(limit: $limit) {\n id\n start\n cliff\n end\n total\n }\n }\n': + types.GetVestingScheduleChartDocument, + '\n query GetVestingSchedules(\n $limit: Int\n $offset: Int\n $orderBy: [vesting_schedule_order_by!]\n ) {\n schedules: vesting_schedule(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n beneficiary\n total\n claimed\n start\n cliff\n end\n last_claim_at\n }\n meta: vesting_schedule_aggregate {\n aggregate {\n totalCount: count\n }\n }\n }\n': + types.GetVestingSchedulesDocument, '\n query GetWormholeExtrinsicById($id: String!) {\n wormholeExtrinsicById: wormhole_extrinsic_by_pk(id: $id) {\n id\n extrinsic {\n id\n pallet\n call\n }\n total_amount\n output_count\n timestamp\n privacy_score\n privacy_score01_pct\n privacy_score1_pct\n privacy_score5_pct\n privacy_label\n pool_snapshot\n block {\n id\n height\n hash\n timestamp\n }\n outputs {\n id\n exitAccount {\n id\n }\n amount\n }\n }\n wormholeNullifiers: wormhole_nullifier(\n where: { wormholeExtrinsic: { id: { _eq: $id } } }\n ) {\n nullifier\n nullifier_hash\n }\n }\n': types.GetWormholeExtrinsicByIdDocument, + '\n query AccountPartySamples {\n busiest: account_stats(\n limit: 1\n order_by: { total_immediate_transfers: desc }\n ) {\n id\n total_immediate_transfers\n }\n quietest: account_stats(\n limit: 1\n where: { total_immediate_transfers: { _gt: 0 } }\n order_by: [{ total_immediate_transfers: asc }, { id: asc }]\n ) {\n id\n }\n topMiner: account_stats(\n limit: 1\n order_by: { total_mined_blocks: desc }\n ) {\n id\n total_mined_blocks\n }\n }\n ': + types.AccountPartySamplesDocument, + '\n query Accounts($limit: Int) {\n account(limit: $limit) {\n id\n }\n }\n': + types.AccountsDocument, '\n query BusyAccounts($limit: Int!) {\n account_stats(\n limit: $limit\n order_by: { total_immediate_transfers: desc }\n ) {\n id\n total_immediate_transfers\n total_mined_blocks\n }\n }\n ': types.BusyAccountsDocument, '\n query MinerAccount {\n account_stats(limit: 1, order_by: { total_mined_blocks: desc }) {\n id\n total_mined_blocks\n }\n }\n ': @@ -285,6 +292,7 @@ const documents: Documents = { types.SampleProposalExecutedDocument, '\n query SampleProposalCancelled {\n cancelled_multisig_proposal(limit: 1, order_by: { timestamp: desc }) {\n extrinsic {\n id\n }\n }\n }\n ': types.SampleProposalCancelledDocument, + '\n query NetworkFloor {\n __typename\n }\n': types.NetworkFloorDocument, '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [transfer_order_by!]\n $where: transfer_bool_exp\n ) {\n transactions: transfer(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n extrinsic {\n id\n }\n }\n }\n': types.GetTransactionsDocument, '\n query GetCancelledReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [cancelled_reversible_transfer_order_by!]\n $where: cancelled_reversible_transfer_bool_exp\n ) {\n cancelledReversibleTransactions: cancelled_reversible_transfer(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n where: $where\n ) {\n tx_id\n }\n }\n': @@ -311,24 +319,6 @@ const documents: Documents = { */ export function gql(source: string): unknown; -/** - * 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 GetAccounts(\n $limit: Int\n $offset: Int\n $orderBy: [account_order_by!]\n ) {\n accounts: account(limit: $limit, offset: $offset, order_by: $orderBy) {\n id\n free\n frozen\n reserved\n is_high_security\n is_guardian\n is_multisig\n }\n meta: chain_stats_by_pk(id: "global") {\n totalCount: total_accounts\n }\n }\n ' -): (typeof documents)['\n query GetAccounts(\n $limit: Int\n $offset: Int\n $orderBy: [account_order_by!]\n ) {\n accounts: account(limit: $limit, offset: $offset, order_by: $orderBy) {\n id\n free\n frozen\n reserved\n is_high_security\n is_guardian\n is_multisig\n }\n meta: chain_stats_by_pk(id: "global") {\n totalCount: total_accounts\n }\n }\n ']; -/** - * 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 GetAccountById($id: String!) {\n account: account_by_pk(id: $id) {\n id\n free\n frozen\n reserved\n }\n accountStats: account_stats_by_pk(id: $id) {\n total_cancelled_transfers\n total_executed_transfers\n total_immediate_transfers\n total_mined_blocks\n total_rewards\n total_scheduled_transfers\n }\n multisig: multisig_by_pk(id: $id) {\n id\n }\n guardian: high_security_set_aggregate(\n where: { who: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n beneficiaries: high_security_set_aggregate(\n where: { guardian: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n }\n ' -): (typeof documents)['\n query GetAccountById($id: String!) {\n account: account_by_pk(id: $id) {\n id\n free\n frozen\n reserved\n }\n accountStats: account_stats_by_pk(id: $id) {\n total_cancelled_transfers\n total_executed_transfers\n total_immediate_transfers\n total_mined_blocks\n total_rewards\n total_scheduled_transfers\n }\n multisig: multisig_by_pk(id: $id) {\n id\n }\n guardian: high_security_set_aggregate(\n where: { who: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n beneficiaries: high_security_set_aggregate(\n where: { guardian: { id: { _eq: $id } } }\n ) {\n aggregate {\n totalCount: count\n }\n }\n }\n ']; -/** - * 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 GetAccountsStats($startDate: timestamptz!, $endDate: timestamptz!) {\n all: chain_stats_by_pk(id: "global") {\n total_accounts\n }\n\n recentlyActive: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n sent: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n\n recentlyDeposited: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n received: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n }\n ' -): (typeof documents)['\n query GetAccountsStats($startDate: timestamptz!, $endDate: timestamptz!) {\n all: chain_stats_by_pk(id: "global") {\n total_accounts\n }\n\n recentlyActive: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n sent: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n\n recentlyDeposited: daily_active_account_aggregate(\n where: {\n date: { _gte: $startDate, _lte: $endDate }\n received: { _eq: true }\n }\n ) {\n aggregate {\n count(columns: account_id, distinct: true)\n }\n }\n }\n ']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -357,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 $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 }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\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 }\n }\n' -): (typeof documents)['\n query GetHomeChainStats(\n $last24HourWhere: 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 }\n last24Hour: unified_transaction_aggregate(where: $last24HourWhere) {\n aggregate {\n count\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 }\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_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']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -725,12 +715,42 @@ export function gql( export function gql( source: '\n query GetExtrinsicByHash($hash: String!) {\n extrinsics: extrinsic(where: { id: { _eq: $hash } }) {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n transfersByExtrinsic: transfer(\n where: { extrinsic: { id: { _eq: $hash } } }\n order_by: { timestamp: asc }\n ) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n transfersById: transfer(where: { id: { _eq: $hash } }) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n }\n ' ): (typeof documents)['\n query GetExtrinsicByHash($hash: String!) {\n extrinsics: extrinsic(where: { id: { _eq: $hash } }) {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n transfersByExtrinsic: transfer(\n where: { extrinsic: { id: { _eq: $hash } } }\n order_by: { timestamp: asc }\n ) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n transfersById: transfer(where: { id: { _eq: $hash } }) {\n id\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n block {\n height\n }\n extrinsic {\n id\n pallet\n call\n success\n fee\n timestamp\n index_in_block\n signer {\n id\n }\n block {\n height\n }\n }\n }\n }\n ']; +/** + * 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 GetVestingScheduleStats {\n meta: vesting_schedule_aggregate {\n aggregate {\n count\n sum {\n total\n claimed\n }\n }\n }\n }\n' +): (typeof documents)['\n query GetVestingScheduleStats {\n meta: vesting_schedule_aggregate {\n aggregate {\n count\n sum {\n total\n claimed\n }\n }\n }\n }\n']; +/** + * 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 GetVestingScheduleChart($limit: Int!) {\n schedules: vesting_schedule(limit: $limit) {\n id\n start\n cliff\n end\n total\n }\n }\n' +): (typeof documents)['\n query GetVestingScheduleChart($limit: Int!) {\n schedules: vesting_schedule(limit: $limit) {\n id\n start\n cliff\n end\n total\n }\n }\n']; +/** + * 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 GetVestingSchedules(\n $limit: Int\n $offset: Int\n $orderBy: [vesting_schedule_order_by!]\n ) {\n schedules: vesting_schedule(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n beneficiary\n total\n claimed\n start\n cliff\n end\n last_claim_at\n }\n meta: vesting_schedule_aggregate {\n aggregate {\n totalCount: count\n }\n }\n }\n' +): (typeof documents)['\n query GetVestingSchedules(\n $limit: Int\n $offset: Int\n $orderBy: [vesting_schedule_order_by!]\n ) {\n schedules: vesting_schedule(\n limit: $limit\n offset: $offset\n order_by: $orderBy\n ) {\n id\n beneficiary\n total\n claimed\n start\n cliff\n end\n last_claim_at\n }\n meta: vesting_schedule_aggregate {\n aggregate {\n totalCount: count\n }\n }\n }\n']; /** * 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 GetWormholeExtrinsicById($id: String!) {\n wormholeExtrinsicById: wormhole_extrinsic_by_pk(id: $id) {\n id\n extrinsic {\n id\n pallet\n call\n }\n total_amount\n output_count\n timestamp\n privacy_score\n privacy_score01_pct\n privacy_score1_pct\n privacy_score5_pct\n privacy_label\n pool_snapshot\n block {\n id\n height\n hash\n timestamp\n }\n outputs {\n id\n exitAccount {\n id\n }\n amount\n }\n }\n wormholeNullifiers: wormhole_nullifier(\n where: { wormholeExtrinsic: { id: { _eq: $id } } }\n ) {\n nullifier\n nullifier_hash\n }\n }\n' ): (typeof documents)['\n query GetWormholeExtrinsicById($id: String!) {\n wormholeExtrinsicById: wormhole_extrinsic_by_pk(id: $id) {\n id\n extrinsic {\n id\n pallet\n call\n }\n total_amount\n output_count\n timestamp\n privacy_score\n privacy_score01_pct\n privacy_score1_pct\n privacy_score5_pct\n privacy_label\n pool_snapshot\n block {\n id\n height\n hash\n timestamp\n }\n outputs {\n id\n exitAccount {\n id\n }\n amount\n }\n }\n wormholeNullifiers: wormhole_nullifier(\n where: { wormholeExtrinsic: { id: { _eq: $id } } }\n ) {\n nullifier\n nullifier_hash\n }\n }\n']; +/** + * 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 AccountPartySamples {\n busiest: account_stats(\n limit: 1\n order_by: { total_immediate_transfers: desc }\n ) {\n id\n total_immediate_transfers\n }\n quietest: account_stats(\n limit: 1\n where: { total_immediate_transfers: { _gt: 0 } }\n order_by: [{ total_immediate_transfers: asc }, { id: asc }]\n ) {\n id\n }\n topMiner: account_stats(\n limit: 1\n order_by: { total_mined_blocks: desc }\n ) {\n id\n total_mined_blocks\n }\n }\n ' +): (typeof documents)['\n query AccountPartySamples {\n busiest: account_stats(\n limit: 1\n order_by: { total_immediate_transfers: desc }\n ) {\n id\n total_immediate_transfers\n }\n quietest: account_stats(\n limit: 1\n where: { total_immediate_transfers: { _gt: 0 } }\n order_by: [{ total_immediate_transfers: asc }, { id: asc }]\n ) {\n id\n }\n topMiner: account_stats(\n limit: 1\n order_by: { total_mined_blocks: desc }\n ) {\n id\n total_mined_blocks\n }\n }\n ']; +/** + * 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 Accounts($limit: Int) {\n account(limit: $limit) {\n id\n }\n }\n' +): (typeof documents)['\n query Accounts($limit: Int) {\n account(limit: $limit) {\n id\n }\n }\n']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -839,6 +859,12 @@ export function gql( export function gql( source: '\n query SampleProposalCancelled {\n cancelled_multisig_proposal(limit: 1, order_by: { timestamp: desc }) {\n extrinsic {\n id\n }\n }\n }\n ' ): (typeof documents)['\n query SampleProposalCancelled {\n cancelled_multisig_proposal(limit: 1, order_by: { timestamp: desc }) {\n extrinsic {\n id\n }\n }\n }\n ']; +/** + * 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 NetworkFloor {\n __typename\n }\n' +): (typeof documents)['\n query NetworkFloor {\n __typename\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 753bd9f..fcf38d4 100644 --- a/src/__generated__/graphql.ts +++ b/src/__generated__/graphql.ts @@ -120,6 +120,7 @@ export type Account = { extrinsics_aggregate: Extrinsic_Aggregate; free: Scalars['numeric']['output']; frozen: Scalars['numeric']['output']; + has_mined_blocks: Scalars['Boolean']['output']; id: Scalars['String']['output']; is_deposit_only: Scalars['Boolean']['output']; is_guardian: Scalars['Boolean']['output']; @@ -281,6 +282,7 @@ export type Account_Bool_Exp = { extrinsics_aggregate?: InputMaybe; free?: InputMaybe; frozen?: InputMaybe; + has_mined_blocks?: InputMaybe; id?: InputMaybe; is_deposit_only?: InputMaybe; is_guardian?: InputMaybe; @@ -702,6 +704,7 @@ export type Account_Order_By = { extrinsics_aggregate?: InputMaybe; free?: InputMaybe; frozen?: InputMaybe; + has_mined_blocks?: InputMaybe; id?: InputMaybe; is_deposit_only?: InputMaybe; is_guardian?: InputMaybe; @@ -722,6 +725,8 @@ export enum Account_Select_Column { /** column name */ Frozen = 'frozen', /** column name */ + HasMinedBlocks = 'has_mined_blocks', + /** column name */ Id = 'id', /** column name */ IsDepositOnly = 'is_deposit_only', @@ -993,6 +998,7 @@ export type Account_Stream_Cursor_Input = { export type Account_Stream_Cursor_Value_Input = { free?: InputMaybe; frozen?: InputMaybe; + has_mined_blocks?: InputMaybe; id?: InputMaybe; is_deposit_only?: InputMaybe; is_guardian?: InputMaybe; @@ -1750,6 +1756,7 @@ export type Chain_Stats = { total_scheduled_transfers: Scalars['Int']['output']; total_supply: Scalars['numeric']['output']; total_tech_referenda: Scalars['Int']['output']; + total_transferred_amount: Scalars['numeric']['output']; }; /** aggregated selection of "chain_stats" */ @@ -1809,6 +1816,7 @@ export type Chain_Stats_Avg_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** Boolean expression to filter rows from the table "chain_stats". All fields are combined with a logical 'AND'. */ @@ -1842,6 +1850,7 @@ export type Chain_Stats_Bool_Exp = { total_scheduled_transfers?: InputMaybe; total_supply?: InputMaybe; total_tech_referenda?: InputMaybe; + total_transferred_amount?: InputMaybe; }; /** aggregate max on columns */ @@ -1873,6 +1882,7 @@ export type Chain_Stats_Max_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** aggregate min on columns */ @@ -1904,6 +1914,7 @@ export type Chain_Stats_Min_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** Ordering options when selecting data from "chain_stats". */ @@ -1934,6 +1945,7 @@ export type Chain_Stats_Order_By = { total_scheduled_transfers?: InputMaybe; total_supply?: InputMaybe; total_tech_referenda?: InputMaybe; + total_transferred_amount?: InputMaybe; }; /** select columns of table "chain_stats" */ @@ -1989,7 +2001,9 @@ export enum Chain_Stats_Select_Column { /** column name */ TotalSupply = 'total_supply', /** column name */ - TotalTechReferenda = 'total_tech_referenda' + TotalTechReferenda = 'total_tech_referenda', + /** column name */ + TotalTransferredAmount = 'total_transferred_amount' } /** aggregate stddev on columns */ @@ -2020,6 +2034,7 @@ export type Chain_Stats_Stddev_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** aggregate stddev_pop on columns */ @@ -2050,6 +2065,7 @@ export type Chain_Stats_Stddev_Pop_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** aggregate stddev_samp on columns */ @@ -2080,6 +2096,7 @@ export type Chain_Stats_Stddev_Samp_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** Streaming cursor of the table "chain_stats" */ @@ -2118,6 +2135,7 @@ export type Chain_Stats_Stream_Cursor_Value_Input = { total_scheduled_transfers?: InputMaybe; total_supply?: InputMaybe; total_tech_referenda?: InputMaybe; + total_transferred_amount?: InputMaybe; }; /** aggregate sum on columns */ @@ -2148,6 +2166,7 @@ export type Chain_Stats_Sum_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** aggregate var_pop on columns */ @@ -2178,6 +2197,7 @@ export type Chain_Stats_Var_Pop_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** aggregate var_samp on columns */ @@ -2208,6 +2228,7 @@ export type Chain_Stats_Var_Samp_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** aggregate variance on columns */ @@ -2238,6 +2259,7 @@ export type Chain_Stats_Variance_Fields = { total_scheduled_transfers?: Maybe; total_supply?: Maybe; total_tech_referenda?: Maybe; + total_transferred_amount?: Maybe; }; /** ordering argument of a cursor */ @@ -2360,6 +2382,7 @@ export type Daily_Chain_Stats = { blocks_count: Scalars['Int']['output']; date: Scalars['timestamptz']['output']; id: Scalars['String']['output']; + transferred_amount: Scalars['numeric']['output']; tx_count: Scalars['Int']['output']; }; @@ -2397,6 +2420,7 @@ export type Daily_Chain_Stats_Avg_Fields = { __typename?: 'daily_chain_stats_avg_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2409,6 +2433,7 @@ export type Daily_Chain_Stats_Bool_Exp = { blocks_count?: InputMaybe; date?: InputMaybe; id?: InputMaybe; + transferred_amount?: InputMaybe; tx_count?: InputMaybe; }; @@ -2419,6 +2444,7 @@ export type Daily_Chain_Stats_Max_Fields = { blocks_count?: Maybe; date?: Maybe; id?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2429,6 +2455,7 @@ export type Daily_Chain_Stats_Min_Fields = { blocks_count?: Maybe; date?: Maybe; id?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2438,6 +2465,7 @@ export type Daily_Chain_Stats_Order_By = { blocks_count?: InputMaybe; date?: InputMaybe; id?: InputMaybe; + transferred_amount?: InputMaybe; tx_count?: InputMaybe; }; @@ -2452,6 +2480,8 @@ export enum Daily_Chain_Stats_Select_Column { /** column name */ Id = 'id', /** column name */ + TransferredAmount = 'transferred_amount', + /** column name */ TxCount = 'tx_count' } @@ -2460,6 +2490,7 @@ export type Daily_Chain_Stats_Stddev_Fields = { __typename?: 'daily_chain_stats_stddev_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2468,6 +2499,7 @@ export type Daily_Chain_Stats_Stddev_Pop_Fields = { __typename?: 'daily_chain_stats_stddev_pop_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2476,6 +2508,7 @@ export type Daily_Chain_Stats_Stddev_Samp_Fields = { __typename?: 'daily_chain_stats_stddev_samp_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2493,6 +2526,7 @@ export type Daily_Chain_Stats_Stream_Cursor_Value_Input = { blocks_count?: InputMaybe; date?: InputMaybe; id?: InputMaybe; + transferred_amount?: InputMaybe; tx_count?: InputMaybe; }; @@ -2501,6 +2535,7 @@ export type Daily_Chain_Stats_Sum_Fields = { __typename?: 'daily_chain_stats_sum_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2509,6 +2544,7 @@ export type Daily_Chain_Stats_Var_Pop_Fields = { __typename?: 'daily_chain_stats_var_pop_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2517,6 +2553,7 @@ export type Daily_Chain_Stats_Var_Samp_Fields = { __typename?: 'daily_chain_stats_var_samp_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -2525,6 +2562,7 @@ export type Daily_Chain_Stats_Variance_Fields = { __typename?: 'daily_chain_stats_variance_fields'; active_accounts?: Maybe; blocks_count?: Maybe; + transferred_amount?: Maybe; tx_count?: Maybe; }; @@ -3406,6 +3444,7 @@ export type Executed_Reversible_Transfer = { executedTransfer?: Maybe; executed_transfer_id?: Maybe; id: Scalars['String']['output']; + result: Scalars['String']['output']; /** An object relationship */ scheduledTransfer?: Maybe; scheduled_transfer_id?: Maybe; @@ -3445,6 +3484,7 @@ export type Executed_Reversible_Transfer_Bool_Exp = { executedTransfer?: InputMaybe; executed_transfer_id?: InputMaybe; id?: InputMaybe; + result?: InputMaybe; scheduledTransfer?: InputMaybe; scheduled_transfer_id?: InputMaybe; timestamp?: InputMaybe; @@ -3457,6 +3497,7 @@ export type Executed_Reversible_Transfer_Max_Fields = { block_id?: Maybe; executed_transfer_id?: Maybe; id?: Maybe; + result?: Maybe; scheduled_transfer_id?: Maybe; timestamp?: Maybe; tx_id?: Maybe; @@ -3468,6 +3509,7 @@ export type Executed_Reversible_Transfer_Min_Fields = { block_id?: Maybe; executed_transfer_id?: Maybe; id?: Maybe; + result?: Maybe; scheduled_transfer_id?: Maybe; timestamp?: Maybe; tx_id?: Maybe; @@ -3481,6 +3523,7 @@ export type Executed_Reversible_Transfer_Order_By = { executedTransfer?: InputMaybe; executed_transfer_id?: InputMaybe; id?: InputMaybe; + result?: InputMaybe; scheduledTransfer?: InputMaybe; scheduled_transfer_id?: InputMaybe; timestamp?: InputMaybe; @@ -3496,6 +3539,8 @@ export enum Executed_Reversible_Transfer_Select_Column { /** column name */ Id = 'id', /** column name */ + Result = 'result', + /** column name */ ScheduledTransferId = 'scheduled_transfer_id', /** column name */ Timestamp = 'timestamp', @@ -3516,6 +3561,7 @@ export type Executed_Reversible_Transfer_Stream_Cursor_Value_Input = { block_id?: InputMaybe; executed_transfer_id?: InputMaybe; id?: InputMaybe; + result?: InputMaybe; scheduled_transfer_id?: InputMaybe; timestamp?: InputMaybe; tx_id?: InputMaybe; @@ -10272,90 +10318,6 @@ export type Wormhole_Output_Variance_Order_By = { amount?: InputMaybe; }; -export type GetAccountsQueryVariables = Exact<{ - limit?: InputMaybe; - offset?: InputMaybe; - orderBy?: InputMaybe | Account_Order_By>; -}>; - -export type GetAccountsQuery = { - __typename?: 'query_root'; - accounts: Array<{ - __typename?: 'account'; - id: string; - free: any; - frozen: any; - reserved: any; - is_high_security: boolean; - is_guardian: boolean; - is_multisig: boolean; - }>; - meta?: { __typename?: 'chain_stats'; totalCount: number } | null; -}; - -export type GetAccountByIdQueryVariables = Exact<{ - id: Scalars['String']['input']; -}>; - -export type GetAccountByIdQuery = { - __typename?: 'query_root'; - account?: { - __typename?: 'account'; - id: string; - free: any; - frozen: any; - reserved: any; - } | null; - accountStats?: { - __typename?: 'account_stats'; - total_cancelled_transfers: number; - total_executed_transfers: number; - total_immediate_transfers: number; - total_mined_blocks: number; - total_rewards: any; - total_scheduled_transfers: number; - } | null; - multisig?: { __typename?: 'multisig'; id: string } | null; - guardian: { - __typename?: 'high_security_set_aggregate'; - aggregate?: { - __typename?: 'high_security_set_aggregate_fields'; - totalCount: number; - } | null; - }; - beneficiaries: { - __typename?: 'high_security_set_aggregate'; - aggregate?: { - __typename?: 'high_security_set_aggregate_fields'; - totalCount: number; - } | null; - }; -}; - -export type GetAccountsStatsQueryVariables = Exact<{ - startDate: Scalars['timestamptz']['input']; - endDate: Scalars['timestamptz']['input']; -}>; - -export type GetAccountsStatsQuery = { - __typename?: 'query_root'; - all?: { __typename?: 'chain_stats'; total_accounts: number } | null; - recentlyActive: { - __typename?: 'daily_active_account_aggregate'; - aggregate?: { - __typename?: 'daily_active_account_aggregate_fields'; - count: number; - } | null; - }; - recentlyDeposited: { - __typename?: 'daily_active_account_aggregate'; - aggregate?: { - __typename?: 'daily_active_account_aggregate_fields'; - count: number; - } | null; - }; -}; - export type GetBlocksQueryVariables = Exact<{ limit?: InputMaybe; offset?: InputMaybe; @@ -10472,6 +10434,7 @@ export type GetCancelledReversibleTransactionByTxIdQuery = { export type GetHomeChainStatsQueryVariables = Exact<{ last24HourWhere: Unified_Transaction_Bool_Exp; + last24HourTransferredWhere: Unified_Transaction_Bool_Exp; dayLimit: Scalars['Int']['input']; }>; @@ -10489,6 +10452,7 @@ export type GetHomeChainStatsQuery = { circulating_supply: any; max_supply: any; total_supply: any; + total_transferred_amount: any; } | null; last24Hour: { __typename?: 'unified_transaction_aggregate'; @@ -10497,6 +10461,16 @@ export type GetHomeChainStatsQuery = { count: number; } | null; }; + last24HourTransferred: { + __typename?: 'unified_transaction_aggregate'; + aggregate?: { + __typename?: 'unified_transaction_aggregate_fields'; + sum?: { + __typename?: 'unified_transaction_sum_fields'; + amount?: any | null; + } | null; + } | null; + }; dailyStats: Array<{ __typename?: 'daily_chain_stats'; id: string; @@ -10504,6 +10478,7 @@ export type GetHomeChainStatsQuery = { blocks_count: number; tx_count: number; active_accounts: number; + transferred_amount: any; }>; }; @@ -11836,6 +11811,72 @@ export type GetExtrinsicByHashQuery = { }>; }; +export type GetVestingScheduleStatsQueryVariables = Exact<{ + [key: string]: never; +}>; + +export type GetVestingScheduleStatsQuery = { + __typename?: 'query_root'; + meta: { + __typename?: 'vesting_schedule_aggregate'; + aggregate?: { + __typename?: 'vesting_schedule_aggregate_fields'; + count: number; + sum?: { + __typename?: 'vesting_schedule_sum_fields'; + total?: any | null; + claimed?: any | null; + } | null; + } | null; + }; +}; + +export type GetVestingScheduleChartQueryVariables = Exact<{ + limit: Scalars['Int']['input']; +}>; + +export type GetVestingScheduleChartQuery = { + __typename?: 'query_root'; + schedules: Array<{ + __typename?: 'vesting_schedule'; + id: string; + start: any; + cliff: any; + end: any; + total: any; + }>; +}; + +export type GetVestingSchedulesQueryVariables = Exact<{ + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe< + Array | Vesting_Schedule_Order_By + >; +}>; + +export type GetVestingSchedulesQuery = { + __typename?: 'query_root'; + schedules: Array<{ + __typename?: 'vesting_schedule'; + id: string; + beneficiary: string; + total: any; + claimed: any; + start: any; + cliff: any; + end: any; + last_claim_at?: any | null; + }>; + meta: { + __typename?: 'vesting_schedule_aggregate'; + aggregate?: { + __typename?: 'vesting_schedule_aggregate_fields'; + totalCount: number; + } | null; + }; +}; + export type GetWormholeExtrinsicByIdQueryVariables = Exact<{ id: Scalars['String']['input']; }>; @@ -11881,6 +11922,32 @@ export type GetWormholeExtrinsicByIdQuery = { }>; }; +export type AccountPartySamplesQueryVariables = Exact<{ [key: string]: never }>; + +export type AccountPartySamplesQuery = { + __typename?: 'query_root'; + busiest: Array<{ + __typename?: 'account_stats'; + id: string; + total_immediate_transfers: number; + }>; + quietest: Array<{ __typename?: 'account_stats'; id: string }>; + topMiner: Array<{ + __typename?: 'account_stats'; + id: string; + total_mined_blocks: number; + }>; +}; + +export type AccountsQueryVariables = Exact<{ + limit?: InputMaybe; +}>; + +export type AccountsQuery = { + __typename?: 'query_root'; + account: Array<{ __typename?: 'account'; id: string }>; +}; + export type BusyAccountsQueryVariables = Exact<{ limit: Scalars['Int']['input']; }>; @@ -12099,6 +12166,10 @@ export type SampleProposalCancelledQuery = { }>; }; +export type NetworkFloorQueryVariables = Exact<{ [key: string]: never }>; + +export type NetworkFloorQuery = { __typename: 'query_root' }; + export type GetTransactionsQueryVariables = Exact<{ limit?: InputMaybe; offset?: InputMaybe; @@ -13024,13 +13095,13 @@ export const MultisigSignerApprovedFieldsFragmentDoc = { } ] } as unknown as DocumentNode; -export const GetAccountsDocument = { +export const GetBlocksDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetAccounts' }, + name: { kind: 'Name', value: 'GetBlocks' }, variableDefinitions: [ { kind: 'VariableDefinition', @@ -13055,15 +13126,29 @@ export const GetAccountsDocument = { name: { kind: 'Name', value: 'orderBy' } }, type: { - kind: 'ListType', + kind: 'NonNullType', type: { - kind: 'NonNullType', + kind: 'ListType', type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'account_order_by' } + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'block_order_by' } + } } } } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'where' } + }, + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'block_bool_exp' } + } } ], selectionSet: { @@ -13071,8 +13156,8 @@ export const GetAccountsDocument = { selections: [ { kind: 'Field', - alias: { kind: 'Name', value: 'accounts' }, - name: { kind: 'Name', value: 'account' }, + alias: { kind: 'Name', value: 'blocks' }, + name: { kind: 'Name', value: 'block' }, arguments: [ { kind: 'Argument', @@ -13097,21 +13182,35 @@ export const GetAccountsDocument = { kind: 'Variable', name: { kind: 'Name', value: 'orderBy' } } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'where' } + } } ], selectionSet: { kind: 'SelectionSet', selections: [ { kind: 'Field', name: { kind: 'Name', value: 'id' } }, - { kind: 'Field', name: { kind: 'Name', value: 'free' } }, - { kind: 'Field', name: { kind: 'Name', value: 'frozen' } }, - { kind: 'Field', name: { kind: 'Name', value: 'reserved' } }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'height' } }, + { kind: 'Field', name: { kind: 'Name', value: 'reward' } }, + { kind: 'Field', name: { kind: 'Name', value: 'timestamp' } }, + { kind: 'Field', name: { kind: 'Name', value: 'mined_by_id' } }, { kind: 'Field', - name: { kind: 'Name', value: 'is_high_security' } - }, - { kind: 'Field', name: { kind: 'Name', value: 'is_guardian' } }, - { kind: 'Field', name: { kind: 'Name', value: 'is_multisig' } } + name: { kind: 'Name', value: 'extrinsics' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + } ] } }, @@ -13132,7 +13231,7 @@ export const GetAccountsDocument = { { kind: 'Field', alias: { kind: 'Name', value: 'totalCount' }, - name: { kind: 'Name', value: 'total_accounts' } + name: { kind: 'Name', value: 'block_height' } } ] } @@ -13141,18 +13240,29 @@ export const GetAccountsDocument = { } } ] -} as unknown as DocumentNode; -export const GetAccountByIdDocument = { +} as unknown as DocumentNode; +export const GetBlockByIdDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetAccountById' }, + name: { kind: 'Name', value: 'GetBlockById' }, variableDefinitions: [ { kind: 'VariableDefinition', - variable: { kind: 'Variable', name: { kind: 'Name', value: 'id' } }, + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'height' } + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } + } + }, + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'hash' } }, type: { kind: 'NonNullType', type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } } @@ -13164,693 +13274,70 @@ export const GetAccountByIdDocument = { selections: [ { kind: 'Field', - alias: { kind: 'Name', value: 'account' }, - name: { kind: 'Name', value: 'account_by_pk' }, + alias: { kind: 'Name', value: 'blocks' }, + name: { kind: 'Name', value: 'block' }, arguments: [ { kind: 'Argument', - name: { kind: 'Name', value: 'id' }, - value: { kind: 'Variable', name: { kind: 'Name', value: 'id' } } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'id' } }, - { kind: 'Field', name: { kind: 'Name', value: 'free' } }, - { kind: 'Field', name: { kind: 'Name', value: 'frozen' } }, - { kind: 'Field', name: { kind: 'Name', value: 'reserved' } } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'accountStats' }, - name: { kind: 'Name', value: 'account_stats_by_pk' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'id' }, - value: { kind: 'Variable', name: { kind: 'Name', value: 'id' } } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'total_cancelled_transfers' } - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'total_executed_transfers' } - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'total_immediate_transfers' } - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'total_mined_blocks' } - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'total_rewards' } - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'total_scheduled_transfers' } - } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'multisig' }, - name: { kind: 'Name', value: 'multisig_by_pk' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'id' }, - value: { kind: 'Variable', name: { kind: 'Name', value: 'id' } } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'id' } } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'guardian' }, - name: { kind: 'Name', value: 'high_security_set_aggregate' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'who' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'id' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_eq' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'id' } - } - } - ] - } - } - ] - } - } - ] - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'aggregate' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: { kind: 'Name', value: 'totalCount' }, - name: { kind: 'Name', value: 'count' } - } - ] - } - } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'beneficiaries' }, - name: { kind: 'Name', value: 'high_security_set_aggregate' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'guardian' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'id' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_eq' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'id' } - } - } - ] - } - } - ] - } - } - ] - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'aggregate' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: { kind: 'Name', value: 'totalCount' }, - name: { kind: 'Name', value: 'count' } - } - ] - } - } - ] - } - } - ] - } - } - ] -} as unknown as DocumentNode; -export const GetAccountsStatsDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetAccountsStats' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'startDate' } - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'timestamptz' } - } - } - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'endDate' } - }, - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'timestamptz' } - } - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: { kind: 'Name', value: 'all' }, - name: { kind: 'Name', value: 'chain_stats_by_pk' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'id' }, - value: { kind: 'StringValue', value: 'global', block: false } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'total_accounts' } - } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'recentlyActive' }, - name: { kind: 'Name', value: 'daily_active_account_aggregate' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'date' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_gte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'startDate' } - } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_lte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'endDate' } - } - } - ] - } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'sent' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_eq' }, - value: { kind: 'BooleanValue', value: true } - } - ] - } - } - ] - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'aggregate' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'count' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'columns' }, - value: { kind: 'EnumValue', value: 'account_id' } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'distinct' }, - value: { kind: 'BooleanValue', value: true } - } - ] - } - ] - } - } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'recentlyDeposited' }, - name: { kind: 'Name', value: 'daily_active_account_aggregate' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'date' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_gte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'startDate' } - } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_lte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'endDate' } - } - } - ] - } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'received' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_eq' }, - value: { kind: 'BooleanValue', value: true } - } - ] - } - } - ] - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'aggregate' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'count' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'columns' }, - value: { kind: 'EnumValue', value: 'account_id' } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'distinct' }, - value: { kind: 'BooleanValue', value: true } - } - ] - } - ] - } - } - ] - } - } - ] - } - } - ] -} as unknown as DocumentNode< - GetAccountsStatsQuery, - GetAccountsStatsQueryVariables ->; -export const GetBlocksDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetBlocks' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' } - }, - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'offset' } - }, - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'orderBy' } - }, - type: { - kind: 'NonNullType', - type: { - kind: 'ListType', - type: { - kind: 'NonNullType', - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'block_order_by' } - } - } - } - } - }, - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'where' } - }, - type: { - kind: 'NamedType', - name: { kind: 'Name', value: 'block_bool_exp' } - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: { kind: 'Name', value: 'blocks' }, - name: { kind: 'Name', value: 'block' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'limit' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' } - } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'offset' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'offset' } - } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'order_by' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'orderBy' } - } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'where' } - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'id' } }, - { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, - { kind: 'Field', name: { kind: 'Name', value: 'height' } }, - { kind: 'Field', name: { kind: 'Name', value: 'reward' } }, - { kind: 'Field', name: { kind: 'Name', value: 'timestamp' } }, - { kind: 'Field', name: { kind: 'Name', value: 'mined_by_id' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'extrinsics' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'id' } } - ] - } - } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'meta' }, - name: { kind: 'Name', value: 'chain_stats_by_pk' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'id' }, - value: { kind: 'StringValue', value: 'global', block: false } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: { kind: 'Name', value: 'totalCount' }, - name: { kind: 'Name', value: 'block_height' } - } - ] - } - } - ] - } - } - ] -} as unknown as DocumentNode; -export const GetBlockByIdDocument = { - kind: 'Document', - definitions: [ - { - kind: 'OperationDefinition', - operation: 'query', - name: { kind: 'Name', value: 'GetBlockById' }, - variableDefinitions: [ - { - kind: 'VariableDefinition', - variable: { - kind: 'Variable', - name: { kind: 'Name', value: 'height' } - }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } - } - }, - { - kind: 'VariableDefinition', - variable: { kind: 'Variable', name: { kind: 'Name', value: 'hash' } }, - type: { - kind: 'NonNullType', - type: { kind: 'NamedType', name: { kind: 'Name', value: 'String' } } - } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - alias: { kind: 'Name', value: 'blocks' }, - name: { kind: 'Name', value: 'block' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_or' }, - value: { - kind: 'ListValue', - values: [ - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'height' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_eq' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'height' } - } - } - ] - } - } - ] - }, - { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'hash' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: '_eq' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'hash' } - } - } - ] - } - } - ] - } - ] - } - } - ] - } + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: '_or' }, + value: { + kind: 'ListValue', + values: [ + { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'height' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: '_eq' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'height' } + } + } + ] + } + } + ] + }, + { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'hash' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: '_eq' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'hash' } + } + } + ] + } + } + ] + } + ] + } + } + ] + } } ], selectionSet: { @@ -14499,6 +13986,20 @@ export const GetHomeChainStatsDocument = { } } }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'last24HourTransferredWhere' } + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'unified_transaction_bool_exp' } + } + } + }, { kind: 'VariableDefinition', variable: { @@ -14560,13 +14061,14 @@ export const GetHomeChainStatsDocument = { kind: 'Field', name: { kind: 'Name', value: 'circulating_supply' } }, + { kind: 'Field', name: { kind: 'Name', value: 'max_supply' } }, { kind: 'Field', - name: { kind: 'Name', value: 'max_supply' } + name: { kind: 'Name', value: 'total_supply' } }, { kind: 'Field', - name: { kind: 'Name', value: 'total_supply' } + name: { kind: 'Name', value: 'total_transferred_amount' } } ] } @@ -14601,6 +14103,48 @@ export const GetHomeChainStatsDocument = { ] } }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'last24HourTransferred' }, + name: { kind: 'Name', value: 'unified_transaction_aggregate' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'last24HourTransferredWhere' } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aggregate' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'sum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'amount' } + } + ] + } + } + ] + } + } + ] + } + }, { kind: 'Field', alias: { kind: 'Name', value: 'dailyStats' }, @@ -14642,6 +14186,10 @@ export const GetHomeChainStatsDocument = { { kind: 'Field', name: { kind: 'Name', value: 'active_accounts' } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'transferred_amount' } } ] } @@ -22968,16 +22516,251 @@ export const GetExtrinsicByHashDocument = { }, { kind: 'Field', - name: { kind: 'Name', value: 'block' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'Field', - name: { kind: 'Name', value: 'height' } - } - ] - } + name: { kind: 'Name', value: 'block' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'height' } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode< + GetExtrinsicByHashQuery, + GetExtrinsicByHashQueryVariables +>; +export const GetVestingScheduleStatsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetVestingScheduleStats' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'meta' }, + name: { kind: 'Name', value: 'vesting_schedule_aggregate' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aggregate' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'count' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'sum' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'total' } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'claimed' } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode< + GetVestingScheduleStatsQuery, + GetVestingScheduleStatsQueryVariables +>; +export const GetVestingScheduleChartDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetVestingScheduleChart' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + }, + type: { + kind: 'NonNullType', + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'schedules' }, + name: { kind: 'Name', value: 'vesting_schedule' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'start' } }, + { kind: 'Field', name: { kind: 'Name', value: 'cliff' } }, + { kind: 'Field', name: { kind: 'Name', value: 'end' } }, + { kind: 'Field', name: { kind: 'Name', value: 'total' } } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode< + GetVestingScheduleChartQuery, + GetVestingScheduleChartQueryVariables +>; +export const GetVestingSchedulesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetVestingSchedules' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'offset' } + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'orderBy' } + }, + type: { + kind: 'ListType', + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'vesting_schedule_order_by' } + } + } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'schedules' }, + name: { kind: 'Name', value: 'vesting_schedule' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'offset' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'offset' } + } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'order_by' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'orderBy' } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'beneficiary' } }, + { kind: 'Field', name: { kind: 'Name', value: 'total' } }, + { kind: 'Field', name: { kind: 'Name', value: 'claimed' } }, + { kind: 'Field', name: { kind: 'Name', value: 'start' } }, + { kind: 'Field', name: { kind: 'Name', value: 'cliff' } }, + { kind: 'Field', name: { kind: 'Name', value: 'end' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'last_claim_at' } + } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'meta' }, + name: { kind: 'Name', value: 'vesting_schedule_aggregate' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'aggregate' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'totalCount' }, + name: { kind: 'Name', value: 'count' } } ] } @@ -22990,8 +22773,8 @@ export const GetExtrinsicByHashDocument = { } ] } as unknown as DocumentNode< - GetExtrinsicByHashQuery, - GetExtrinsicByHashQueryVariables + GetVestingSchedulesQuery, + GetVestingSchedulesQueryVariables >; export const GetWormholeExtrinsicByIdDocument = { kind: 'Document', @@ -23182,6 +22965,220 @@ export const GetWormholeExtrinsicByIdDocument = { GetWormholeExtrinsicByIdQuery, GetWormholeExtrinsicByIdQueryVariables >; +export const AccountPartySamplesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'AccountPartySamples' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'busiest' }, + name: { kind: 'Name', value: 'account_stats' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { kind: 'IntValue', value: '1' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'order_by' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { + kind: 'Name', + value: 'total_immediate_transfers' + }, + value: { kind: 'EnumValue', value: 'desc' } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'total_immediate_transfers' } + } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'quietest' }, + name: { kind: 'Name', value: 'account_stats' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { kind: 'IntValue', value: '1' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { + kind: 'Name', + value: 'total_immediate_transfers' + }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: '_gt' }, + value: { kind: 'IntValue', value: '0' } + } + ] + } + } + ] + } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'order_by' }, + value: { + kind: 'ListValue', + values: [ + { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { + kind: 'Name', + value: 'total_immediate_transfers' + }, + value: { kind: 'EnumValue', value: 'asc' } + } + ] + }, + { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'id' }, + value: { kind: 'EnumValue', value: 'asc' } + } + ] + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'topMiner' }, + name: { kind: 'Name', value: 'account_stats' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { kind: 'IntValue', value: '1' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'order_by' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'total_mined_blocks' }, + value: { kind: 'EnumValue', value: 'desc' } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'total_mined_blocks' } + } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode< + AccountPartySamplesQuery, + AccountPartySamplesQueryVariables +>; +export const AccountsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'Accounts' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'account' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode; export const BusyAccountsDocument = { kind: 'Document', definitions: [ @@ -24687,6 +24684,22 @@ export const SampleProposalCancelledDocument = { SampleProposalCancelledQuery, SampleProposalCancelledQueryVariables >; +export const NetworkFloorDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'NetworkFloor' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: '__typename' } } + ] + } + } + ] +} as unknown as DocumentNode; export const GetTransactionsDocument = { kind: 'Document', definitions: [ diff --git a/src/api/accounts.test.ts b/src/api/accounts.test.ts new file mode 100644 index 0000000..3961b45 --- /dev/null +++ b/src/api/accounts.test.ts @@ -0,0 +1,23 @@ +import { print } from 'graphql'; + +import { + GET_ACCOUNT_BY_ID, + GET_ACCOUNTS, + GET_FILTERED_ACCOUNTS +} from './accounts'; + +describe('account queries', () => { + it.each([ + ['GetAccounts', GET_ACCOUNTS], + ['GetFilteredAccounts', GET_FILTERED_ACCOUNTS], + ['GetAccountById', GET_ACCOUNT_BY_ID] + ] as const)( + '%s reads has_mined_blocks instead of peeking minedBlocks', + (_name, document) => { + const query = print(document); + + expect(query).toContain('has_mined_blocks'); + expect(query).not.toContain('minedBlocks'); + } + ); +}); diff --git a/src/api/accounts.tsx b/src/api/accounts.tsx index 6b48e19..3243bf8 100644 --- a/src/api/accounts.tsx +++ b/src/api/accounts.tsx @@ -24,9 +24,7 @@ const ACCOUNT_LIST_FIELDS = ` is_high_security is_guardian is_multisig - minedBlocks(limit: 1) { - height - } + has_mined_blocks `; export const GET_ACCOUNTS = gql` @@ -71,9 +69,7 @@ export const GET_ACCOUNT_BY_ID = gql` frozen reserved is_deposit_only - minedBlocks(limit: 1) { - height - } + has_mined_blocks } accountStats: account_stats_by_pk(id: $id) { total_cancelled_transfers diff --git a/src/components/common/table-columns/ACCOUNT_COLUMNS.tsx b/src/components/common/table-columns/ACCOUNT_COLUMNS.tsx index 5446674..56835a3 100644 --- a/src/components/common/table-columns/ACCOUNT_COLUMNS.tsx +++ b/src/components/common/table-columns/ACCOUNT_COLUMNS.tsx @@ -31,7 +31,7 @@ export const ACCOUNT_COLUMNS = [ is_guardian: isGuardian, is_multisig: isMultisig, is_deposit_only: isDepositOnly, - minedBlocks + has_mined_blocks: hasMinedBlocks } = props.row.original; const hasFlags = isHighSec || isGuardian || isMultisig; const addressLabel = ( @@ -40,7 +40,7 @@ export const ACCOUNT_COLUMNS = [ isGuardian={isGuardian} isMultisig={isMultisig} isDepositOnly={isDepositOnly} - hasMinedBlocks={minedBlocks.length > 0} + hasMinedBlocks={hasMinedBlocks} /> ); diff --git a/src/components/features/account-details/account-information/AccountInformation.tsx b/src/components/features/account-details/account-information/AccountInformation.tsx index 79e6bd3..bf483f1 100644 --- a/src/components/features/account-details/account-information/AccountInformation.tsx +++ b/src/components/features/account-details/account-information/AccountInformation.tsx @@ -72,7 +72,7 @@ export const AccountInformation: React.FC = ({ isGuardian, isMultisig, isDepositOnly: account?.is_deposit_only ?? null, - hasMinedBlocks: (account?.minedBlocks.length ?? 0) > 0 + hasMinedBlocks: account?.has_mined_blocks ?? false } ]; diff --git a/src/schemas/account.ts b/src/schemas/account.ts index b280e43..1ede687 100644 --- a/src/schemas/account.ts +++ b/src/schemas/account.ts @@ -5,16 +5,12 @@ export type Account = Pick< 'id' | 'free' | 'frozen' | 'reserved' | 'is_deposit_only' >; -/** At most one mined block, fetched only to tell whether the account has ever mined. */ -export interface AccountMinedBlocksPeek { - minedBlocks: { height: number }[]; -} - /** Listing row: flags are denormalized onto `account` by the indexer (no nested event lookups). */ -export interface AccountListItem extends Account, AccountMinedBlocksPeek { +export interface AccountListItem extends Account { is_high_security: boolean; is_guardian: boolean; is_multisig: boolean; + has_mined_blocks: boolean; } export interface AccountListPageResponse { @@ -32,7 +28,7 @@ export interface AccountStats { } export interface AccountResponse { - account: (Account & AccountMinedBlocksPeek) | null; + account: (Account & Pick) | null; accountStats: AccountStats; multisig?: { id: string } | null; beneficiaries: { diff --git a/src/utils/account-type-filter.test.ts b/src/utils/account-type-filter.test.ts index dc800db..b0c2a7e 100644 --- a/src/utils/account-type-filter.test.ts +++ b/src/utils/account-type-filter.test.ts @@ -27,7 +27,7 @@ describe('accountTypeWhere', () => { expect(accountTypeWhere('potential_encrypted')).toEqual({ ...STANDARD, is_deposit_only: { _eq: true }, - _not: { minedBlocks: {} } + has_mined_blocks: { _eq: false } }); }); @@ -35,7 +35,7 @@ describe('accountTypeWhere', () => { expect(accountTypeWhere('encrypted')).toEqual({ ...STANDARD, is_deposit_only: { _eq: true }, - minedBlocks: {} + has_mined_blocks: { _eq: true } }); }); diff --git a/src/utils/account-type-filter.ts b/src/utils/account-type-filter.ts index 10e4669..a6bcbc4 100644 --- a/src/utils/account-type-filter.ts +++ b/src/utils/account-type-filter.ts @@ -30,13 +30,13 @@ export function accountTypeWhere(type: AccountType): Account_Bool_Exp { return { ...STANDARD_ACCOUNT, is_deposit_only: { _eq: true }, - _not: { minedBlocks: {} } + has_mined_blocks: { _eq: false } }; case 'encrypted': return { ...STANDARD_ACCOUNT, is_deposit_only: { _eq: true }, - minedBlocks: {} + has_mined_blocks: { _eq: true } }; case 'high_security': return { is_high_security: { _eq: true } };