diff --git a/README.md b/README.md index 42fb895..42151b7 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,7 @@ Create a `.env.local` file in the root directory: ```env # Required -NEXT_PUBLIC_SITE_URL=http://localhost:3100 -NEXT_PUBLIC_GRAPHQL_URL=https://gql.res.fm/graphql +VITE_SITE_URL=http://localhost:3100 # Optional ANALYZE=false diff --git a/codegen.ts b/codegen.ts index 871c81b..e44fdf1 100644 --- a/codegen.ts +++ b/codegen.ts @@ -1,8 +1,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { - schema: 'https://gql.res.fm/graphql', - // this assumes that all your source files are in a top-level `src/` directory - you might need to adjust this to your file structure + schema: 'https://quantu.se/graphql', documents: ['src/**/*.{ts,tsx}'], generates: { './src/__generated__/': { diff --git a/src/__generated__/gql.ts b/src/__generated__/gql.ts index cd5f3a5..30178bb 100644 --- a/src/__generated__/gql.ts +++ b/src/__generated__/gql.ts @@ -15,19 +15,23 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ */ type Documents = { '\n query GetAccounts(\n $limit: Int\n $offset: Int\n $orderBy: [AccountOrderByInput!]\n ) {\n accounts(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n free\n frozen\n reserved\n }\n meta: accountsConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetAccountsDocument; - '\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ': typeof types.GetAccountByIdDocument; + '\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n minerRewards: minerRewardsConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { miner: { id_eq: $id } }\n ) {\n edges {\n node {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n\n totalCount\n }\n }\n ': typeof types.GetAccountByIdDocument; '\n query GetAccountsStats($startDate: DateTime!, $endDate: DateTime!) {\n all: accountsConnection(orderBy: id_ASC) {\n totalCount\n }\n recentlyActive: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n recentlyDeposited: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ': typeof types.GetAccountsStatsDocument; - '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetBlocksDocument; - '\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n timestamp\n }\n }\n ': typeof types.GetRecentBlocksDocument; - '\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n timestamp\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ': typeof types.GetBlockByIdDocument; - '\n query GetStatus($beginningDate: DateTime!, $endDate: DateTime!) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ': typeof types.GetStatusDocument; - '\n query GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetReversibleTransactionsDocument; + '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n reward\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetBlocksDocument; + '\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n reward\n timestamp\n }\n }\n ': typeof types.GetRecentBlocksDocument; + '\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n reward\n timestamp\n }\n miners: minerRewards(\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n miner {\n id\n }\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ': typeof types.GetBlockByIdDocument; + '\n query GetStatus(\n $beginningDate: DateTime!\n $todayDate: DateTime!\n $endDate: DateTime!\n ) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n minedBlocks24Hours: blocksConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $todayDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ': typeof types.GetStatusDocument; + '\n query GetMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n meta: minerRewardsConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ': typeof types.GetMinerRewardsDocument; + '\n query GetRecentMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ': typeof types.GetRecentMinerRewardsDocument; + '\n query GetMinerRewardsStats($startDate: DateTime!, $endDate: DateTime!) {\n last24Hour: minerRewardsConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $startDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allTime: minerRewardsConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetMinerRewardsStatsDocument; + '\n query GetMinerRewardByHash($hash: String!) {\n minerRewards(where: { block: { hash_eq: $hash } }) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ': typeof types.GetMinerRewardByHashDocument; + '\n query GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ': typeof types.GetReversibleTransactionsDocument; '\n query GetRecentReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': typeof types.GetRecentReversibleTransactionsDocument; '\n query GetReversibleTransactionsStats(\n $startDate: DateTime!\n $endDate: DateTime!\n ) {\n last24Hour: reversibleTransfersConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $startDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allTime: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetReversibleTransactionsStatsDocument; '\n query GetReversibleTransactionByHash($hash: String!) {\n reversibleTransactions: reversibleTransfers(\n where: { extrinsicHash_eq: $hash }\n ) {\n fee\n amount\n extrinsicHash\n txId\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': typeof types.GetReversibleTransactionByHashDocument; '\n query GetReversibleTransactionStatusByHash($hash: String!) {\n reversibleTransactions: reversibleTransfers(\n where: { extrinsicHash_eq: $hash }\n ) {\n status\n }\n }\n ': typeof types.GetReversibleTransactionStatusByHashDocument; - '\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n }\n ': typeof types.SearchAllDocument; - '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': typeof types.GetTransactionsDocument; + '\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n minerRewards(\n limit: $limit\n where: { block: { hash_startsWith: $keyword } }\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ': typeof types.SearchAllDocument; + '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ': typeof types.GetTransactionsDocument; '\n query GetRecentTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': typeof types.GetRecentTransactionsDocument; '\n query GetTransactionsStats($startDate: DateTime!, $endDate: DateTime!) {\n last24Hour: transfersConnection(\n orderBy: id_ASC\n where: {\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n extrinsicHash_isNull: false\n }\n ) {\n totalCount\n }\n allTime: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n }\n ': typeof types.GetTransactionsStatsDocument; '\n query GetTransactionByHash($hash: String!) {\n transactions: transfers(where: { extrinsicHash_eq: $hash }) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': typeof types.GetTransactionByHashDocument; @@ -35,19 +39,27 @@ type Documents = { const documents: Documents = { '\n query GetAccounts(\n $limit: Int\n $offset: Int\n $orderBy: [AccountOrderByInput!]\n ) {\n accounts(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n free\n frozen\n reserved\n }\n meta: accountsConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': types.GetAccountsDocument, - '\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ': + '\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n minerRewards: minerRewardsConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { miner: { id_eq: $id } }\n ) {\n edges {\n node {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n\n totalCount\n }\n }\n ': types.GetAccountByIdDocument, '\n query GetAccountsStats($startDate: DateTime!, $endDate: DateTime!) {\n all: accountsConnection(orderBy: id_ASC) {\n totalCount\n }\n recentlyActive: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n recentlyDeposited: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $startDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ': types.GetAccountsStatsDocument, - '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': + '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n reward\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': types.GetBlocksDocument, - '\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n timestamp\n }\n }\n ': + '\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n reward\n timestamp\n }\n }\n ': types.GetRecentBlocksDocument, - '\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n timestamp\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ': + '\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n reward\n timestamp\n }\n miners: minerRewards(\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n miner {\n id\n }\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ': types.GetBlockByIdDocument, - '\n query GetStatus($beginningDate: DateTime!, $endDate: DateTime!) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ': + '\n query GetStatus(\n $beginningDate: DateTime!\n $todayDate: DateTime!\n $endDate: DateTime!\n ) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n minedBlocks24Hours: blocksConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $todayDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ': types.GetStatusDocument, - '\n query GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': + '\n query GetMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n meta: minerRewardsConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ': + types.GetMinerRewardsDocument, + '\n query GetRecentMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ': + types.GetRecentMinerRewardsDocument, + '\n query GetMinerRewardsStats($startDate: DateTime!, $endDate: DateTime!) {\n last24Hour: minerRewardsConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $startDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allTime: minerRewardsConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': + types.GetMinerRewardsStatsDocument, + '\n query GetMinerRewardByHash($hash: String!) {\n minerRewards(where: { block: { hash_eq: $hash } }) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ': + types.GetMinerRewardByHashDocument, + '\n query GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ': types.GetReversibleTransactionsDocument, '\n query GetRecentReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': types.GetRecentReversibleTransactionsDocument, @@ -57,9 +69,9 @@ const documents: Documents = { types.GetReversibleTransactionByHashDocument, '\n query GetReversibleTransactionStatusByHash($hash: String!) {\n reversibleTransactions: reversibleTransfers(\n where: { extrinsicHash_eq: $hash }\n ) {\n status\n }\n }\n ': types.GetReversibleTransactionStatusByHashDocument, - '\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n }\n ': + '\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n minerRewards(\n limit: $limit\n where: { block: { hash_startsWith: $keyword } }\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ': types.SearchAllDocument, - '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ': + '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ': types.GetTransactionsDocument, '\n query GetRecentTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n ': types.GetRecentTransactionsDocument, @@ -93,8 +105,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 GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ' -): (typeof documents)['\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ']; + source: '\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n minerRewards: minerRewardsConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { miner: { id_eq: $id } }\n ) {\n edges {\n node {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetAccountById($id: String!, $limit: Int!) {\n account: accountById(id: $id) {\n id\n free\n frozen\n reserved\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { from: { id_eq: $id }, OR: { to: { id_eq: $id } } }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n minerRewards: minerRewardsConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: { miner: { id_eq: $id } }\n ) {\n edges {\n node {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n\n totalCount\n }\n }\n ']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -105,32 +117,56 @@ 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 GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ' -): (typeof documents)['\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ']; + source: '\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n reward\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]!\n $where: BlockWhereInput\n ) {\n blocks(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n id\n hash\n height\n reward\n timestamp\n }\n meta: blocksConnection(orderBy: id_ASC) {\n totalCount\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 GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n timestamp\n }\n }\n ' -): (typeof documents)['\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n timestamp\n }\n }\n ']; + source: '\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n reward\n timestamp\n }\n }\n ' +): (typeof documents)['\n query GetRecentBlocks(\n $limit: Int\n $offset: Int\n $orderBy: [BlockOrderByInput!]\n ) {\n blocks(limit: $limit, offset: $offset, orderBy: $orderBy) {\n id\n hash\n height\n reward\n timestamp\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 GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n timestamp\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ' -): (typeof documents)['\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n timestamp\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n scheduledAt\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ']; + source: '\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n reward\n timestamp\n }\n miners: minerRewards(\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n miner {\n id\n }\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetBlockById($height: Int!, $hash: String!, $limit: Int!) {\n blocks(where: { height_eq: $height, OR: { hash_eq: $hash } }) {\n id\n hash\n height\n reward\n timestamp\n }\n miners: minerRewards(\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n miner {\n id\n }\n }\n transactions: transfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n extrinsicHash_isNull: false\n AND: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n }\n ) {\n edges {\n node {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(\n orderBy: timestamp_DESC\n first: $limit\n where: {\n block: { height_eq: $height }\n OR: { block: { hash_eq: $hash } }\n }\n ) {\n edges {\n node {\n extrinsicHash\n timestamp\n status\n amount\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n }\n\n totalCount\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 GetStatus($beginningDate: DateTime!, $endDate: DateTime!) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ' -): (typeof documents)['\n query GetStatus($beginningDate: DateTime!, $endDate: DateTime!) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ']; + source: '\n query GetStatus(\n $beginningDate: DateTime!\n $todayDate: DateTime!\n $endDate: DateTime!\n ) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n minedBlocks24Hours: blocksConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $todayDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetStatus(\n $beginningDate: DateTime!\n $todayDate: DateTime!\n $endDate: DateTime!\n ) {\n transactions: transfersConnection(\n orderBy: id_ASC\n where: { extrinsicHash_isNull: false }\n ) {\n totalCount\n }\n reversibleTransactions: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n status: squidStatus {\n hash\n height\n finalizedHeight\n finalizedHash\n }\n minedBlocks24Hours: blocksConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $todayDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allActiveAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersFrom_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\n }\n allDepositAccounts: accountsConnection(\n orderBy: id_ASC\n where: {\n transfersTo_some: {\n timestamp_gte: $beginningDate\n timestamp_lte: $endDate\n }\n }\n ) {\n totalCount\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 GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ' -): (typeof documents)['\n query GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ']; + source: '\n query GetMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n meta: minerRewardsConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n meta: minerRewardsConnection(orderBy: id_ASC, where: $where) {\n totalCount\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 GetRecentMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ' +): (typeof documents)['\n query GetRecentMinerRewards(\n $limit: Int\n $offset: Int\n $orderBy: [MinerRewardOrderByInput!]\n $where: MinerRewardWhereInput\n ) {\n minerRewards(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\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 GetMinerRewardsStats($startDate: DateTime!, $endDate: DateTime!) {\n last24Hour: minerRewardsConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $startDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allTime: minerRewardsConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetMinerRewardsStats($startDate: DateTime!, $endDate: DateTime!) {\n last24Hour: minerRewardsConnection(\n orderBy: id_ASC\n where: { timestamp_gte: $startDate, timestamp_lte: $endDate }\n ) {\n totalCount\n }\n allTime: minerRewardsConnection(orderBy: id_ASC) {\n totalCount\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 GetMinerRewardByHash($hash: String!) {\n minerRewards(where: { block: { hash_eq: $hash } }) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ' +): (typeof documents)['\n query GetMinerRewardByHash($hash: String!) {\n minerRewards(where: { block: { hash_eq: $hash } }) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\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 GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetReversibleTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [ReversibleTransferOrderByInput!]\n $where: ReversibleTransferWhereInput\n ) {\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n extrinsicHash\n amount\n timestamp\n status\n block {\n height\n }\n from {\n id\n }\n to {\n id\n }\n }\n meta: reversibleTransfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ']; /** * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ @@ -159,14 +195,14 @@ 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 SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n }\n ' -): (typeof documents)['\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n }\n ']; + source: '\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n minerRewards(\n limit: $limit\n where: { block: { hash_startsWith: $keyword } }\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\n }\n }\n ' +): (typeof documents)['\n query SearchAll($keyword: String, $keyword_number: Int, $limit: Int) {\n transactions: transfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n reversibleTransactions: reversibleTransfers(\n limit: $limit\n where: { extrinsicHash_startsWith: $keyword }\n ) {\n extrinsicHash\n }\n accounts(limit: $limit, where: { id_startsWith: $keyword }) {\n id\n }\n blocks(\n limit: $limit\n where: {\n hash_startsWith: $keyword\n OR: { height_eq: $keyword_number }\n }\n ) {\n height\n }\n minerRewards(\n limit: $limit\n where: { block: { hash_startsWith: $keyword } }\n ) {\n block {\n height\n hash\n }\n reward\n miner {\n id\n }\n timestamp\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 GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ' -): (typeof documents)['\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC) {\n totalCount\n }\n }\n ']; + source: '\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\n }\n }\n ' +): (typeof documents)['\n query GetTransactions(\n $limit: Int\n $offset: Int\n $orderBy: [TransferOrderByInput!]\n $where: TransferWhereInput\n ) {\n transactions: transfers(\n limit: $limit\n offset: $offset\n orderBy: $orderBy\n where: $where\n ) {\n fee\n extrinsicHash\n block {\n height\n }\n amount\n timestamp\n from {\n id\n }\n to {\n id\n }\n }\n meta: transfersConnection(orderBy: id_ASC, where: $where) {\n totalCount\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 7a312fe..7179331 100644 --- a/src/__generated__/graphql.ts +++ b/src/__generated__/graphql.ts @@ -1001,6 +1001,88 @@ export type MinerRewardsConnection = { totalCount: Scalars['Int']['output']; }; +export type MinerStats = { + __typename?: 'MinerStats'; + /** Miner address */ + id: Scalars['String']['output']; + totalMinedBlocks: Scalars['Int']['output']; + totalRewards: Scalars['BigInt']['output']; +}; + +export type MinerStatsConnection = { + __typename?: 'MinerStatsConnection'; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + +export type MinerStatsEdge = { + __typename?: 'MinerStatsEdge'; + cursor: Scalars['String']['output']; + node: MinerStats; +}; + +export enum MinerStatsOrderByInput { + IdAsc = 'id_ASC', + IdAscNullsFirst = 'id_ASC_NULLS_FIRST', + IdAscNullsLast = 'id_ASC_NULLS_LAST', + IdDesc = 'id_DESC', + IdDescNullsFirst = 'id_DESC_NULLS_FIRST', + IdDescNullsLast = 'id_DESC_NULLS_LAST', + TotalMinedBlocksAsc = 'totalMinedBlocks_ASC', + TotalMinedBlocksAscNullsFirst = 'totalMinedBlocks_ASC_NULLS_FIRST', + TotalMinedBlocksAscNullsLast = 'totalMinedBlocks_ASC_NULLS_LAST', + TotalMinedBlocksDesc = 'totalMinedBlocks_DESC', + TotalMinedBlocksDescNullsFirst = 'totalMinedBlocks_DESC_NULLS_FIRST', + TotalMinedBlocksDescNullsLast = 'totalMinedBlocks_DESC_NULLS_LAST', + TotalRewardsAsc = 'totalRewards_ASC', + TotalRewardsAscNullsFirst = 'totalRewards_ASC_NULLS_FIRST', + TotalRewardsAscNullsLast = 'totalRewards_ASC_NULLS_LAST', + TotalRewardsDesc = 'totalRewards_DESC', + TotalRewardsDescNullsFirst = 'totalRewards_DESC_NULLS_FIRST', + TotalRewardsDescNullsLast = 'totalRewards_DESC_NULLS_LAST' +} + +export type MinerStatsWhereInput = { + AND?: InputMaybe>; + OR?: InputMaybe>; + id_contains?: InputMaybe; + id_containsInsensitive?: InputMaybe; + id_endsWith?: InputMaybe; + id_eq?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_isNull?: InputMaybe; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_containsInsensitive?: InputMaybe; + id_not_endsWith?: InputMaybe; + id_not_eq?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_startsWith?: InputMaybe; + id_startsWith?: InputMaybe; + totalMinedBlocks_eq?: InputMaybe; + totalMinedBlocks_gt?: InputMaybe; + totalMinedBlocks_gte?: InputMaybe; + totalMinedBlocks_in?: InputMaybe>; + totalMinedBlocks_isNull?: InputMaybe; + totalMinedBlocks_lt?: InputMaybe; + totalMinedBlocks_lte?: InputMaybe; + totalMinedBlocks_not_eq?: InputMaybe; + totalMinedBlocks_not_in?: InputMaybe>; + totalRewards_eq?: InputMaybe; + totalRewards_gt?: InputMaybe; + totalRewards_gte?: InputMaybe; + totalRewards_in?: InputMaybe>; + totalRewards_isNull?: InputMaybe; + totalRewards_lt?: InputMaybe; + totalRewards_lte?: InputMaybe; + totalRewards_not_eq?: InputMaybe; + totalRewards_not_in?: InputMaybe>; +}; + export type PageInfo = { __typename?: 'PageInfo'; endCursor: Scalars['String']['output']; @@ -1026,6 +1108,9 @@ export type Query = { minerRewardById?: Maybe; minerRewards: Array; minerRewardsConnection: MinerRewardsConnection; + minerStats: Array; + minerStatsById?: Maybe; + minerStatsConnection: MinerStatsConnection; reversibleTransferById?: Maybe; reversibleTransfers: Array; reversibleTransfersConnection: ReversibleTransfersConnection; @@ -1125,6 +1210,24 @@ export type QueryMinerRewardsConnectionArgs = { where?: InputMaybe; }; +export type QueryMinerStatsArgs = { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +}; + +export type QueryMinerStatsByIdArgs = { + id: Scalars['String']['input']; +}; + +export type QueryMinerStatsConnectionArgs = { + after?: InputMaybe; + first?: InputMaybe; + orderBy: Array; + where?: InputMaybe; +}; + export type QueryReversibleTransferByIdArgs = { id: Scalars['String']['input']; }; @@ -1166,6 +1269,7 @@ export type ReversibleTransfer = { amount: Scalars['BigInt']['output']; block: Block; event?: Maybe; + executedTransfer?: Maybe; extrinsicHash?: Maybe; fee: Scalars['BigInt']['output']; from: Account; @@ -1250,6 +1354,36 @@ export enum ReversibleTransferOrderByInput { EventTypeDesc = 'event_type_DESC', EventTypeDescNullsFirst = 'event_type_DESC_NULLS_FIRST', EventTypeDescNullsLast = 'event_type_DESC_NULLS_LAST', + ExecutedTransferAmountAsc = 'executedTransfer_amount_ASC', + ExecutedTransferAmountAscNullsFirst = 'executedTransfer_amount_ASC_NULLS_FIRST', + ExecutedTransferAmountAscNullsLast = 'executedTransfer_amount_ASC_NULLS_LAST', + ExecutedTransferAmountDesc = 'executedTransfer_amount_DESC', + ExecutedTransferAmountDescNullsFirst = 'executedTransfer_amount_DESC_NULLS_FIRST', + ExecutedTransferAmountDescNullsLast = 'executedTransfer_amount_DESC_NULLS_LAST', + ExecutedTransferExtrinsicHashAsc = 'executedTransfer_extrinsicHash_ASC', + ExecutedTransferExtrinsicHashAscNullsFirst = 'executedTransfer_extrinsicHash_ASC_NULLS_FIRST', + ExecutedTransferExtrinsicHashAscNullsLast = 'executedTransfer_extrinsicHash_ASC_NULLS_LAST', + ExecutedTransferExtrinsicHashDesc = 'executedTransfer_extrinsicHash_DESC', + ExecutedTransferExtrinsicHashDescNullsFirst = 'executedTransfer_extrinsicHash_DESC_NULLS_FIRST', + ExecutedTransferExtrinsicHashDescNullsLast = 'executedTransfer_extrinsicHash_DESC_NULLS_LAST', + ExecutedTransferFeeAsc = 'executedTransfer_fee_ASC', + ExecutedTransferFeeAscNullsFirst = 'executedTransfer_fee_ASC_NULLS_FIRST', + ExecutedTransferFeeAscNullsLast = 'executedTransfer_fee_ASC_NULLS_LAST', + ExecutedTransferFeeDesc = 'executedTransfer_fee_DESC', + ExecutedTransferFeeDescNullsFirst = 'executedTransfer_fee_DESC_NULLS_FIRST', + ExecutedTransferFeeDescNullsLast = 'executedTransfer_fee_DESC_NULLS_LAST', + ExecutedTransferIdAsc = 'executedTransfer_id_ASC', + ExecutedTransferIdAscNullsFirst = 'executedTransfer_id_ASC_NULLS_FIRST', + ExecutedTransferIdAscNullsLast = 'executedTransfer_id_ASC_NULLS_LAST', + ExecutedTransferIdDesc = 'executedTransfer_id_DESC', + ExecutedTransferIdDescNullsFirst = 'executedTransfer_id_DESC_NULLS_FIRST', + ExecutedTransferIdDescNullsLast = 'executedTransfer_id_DESC_NULLS_LAST', + ExecutedTransferTimestampAsc = 'executedTransfer_timestamp_ASC', + ExecutedTransferTimestampAscNullsFirst = 'executedTransfer_timestamp_ASC_NULLS_FIRST', + ExecutedTransferTimestampAscNullsLast = 'executedTransfer_timestamp_ASC_NULLS_LAST', + ExecutedTransferTimestampDesc = 'executedTransfer_timestamp_DESC', + ExecutedTransferTimestampDescNullsFirst = 'executedTransfer_timestamp_DESC_NULLS_FIRST', + ExecutedTransferTimestampDescNullsLast = 'executedTransfer_timestamp_DESC_NULLS_LAST', ExtrinsicHashAsc = 'extrinsicHash_ASC', ExtrinsicHashAscNullsFirst = 'extrinsicHash_ASC_NULLS_FIRST', ExtrinsicHashAscNullsLast = 'extrinsicHash_ASC_NULLS_LAST', @@ -1376,6 +1510,8 @@ export type ReversibleTransferWhereInput = { block_isNull?: InputMaybe; event?: InputMaybe; event_isNull?: InputMaybe; + executedTransfer?: InputMaybe; + executedTransfer_isNull?: InputMaybe; extrinsicHash_contains?: InputMaybe; extrinsicHash_containsInsensitive?: InputMaybe; extrinsicHash_endsWith?: InputMaybe; @@ -1491,6 +1627,7 @@ export type Transfer = { amount: Scalars['BigInt']['output']; block: Block; event?: Maybe; + executedBy?: Maybe; extrinsicHash?: Maybe; fee: Scalars['BigInt']['output']; from: Account; @@ -1572,6 +1709,54 @@ export enum TransferOrderByInput { EventTypeDesc = 'event_type_DESC', EventTypeDescNullsFirst = 'event_type_DESC_NULLS_FIRST', EventTypeDescNullsLast = 'event_type_DESC_NULLS_LAST', + ExecutedByAmountAsc = 'executedBy_amount_ASC', + ExecutedByAmountAscNullsFirst = 'executedBy_amount_ASC_NULLS_FIRST', + ExecutedByAmountAscNullsLast = 'executedBy_amount_ASC_NULLS_LAST', + ExecutedByAmountDesc = 'executedBy_amount_DESC', + ExecutedByAmountDescNullsFirst = 'executedBy_amount_DESC_NULLS_FIRST', + ExecutedByAmountDescNullsLast = 'executedBy_amount_DESC_NULLS_LAST', + ExecutedByExtrinsicHashAsc = 'executedBy_extrinsicHash_ASC', + ExecutedByExtrinsicHashAscNullsFirst = 'executedBy_extrinsicHash_ASC_NULLS_FIRST', + ExecutedByExtrinsicHashAscNullsLast = 'executedBy_extrinsicHash_ASC_NULLS_LAST', + ExecutedByExtrinsicHashDesc = 'executedBy_extrinsicHash_DESC', + ExecutedByExtrinsicHashDescNullsFirst = 'executedBy_extrinsicHash_DESC_NULLS_FIRST', + ExecutedByExtrinsicHashDescNullsLast = 'executedBy_extrinsicHash_DESC_NULLS_LAST', + ExecutedByFeeAsc = 'executedBy_fee_ASC', + ExecutedByFeeAscNullsFirst = 'executedBy_fee_ASC_NULLS_FIRST', + ExecutedByFeeAscNullsLast = 'executedBy_fee_ASC_NULLS_LAST', + ExecutedByFeeDesc = 'executedBy_fee_DESC', + ExecutedByFeeDescNullsFirst = 'executedBy_fee_DESC_NULLS_FIRST', + ExecutedByFeeDescNullsLast = 'executedBy_fee_DESC_NULLS_LAST', + ExecutedByIdAsc = 'executedBy_id_ASC', + ExecutedByIdAscNullsFirst = 'executedBy_id_ASC_NULLS_FIRST', + ExecutedByIdAscNullsLast = 'executedBy_id_ASC_NULLS_LAST', + ExecutedByIdDesc = 'executedBy_id_DESC', + ExecutedByIdDescNullsFirst = 'executedBy_id_DESC_NULLS_FIRST', + ExecutedByIdDescNullsLast = 'executedBy_id_DESC_NULLS_LAST', + ExecutedByScheduledAtAsc = 'executedBy_scheduledAt_ASC', + ExecutedByScheduledAtAscNullsFirst = 'executedBy_scheduledAt_ASC_NULLS_FIRST', + ExecutedByScheduledAtAscNullsLast = 'executedBy_scheduledAt_ASC_NULLS_LAST', + ExecutedByScheduledAtDesc = 'executedBy_scheduledAt_DESC', + ExecutedByScheduledAtDescNullsFirst = 'executedBy_scheduledAt_DESC_NULLS_FIRST', + ExecutedByScheduledAtDescNullsLast = 'executedBy_scheduledAt_DESC_NULLS_LAST', + ExecutedByStatusAsc = 'executedBy_status_ASC', + ExecutedByStatusAscNullsFirst = 'executedBy_status_ASC_NULLS_FIRST', + ExecutedByStatusAscNullsLast = 'executedBy_status_ASC_NULLS_LAST', + ExecutedByStatusDesc = 'executedBy_status_DESC', + ExecutedByStatusDescNullsFirst = 'executedBy_status_DESC_NULLS_FIRST', + ExecutedByStatusDescNullsLast = 'executedBy_status_DESC_NULLS_LAST', + ExecutedByTimestampAsc = 'executedBy_timestamp_ASC', + ExecutedByTimestampAscNullsFirst = 'executedBy_timestamp_ASC_NULLS_FIRST', + ExecutedByTimestampAscNullsLast = 'executedBy_timestamp_ASC_NULLS_LAST', + ExecutedByTimestampDesc = 'executedBy_timestamp_DESC', + ExecutedByTimestampDescNullsFirst = 'executedBy_timestamp_DESC_NULLS_FIRST', + ExecutedByTimestampDescNullsLast = 'executedBy_timestamp_DESC_NULLS_LAST', + ExecutedByTxIdAsc = 'executedBy_txId_ASC', + ExecutedByTxIdAscNullsFirst = 'executedBy_txId_ASC_NULLS_FIRST', + ExecutedByTxIdAscNullsLast = 'executedBy_txId_ASC_NULLS_LAST', + ExecutedByTxIdDesc = 'executedBy_txId_DESC', + ExecutedByTxIdDescNullsFirst = 'executedBy_txId_DESC_NULLS_FIRST', + ExecutedByTxIdDescNullsLast = 'executedBy_txId_DESC_NULLS_LAST', ExtrinsicHashAsc = 'extrinsicHash_ASC', ExtrinsicHashAscNullsFirst = 'extrinsicHash_ASC_NULLS_FIRST', ExtrinsicHashAscNullsLast = 'extrinsicHash_ASC_NULLS_LAST', @@ -1674,6 +1859,8 @@ export type TransferWhereInput = { block_isNull?: InputMaybe; event?: InputMaybe; event_isNull?: InputMaybe; + executedBy?: InputMaybe; + executedBy_isNull?: InputMaybe; extrinsicHash_contains?: InputMaybe; extrinsicHash_containsInsensitive?: InputMaybe; extrinsicHash_endsWith?: InputMaybe; @@ -1798,15 +1985,29 @@ export type GetAccountByIdQuery = { node: { __typename?: 'ReversibleTransfer'; extrinsicHash?: string | null; - scheduledAt: any; timestamp: any; status: ReversibleTransferStatus; + amount: any; block: { __typename?: 'Block'; height: number }; from: { __typename?: 'Account'; id: string }; to: { __typename?: 'Account'; id: string }; }; }>; }; + minerRewards: { + __typename?: 'MinerRewardsConnection'; + totalCount: number; + edges: Array<{ + __typename?: 'MinerRewardEdge'; + node: { + __typename?: 'MinerReward'; + reward: any; + timestamp: any; + block: { __typename?: 'Block'; height: number; hash: string }; + miner: { __typename?: 'Account'; id: string }; + }; + }>; + }; }; export type GetAccountsStatsQueryVariables = Exact<{ @@ -1835,6 +2036,7 @@ export type GetBlocksQuery = { id: string; hash: string; height: number; + reward: any; timestamp: any; }>; meta: { __typename?: 'BlocksConnection'; totalCount: number }; @@ -1853,6 +2055,7 @@ export type GetRecentBlocksQuery = { id: string; hash: string; height: number; + reward: any; timestamp: any; }>; }; @@ -1870,8 +2073,13 @@ export type GetBlockByIdQuery = { id: string; hash: string; height: number; + reward: any; timestamp: any; }>; + miners: Array<{ + __typename?: 'MinerReward'; + miner: { __typename?: 'Account'; id: string }; + }>; transactions: { __typename?: 'TransfersConnection'; totalCount: number; @@ -1897,9 +2105,9 @@ export type GetBlockByIdQuery = { node: { __typename?: 'ReversibleTransfer'; extrinsicHash?: string | null; - scheduledAt: any; timestamp: any; status: ReversibleTransferStatus; + amount: any; block: { __typename?: 'Block'; height: number }; from: { __typename?: 'Account'; id: string }; to: { __typename?: 'Account'; id: string }; @@ -1910,6 +2118,7 @@ export type GetBlockByIdQuery = { export type GetStatusQueryVariables = Exact<{ beginningDate: Scalars['DateTime']['input']; + todayDate: Scalars['DateTime']['input']; endDate: Scalars['DateTime']['input']; }>; @@ -1927,10 +2136,78 @@ export type GetStatusQuery = { finalizedHeight?: number | null; finalizedHash?: string | null; } | null; + minedBlocks24Hours: { __typename?: 'BlocksConnection'; totalCount: number }; allActiveAccounts: { __typename?: 'AccountsConnection'; totalCount: number }; allDepositAccounts: { __typename?: 'AccountsConnection'; totalCount: number }; }; +export type GetMinerRewardsQueryVariables = Exact<{ + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe< + Array | MinerRewardOrderByInput + >; + where?: InputMaybe; +}>; + +export type GetMinerRewardsQuery = { + __typename?: 'Query'; + minerRewards: Array<{ + __typename?: 'MinerReward'; + reward: any; + timestamp: any; + block: { __typename?: 'Block'; height: number; hash: string }; + miner: { __typename?: 'Account'; id: string }; + }>; + meta: { __typename?: 'MinerRewardsConnection'; totalCount: number }; +}; + +export type GetRecentMinerRewardsQueryVariables = Exact<{ + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe< + Array | MinerRewardOrderByInput + >; + where?: InputMaybe; +}>; + +export type GetRecentMinerRewardsQuery = { + __typename?: 'Query'; + minerRewards: Array<{ + __typename?: 'MinerReward'; + reward: any; + timestamp: any; + block: { __typename?: 'Block'; height: number; hash: string }; + miner: { __typename?: 'Account'; id: string }; + }>; +}; + +export type GetMinerRewardsStatsQueryVariables = Exact<{ + startDate: Scalars['DateTime']['input']; + endDate: Scalars['DateTime']['input']; +}>; + +export type GetMinerRewardsStatsQuery = { + __typename?: 'Query'; + last24Hour: { __typename?: 'MinerRewardsConnection'; totalCount: number }; + allTime: { __typename?: 'MinerRewardsConnection'; totalCount: number }; +}; + +export type GetMinerRewardByHashQueryVariables = Exact<{ + hash: Scalars['String']['input']; +}>; + +export type GetMinerRewardByHashQuery = { + __typename?: 'Query'; + minerRewards: Array<{ + __typename?: 'MinerReward'; + reward: any; + timestamp: any; + block: { __typename?: 'Block'; height: number; hash: string }; + miner: { __typename?: 'Account'; id: string }; + }>; +}; + export type GetReversibleTransactionsQueryVariables = Exact<{ limit?: InputMaybe; offset?: InputMaybe; @@ -2042,6 +2319,13 @@ export type SearchAllQuery = { }>; accounts: Array<{ __typename?: 'Account'; id: string }>; blocks: Array<{ __typename?: 'Block'; height: number }>; + minerRewards: Array<{ + __typename?: 'MinerReward'; + reward: any; + timestamp: any; + block: { __typename?: 'Block'; height: number; hash: string }; + miner: { __typename?: 'Account'; id: string }; + }>; }; export type GetTransactionsQueryVariables = Exact<{ @@ -2532,15 +2816,15 @@ export const GetAccountByIdDocument = { }, { kind: 'Field', - name: { kind: 'Name', value: 'scheduledAt' } + name: { kind: 'Name', value: 'timestamp' } }, { kind: 'Field', - name: { kind: 'Name', value: 'timestamp' } + name: { kind: 'Name', value: 'status' } }, { kind: 'Field', - name: { kind: 'Name', value: 'status' } + name: { kind: 'Name', value: 'amount' } }, { kind: 'Field', @@ -2590,6 +2874,114 @@ export const GetAccountByIdDocument = { { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } ] } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'minerRewards' }, + name: { kind: 'Name', value: 'minerRewardsConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'timestamp_DESC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'miner' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'id_eq' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'id' } + } + } + ] + } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'edges' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'node' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'block' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'height' } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'hash' } + } + ] + } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'reward' } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'miner' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'id' } + } + ] + } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'timestamp' } + } + ] + } + } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } } ] } @@ -2868,6 +3260,7 @@ export const GetBlocksDocument = { { 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' } } ] } @@ -2975,6 +3368,7 @@ export const GetRecentBlocksDocument = { { 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' } } ] } @@ -3074,28 +3468,16 @@ export const GetBlockByIdDocument = { { 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', - alias: { kind: 'Name', value: 'transactions' }, - name: { kind: 'Name', value: 'transfersConnection' }, + alias: { kind: 'Name', value: 'miners' }, + name: { kind: 'Name', value: 'minerRewards' }, arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'orderBy' }, - value: { kind: 'EnumValue', value: 'timestamp_DESC' } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'first' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'limit' } - } - }, { kind: 'Argument', name: { kind: 'Name', value: 'where' }, @@ -3104,12 +3486,24 @@ export const GetBlockByIdDocument = { fields: [ { kind: 'ObjectField', - name: { kind: 'Name', value: 'extrinsicHash_isNull' }, - value: { kind: 'BooleanValue', value: false } + name: { kind: 'Name', value: 'block' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'height_eq' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'height' } + } + } + ] + } }, { kind: 'ObjectField', - name: { kind: 'Name', value: 'AND' }, + name: { kind: 'Name', value: 'OR' }, value: { kind: 'ObjectValue', fields: [ @@ -3121,27 +3515,102 @@ export const GetBlockByIdDocument = { fields: [ { kind: 'ObjectField', - name: { kind: 'Name', value: 'height_eq' }, + name: { kind: 'Name', value: 'hash_eq' }, value: { kind: 'Variable', - name: { kind: 'Name', value: 'height' } + name: { kind: 'Name', value: 'hash' } } } ] } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'OR' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'block' }, - value: { - kind: 'ObjectValue', - fields: [ + } + ] + } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'miner' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'transactions' }, + name: { kind: 'Name', value: 'transfersConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'timestamp_DESC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'extrinsicHash_isNull' }, + value: { kind: 'BooleanValue', value: false } + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'AND' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'block' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'height_eq' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'height' } + } + } + ] + } + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'OR' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'block' }, + value: { + kind: 'ObjectValue', + fields: [ { kind: 'ObjectField', name: { @@ -3338,15 +3807,15 @@ export const GetBlockByIdDocument = { }, { kind: 'Field', - name: { kind: 'Name', value: 'scheduledAt' } + name: { kind: 'Name', value: 'timestamp' } }, { kind: 'Field', - name: { kind: 'Name', value: 'timestamp' } + name: { kind: 'Name', value: 'status' } }, { kind: 'Field', - name: { kind: 'Name', value: 'status' } + name: { kind: 'Name', value: 'amount' } }, { kind: 'Field', @@ -3393,7 +3862,572 @@ export const GetBlockByIdDocument = { ] } }, - { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode; +export const GetStatusDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetStatus' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'beginningDate' } + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'DateTime' } + } + } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'todayDate' } + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'DateTime' } + } + } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'endDate' } + }, + type: { + kind: 'NonNullType', + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'DateTime' } + } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + alias: { kind: 'Name', value: 'transactions' }, + name: { kind: 'Name', value: 'transfersConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'extrinsicHash_isNull' }, + value: { kind: 'BooleanValue', value: false } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'reversibleTransactions' }, + name: { kind: 'Name', value: 'reversibleTransfersConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'id_ASC' } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'status' }, + name: { kind: 'Name', value: 'squidStatus' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, + { kind: 'Field', name: { kind: 'Name', value: 'height' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'finalizedHeight' } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'finalizedHash' } + } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'minedBlocks24Hours' }, + name: { kind: 'Name', value: 'blocksConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_gte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'todayDate' } + } + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_lte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'endDate' } + } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'allActiveAccounts' }, + name: { kind: 'Name', value: 'accountsConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'transfersFrom_some' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_gte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'beginningDate' } + } + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_lte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'endDate' } + } + } + ] + } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'allDepositAccounts' }, + name: { kind: 'Name', value: 'accountsConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'transfersTo_some' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_gte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'beginningDate' } + } + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_lte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'endDate' } + } + } + ] + } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode; +export const GetMinerRewardsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMinerRewards' }, + 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: 'MinerRewardOrderByInput' } + } + } + } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'where' } + }, + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'MinerRewardWhereInput' } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'minerRewards' }, + 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: 'orderBy' }, + 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: 'block' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'height' } + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'reward' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'miner' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'timestamp' } } + ] + } + }, + { + kind: 'Field', + alias: { kind: 'Name', value: 'meta' }, + name: { kind: 'Name', value: 'minerRewardsConnection' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'orderBy' }, + value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + 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: 'totalCount' } } + ] + } + } + ] + } + } + ] +} as unknown as DocumentNode< + GetMinerRewardsQuery, + GetMinerRewardsQueryVariables +>; +export const GetRecentMinerRewardsDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetRecentMinerRewards' }, + 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: 'MinerRewardOrderByInput' } + } + } + } + }, + { + kind: 'VariableDefinition', + variable: { + kind: 'Variable', + name: { kind: 'Name', value: 'where' } + }, + type: { + kind: 'NamedType', + name: { kind: 'Name', value: 'MinerRewardWhereInput' } + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'minerRewards' }, + 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: 'orderBy' }, + 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: 'block' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'height' } + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'reward' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'miner' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'timestamp' } } ] } } @@ -3401,20 +4435,23 @@ export const GetBlockByIdDocument = { } } ] -} as unknown as DocumentNode; -export const GetStatusDocument = { +} as unknown as DocumentNode< + GetRecentMinerRewardsQuery, + GetRecentMinerRewardsQueryVariables +>; +export const GetMinerRewardsStatsDocument = { kind: 'Document', definitions: [ { kind: 'OperationDefinition', operation: 'query', - name: { kind: 'Name', value: 'GetStatus' }, + name: { kind: 'Name', value: 'GetMinerRewardsStats' }, variableDefinitions: [ { kind: 'VariableDefinition', variable: { kind: 'Variable', - name: { kind: 'Name', value: 'beginningDate' } + name: { kind: 'Name', value: 'startDate' } }, type: { kind: 'NonNullType', @@ -3444,8 +4481,8 @@ export const GetStatusDocument = { selections: [ { kind: 'Field', - alias: { kind: 'Name', value: 'transactions' }, - name: { kind: 'Name', value: 'transfersConnection' }, + alias: { kind: 'Name', value: 'last24Hour' }, + name: { kind: 'Name', value: 'minerRewardsConnection' }, arguments: [ { kind: 'Argument', @@ -3460,8 +4497,19 @@ export const GetStatusDocument = { fields: [ { kind: 'ObjectField', - name: { kind: 'Name', value: 'extrinsicHash_isNull' }, - value: { kind: 'BooleanValue', value: false } + name: { kind: 'Name', value: 'timestamp_gte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'startDate' } + } + }, + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'timestamp_lte' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'endDate' } + } } ] } @@ -3476,85 +4524,13 @@ export const GetStatusDocument = { }, { kind: 'Field', - alias: { kind: 'Name', value: 'reversibleTransactions' }, - name: { kind: 'Name', value: 'reversibleTransfersConnection' }, - arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'orderBy' }, - value: { kind: 'EnumValue', value: 'id_ASC' } - } - ], - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'status' }, - name: { kind: 'Name', value: 'squidStatus' }, - selectionSet: { - kind: 'SelectionSet', - selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'hash' } }, - { kind: 'Field', name: { kind: 'Name', value: 'height' } }, - { - kind: 'Field', - name: { kind: 'Name', value: 'finalizedHeight' } - }, - { - kind: 'Field', - name: { kind: 'Name', value: 'finalizedHash' } - } - ] - } - }, - { - kind: 'Field', - alias: { kind: 'Name', value: 'allActiveAccounts' }, - name: { kind: 'Name', value: 'accountsConnection' }, + alias: { kind: 'Name', value: 'allTime' }, + name: { kind: 'Name', value: 'minerRewardsConnection' }, arguments: [ { kind: 'Argument', name: { kind: 'Name', value: 'orderBy' }, value: { kind: 'EnumValue', value: 'id_ASC' } - }, - { - kind: 'Argument', - name: { kind: 'Name', value: 'where' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'transfersFrom_some' }, - value: { - kind: 'ObjectValue', - fields: [ - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'timestamp_gte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'beginningDate' } - } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'timestamp_lte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'endDate' } - } - } - ] - } - } - ] - } } ], selectionSet: { @@ -3563,17 +4539,39 @@ export const GetStatusDocument = { { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } ] } - }, + } + ] + } + } + ] +} as unknown as DocumentNode< + GetMinerRewardsStatsQuery, + GetMinerRewardsStatsQueryVariables +>; +export const GetMinerRewardByHashDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'GetMinerRewardByHash' }, + variableDefinitions: [ + { + 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: 'allDepositAccounts' }, - name: { kind: 'Name', value: 'accountsConnection' }, + name: { kind: 'Name', value: 'minerRewards' }, arguments: [ - { - kind: 'Argument', - name: { kind: 'Name', value: 'orderBy' }, - value: { kind: 'EnumValue', value: 'id_ASC' } - }, { kind: 'Argument', name: { kind: 'Name', value: 'where' }, @@ -3582,24 +4580,16 @@ export const GetStatusDocument = { fields: [ { kind: 'ObjectField', - name: { kind: 'Name', value: 'transfersTo_some' }, + name: { kind: 'Name', value: 'block' }, value: { kind: 'ObjectValue', fields: [ { kind: 'ObjectField', - name: { kind: 'Name', value: 'timestamp_gte' }, - value: { - kind: 'Variable', - name: { kind: 'Name', value: 'beginningDate' } - } - }, - { - kind: 'ObjectField', - name: { kind: 'Name', value: 'timestamp_lte' }, + name: { kind: 'Name', value: 'hash_eq' }, value: { kind: 'Variable', - name: { kind: 'Name', value: 'endDate' } + name: { kind: 'Name', value: 'hash' } } } ] @@ -3612,7 +4602,32 @@ export const GetStatusDocument = { selectionSet: { kind: 'SelectionSet', selections: [ - { kind: 'Field', name: { kind: 'Name', value: 'totalCount' } } + { + kind: 'Field', + name: { kind: 'Name', value: 'block' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'height' } + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'reward' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'miner' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'timestamp' } } ] } } @@ -3620,7 +4635,10 @@ export const GetStatusDocument = { } } ] -} as unknown as DocumentNode; +} as unknown as DocumentNode< + GetMinerRewardByHashQuery, + GetMinerRewardByHashQueryVariables +>; export const GetReversibleTransactionsDocument = { kind: 'Document', definitions: [ @@ -3767,6 +4785,14 @@ export const GetReversibleTransactionsDocument = { kind: 'Argument', name: { kind: 'Name', value: 'orderBy' }, value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'where' } + } } ], selectionSet: { @@ -4382,6 +5408,77 @@ export const SearchAllDocument = { { kind: 'Field', name: { kind: 'Name', value: 'height' } } ] } + }, + { + kind: 'Field', + name: { kind: 'Name', value: 'minerRewards' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'limit' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'limit' } + } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'block' }, + value: { + kind: 'ObjectValue', + fields: [ + { + kind: 'ObjectField', + name: { kind: 'Name', value: 'hash_startsWith' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'keyword' } + } + } + ] + } + } + ] + } + } + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'block' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'height' } + }, + { kind: 'Field', name: { kind: 'Name', value: 'hash' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'reward' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'miner' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } } + ] + } + }, + { kind: 'Field', name: { kind: 'Name', value: 'timestamp' } } + ] + } } ] } @@ -4534,6 +5631,14 @@ export const GetTransactionsDocument = { kind: 'Argument', name: { kind: 'Name', value: 'orderBy' }, value: { kind: 'EnumValue', value: 'id_ASC' } + }, + { + kind: 'Argument', + name: { kind: 'Name', value: 'where' }, + value: { + kind: 'Variable', + name: { kind: 'Name', value: 'where' } + } } ], selectionSet: { diff --git a/src/api/index.ts b/src/api/index.ts index e9c1df7..6c8e33b 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,6 +1,7 @@ import { accounts } from './accounts'; import { blocks } from './blocks'; import { chainStatus } from './chain-status'; +import { minerLeaderboard } from './miner-leaderboard'; import { minerRewards } from './miner-rewards'; import { reversibleTransactions } from './reversible-transactions'; import { search } from './search'; @@ -13,7 +14,8 @@ const api = { reversibleTransactions, search, blocks, - minerRewards + minerRewards, + minerLeaderboard }; export default api; diff --git a/src/api/miner-leaderboard.tsx b/src/api/miner-leaderboard.tsx new file mode 100644 index 0000000..28a11be --- /dev/null +++ b/src/api/miner-leaderboard.tsx @@ -0,0 +1,40 @@ +import type { QueryHookOptions } from '@apollo/client'; +import { gql, useQuery } from '@apollo/client'; + +import { QUERY_DEFAULT_LIMIT } from '@/constants/query-default-limit'; +import type { MinerLeaderboardResponse } from '@/schemas'; +import type { PaginatedQueryVariables } from '@/types/query'; + +export const minerLeaderboard = { + useGetAll: ( + config?: QueryHookOptions + ) => { + const GET_MINER_LEADERBOARD = gql` + query GetMinerLeaderboard($limit: Int, $offset: Int) { + leaderboardEntries: minerStats( + limit: $limit + offset: $offset + orderBy: totalMinedBlocks_DESC + ) { + id + totalMinedBlocks + totalRewards + } + meta: minerStatsConnection(orderBy: id_ASC) { + totalCount + } + } + `; + + return useQuery( + GET_MINER_LEADERBOARD, + { + ...config, + variables: { + limit: config?.variables?.limit ?? QUERY_DEFAULT_LIMIT, + offset: config?.variables?.offset ?? 0 + } + } + ); + } +}; diff --git a/src/components/common/table-columns/MINER_LEADERBOARD_COLUMNS.tsx b/src/components/common/table-columns/MINER_LEADERBOARD_COLUMNS.tsx new file mode 100644 index 0000000..048127d --- /dev/null +++ b/src/components/common/table-columns/MINER_LEADERBOARD_COLUMNS.tsx @@ -0,0 +1,34 @@ +import { createColumnHelper } from '@tanstack/react-table'; + +import { LinkWithCopy } from '@/components/ui/composites/link-with-copy/LinkWithCopy'; +import { RESOURCES } from '@/constants/resources'; +import type { MinerStats } from '@/schemas'; +import { formatMonetaryValue } from '@/utils/formatter'; + +const columnHelper = createColumnHelper(); + +export const MINER_LEADERBOARD_COLUMNS = [ + columnHelper.accessor('id', { + id: 'id', + header: 'Miner', + cell: (props) => ( + + ), + enableSorting: false + }), + columnHelper.accessor('totalMinedBlocks', { + id: 'total_mined_blocks', + header: 'Mined Blocks', + cell: (props) => props.getValue(), + enableSorting: true + }), + columnHelper.accessor('totalRewards', { + id: 'total_rewards', + header: 'Total Rewards', + cell: (props) => formatMonetaryValue(props.getValue(), 5), + enableSorting: true + }) +]; diff --git a/src/components/features/miner-leaderboard/miner-leaderboard-table/MinerLeaderboardTable.tsx b/src/components/features/miner-leaderboard/miner-leaderboard-table/MinerLeaderboardTable.tsx new file mode 100644 index 0000000..2beb737 --- /dev/null +++ b/src/components/features/miner-leaderboard/miner-leaderboard-table/MinerLeaderboardTable.tsx @@ -0,0 +1,20 @@ +import React from 'react'; + +import { DataTable } from '@/components/ui/composites/data-table/DataTable'; + +import { useMinerLeaderboardTable } from './hook'; + +export const MinerLeaderboardTable = () => { + const { getStatus, table, error } = useMinerLeaderboardTable(); + + return ( + Error: {error && error.message}

+ }} + withControls + /> + ); +}; diff --git a/src/components/features/miner-leaderboard/miner-leaderboard-table/hook.tsx b/src/components/features/miner-leaderboard/miner-leaderboard-table/hook.tsx new file mode 100644 index 0000000..31ede93 --- /dev/null +++ b/src/components/features/miner-leaderboard/miner-leaderboard-table/hook.tsx @@ -0,0 +1,90 @@ +import type { OnChangeFn, PaginationState } from '@tanstack/react-table'; +import { getCoreRowModel, useReactTable } from '@tanstack/react-table'; +import { parseAsInteger, useQueryState } from 'nuqs'; +import { useEffect, useMemo, useState } from 'react'; + +import api from '@/api'; +import { MINER_LEADERBOARD_COLUMNS } from '@/components/common/table-columns/MINER_LEADERBOARD_COLUMNS'; +import { DATA_POOL_INTERVAL } from '@/constants/data-pool-interval'; +import { QUERY_DEFAULT_LIMIT } from '@/constants/query-default-limit'; +import type { MinerStats } from '@/schemas'; + +export const useMinerLeaderboardTable = () => { + const [page, setPage] = useQueryState('page', parseAsInteger.withDefault(1)); + const [limit, setLimit] = useQueryState( + 'limit', + parseAsInteger.withDefault(QUERY_DEFAULT_LIMIT) + ); + + const currentPageIndex = page - 1; + + const paginationValue: PaginationState = { + pageSize: limit, + pageIndex: currentPageIndex + }; + + const handleChangePagination: OnChangeFn = (pagination) => { + if (typeof pagination === 'function') { + const newPagination = pagination(paginationValue); + + setPage(newPagination.pageIndex + 1); + setLimit(newPagination.pageSize); + } else { + setPage(pagination.pageIndex + 1); + setLimit(pagination.pageSize); + } + }; + + const { + loading, + data, + error: fetchError + } = api.minerLeaderboard.useGetAll({ + pollInterval: DATA_POOL_INTERVAL, + variables: { + limit, + offset: currentPageIndex * limit + } + }); + + const minerLeaderboardColumns = useMemo(() => MINER_LEADERBOARD_COLUMNS, []); + const [rowCount, setRowCount] = useState(data?.meta.totalCount ?? 0); + + const table = useReactTable({ + data: data?.leaderboardEntries ?? [], + columns: minerLeaderboardColumns, + getCoreRowModel: getCoreRowModel(), + state: { + pagination: paginationValue + }, + rowCount, + onPaginationChange: handleChangePagination, + manualPagination: true + }); + + const success = !loading && !fetchError; + const error = !loading && fetchError; + + const getStatus = () => { + switch (true) { + case success: + return 'success'; + case !!error: + return 'error'; + case !!loading: + return 'loading'; + default: + return 'idle'; + } + }; + + useEffect(() => { + if (!loading && data?.meta.totalCount) setRowCount(data.meta.totalCount); + }, [loading, data?.meta.totalCount]); + + return { + table, + getStatus, + error + }; +}; diff --git a/src/components/layout/header/DesktopMenu.tsx b/src/components/layout/header/DesktopMenu.tsx index dc11280..840b457 100644 --- a/src/components/layout/header/DesktopMenu.tsx +++ b/src/components/layout/header/DesktopMenu.tsx @@ -37,12 +37,12 @@ export const DesktopMenu: React.FC = () => { {nav.label} - + {nav.children.map((subNav) => ( {subNav.label} @@ -58,7 +58,7 @@ export const DesktopMenu: React.FC = () => { {nav.label} diff --git a/src/components/layout/header/MobileMenu.tsx b/src/components/layout/header/MobileMenu.tsx index b5a28cd..f8fbfd0 100644 --- a/src/components/layout/header/MobileMenu.tsx +++ b/src/components/layout/header/MobileMenu.tsx @@ -43,7 +43,7 @@ export const MobileMenu: React.FC = ({ return ( subNav.path.split('/')[1] === rootPath @@ -58,7 +58,7 @@ export const MobileMenu: React.FC = ({ @@ -75,7 +75,7 @@ export const MobileMenu: React.FC = ({ diff --git a/src/components/ui/navigation-menu.tsx b/src/components/ui/navigation-menu.tsx index 479ce44..3536f78 100644 --- a/src/components/ui/navigation-menu.tsx +++ b/src/components/ui/navigation-menu.tsx @@ -1,119 +1,158 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'; import { cva } from 'class-variance-authority'; -import { ChevronDown } from 'lucide-react'; +import { ChevronDownIcon } from 'lucide-react'; import * as React from 'react'; import { cn } from '@/lib/utils'; -const NavigationMenuViewport = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( -
- & { + viewport?: boolean; +}) { + return ( + -
-)); -NavigationMenuViewport.displayName = - NavigationMenuPrimitive.Viewport.displayName; - -const NavigationMenu = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - {children} - - -)); -NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName; + > + {children} + + ); +} -const NavigationMenuList = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName; +function NavigationMenuList({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} -const NavigationMenuItem = NavigationMenuPrimitive.Item; +function NavigationMenuItem({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} const navigationMenuTriggerStyle = cva( - 'group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent' + 'group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium outline-none transition-[color,box-shadow] hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:outline-1 focus-visible:ring focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent' ); -const NavigationMenuTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( - - {children}{' '} - -)); -NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName; + ); +} -const NavigationMenuContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); -NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName; +function NavigationMenuViewport({ + className, + ...props +}: React.ComponentProps) { + return ( +
+ +
+ ); +} -const NavigationMenuLink = NavigationMenuPrimitive.Link; +function NavigationMenuLink({ + className, + ...props +}: React.ComponentProps) { + return ( + + ); +} -const NavigationMenuIndicator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -
- -)); -NavigationMenuIndicator.displayName = - NavigationMenuPrimitive.Indicator.displayName; +function NavigationMenuIndicator({ + className, + ...props +}: React.ComponentProps) { + return ( + +
+ + ); +} export { NavigationMenu, diff --git a/src/config/site-navigations.ts b/src/config/site-navigations.ts index fb6e393..d8ce809 100644 --- a/src/config/site-navigations.ts +++ b/src/config/site-navigations.ts @@ -26,6 +26,21 @@ export const SITE_NAVIGATIONS: (SiteNavigation | ParentNavigation)[] = [ } ] }, + { + label: 'Miners', + children: [ + { + label: 'Miner Rewards', + path: '/miner-rewards', + longLabel: 'Miner Rewards' + }, + { + label: 'Miner Leaderboard', + path: '/miner-leaderboard', + longLabel: 'Miner Leaderboard' + } + ] + }, { label: 'Accounts', path: '/accounts', @@ -35,10 +50,5 @@ export const SITE_NAVIGATIONS: (SiteNavigation | ParentNavigation)[] = [ label: 'Blocks', path: '/blocks', longLabel: 'Blocks' - }, - { - label: 'Miner Rewards', - path: '/miner-rewards', - longLabel: 'Miner Rewards' } ] as const; diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index ae83371..0b6ca18 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -12,6 +12,7 @@ import { Route as rootRouteImport } from './routes/__root' import { Route as IndexRouteImport } from './routes/index' import { Route as ReversibleTransactionsIndexRouteImport } from './routes/reversible-transactions/index' import { Route as MinerRewardsIndexRouteImport } from './routes/miner-rewards/index' +import { Route as MinerLeaderboardIndexRouteImport } from './routes/miner-leaderboard/index' import { Route as ImmediateTransactionsIndexRouteImport } from './routes/immediate-transactions/index' import { Route as BlocksIndexRouteImport } from './routes/blocks/index' import { Route as AccountsIndexRouteImport } from './routes/accounts/index' @@ -37,6 +38,11 @@ const MinerRewardsIndexRoute = MinerRewardsIndexRouteImport.update({ path: '/miner-rewards/', getParentRoute: () => rootRouteImport, } as any) +const MinerLeaderboardIndexRoute = MinerLeaderboardIndexRouteImport.update({ + id: '/miner-leaderboard/', + path: '/miner-leaderboard/', + getParentRoute: () => rootRouteImport, +} as any) const ImmediateTransactionsIndexRoute = ImmediateTransactionsIndexRouteImport.update({ id: '/immediate-transactions/', @@ -91,6 +97,7 @@ export interface FileRoutesByFullPath { '/accounts': typeof AccountsIndexRoute '/blocks': typeof BlocksIndexRoute '/immediate-transactions': typeof ImmediateTransactionsIndexRoute + '/miner-leaderboard': typeof MinerLeaderboardIndexRoute '/miner-rewards': typeof MinerRewardsIndexRoute '/reversible-transactions': typeof ReversibleTransactionsIndexRoute } @@ -104,6 +111,7 @@ export interface FileRoutesByTo { '/accounts': typeof AccountsIndexRoute '/blocks': typeof BlocksIndexRoute '/immediate-transactions': typeof ImmediateTransactionsIndexRoute + '/miner-leaderboard': typeof MinerLeaderboardIndexRoute '/miner-rewards': typeof MinerRewardsIndexRoute '/reversible-transactions': typeof ReversibleTransactionsIndexRoute } @@ -118,6 +126,7 @@ export interface FileRoutesById { '/accounts/': typeof AccountsIndexRoute '/blocks/': typeof BlocksIndexRoute '/immediate-transactions/': typeof ImmediateTransactionsIndexRoute + '/miner-leaderboard/': typeof MinerLeaderboardIndexRoute '/miner-rewards/': typeof MinerRewardsIndexRoute '/reversible-transactions/': typeof ReversibleTransactionsIndexRoute } @@ -133,6 +142,7 @@ export interface FileRouteTypes { | '/accounts' | '/blocks' | '/immediate-transactions' + | '/miner-leaderboard' | '/miner-rewards' | '/reversible-transactions' fileRoutesByTo: FileRoutesByTo @@ -146,6 +156,7 @@ export interface FileRouteTypes { | '/accounts' | '/blocks' | '/immediate-transactions' + | '/miner-leaderboard' | '/miner-rewards' | '/reversible-transactions' id: @@ -159,6 +170,7 @@ export interface FileRouteTypes { | '/accounts/' | '/blocks/' | '/immediate-transactions/' + | '/miner-leaderboard/' | '/miner-rewards/' | '/reversible-transactions/' fileRoutesById: FileRoutesById @@ -173,6 +185,7 @@ export interface RootRouteChildren { AccountsIndexRoute: typeof AccountsIndexRoute BlocksIndexRoute: typeof BlocksIndexRoute ImmediateTransactionsIndexRoute: typeof ImmediateTransactionsIndexRoute + MinerLeaderboardIndexRoute: typeof MinerLeaderboardIndexRoute MinerRewardsIndexRoute: typeof MinerRewardsIndexRoute ReversibleTransactionsIndexRoute: typeof ReversibleTransactionsIndexRoute } @@ -200,6 +213,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof MinerRewardsIndexRouteImport parentRoute: typeof rootRouteImport } + '/miner-leaderboard/': { + id: '/miner-leaderboard/' + path: '/miner-leaderboard' + fullPath: '/miner-leaderboard' + preLoaderRoute: typeof MinerLeaderboardIndexRouteImport + parentRoute: typeof rootRouteImport + } '/immediate-transactions/': { id: '/immediate-transactions/' path: '/immediate-transactions' @@ -269,6 +289,7 @@ const rootRouteChildren: RootRouteChildren = { AccountsIndexRoute: AccountsIndexRoute, BlocksIndexRoute: BlocksIndexRoute, ImmediateTransactionsIndexRoute: ImmediateTransactionsIndexRoute, + MinerLeaderboardIndexRoute: MinerLeaderboardIndexRoute, MinerRewardsIndexRoute: MinerRewardsIndexRoute, ReversibleTransactionsIndexRoute: ReversibleTransactionsIndexRoute, } diff --git a/src/routes/miner-leaderboard/index.tsx b/src/routes/miner-leaderboard/index.tsx new file mode 100644 index 0000000..a623396 --- /dev/null +++ b/src/routes/miner-leaderboard/index.tsx @@ -0,0 +1,23 @@ +import { createFileRoute } from '@tanstack/react-router'; + +import { MinerLeaderboardTable } from '@/components/features/miner-leaderboard/miner-leaderboard-table/MinerLeaderboardTable'; +import { ContentContainer } from '@/components/ui/content-container'; +import { SectionContainer } from '@/components/ui/section-container'; + +export const Route = createFileRoute('/miner-leaderboard/')({ + component: MinerLeaderboard +}); + +function MinerLeaderboard() { + return ( + + +

Miner Leaderboard

+ + +
+
+ ); +} + +export default MinerLeaderboard; diff --git a/src/schemas/index.ts b/src/schemas/index.ts index c32117f..25af82b 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -1,6 +1,7 @@ export * from './account'; export * from './blocks'; export * from './chain-status'; +export * from './miner-leaderboard'; export * from './miner-reward'; export * from './reversible-transaction'; export * from './searchs'; diff --git a/src/schemas/miner-leaderboard.ts b/src/schemas/miner-leaderboard.ts new file mode 100644 index 0000000..30f36bb --- /dev/null +++ b/src/schemas/miner-leaderboard.ts @@ -0,0 +1,10 @@ +import type * as gql from '../__generated__/graphql'; + +export interface MinerStats extends gql.MinerStats {} + +export interface MinerLeaderboardResponse { + leaderboardEntries: MinerStats[]; + meta: { + totalCount: number; + }; +}