mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* envs and feature setup * home page layout * cross-chain txs page * cross-chain transfers page * cross-chain transfers on tx page * cross-chain messages on tx page * cross-chain tx page * cross-chain tx details token transfers * stats and counters for lists * migrate to new API version * add swagger * mobile lists * placeholder views on address page * tests * fix adaptive tabs initial state when there is only one tab in the list * tweaks * bug fixes * fix tests * update screenshots * migrate to new api version * add chain label tooltip, copy button to txs in lists and same address highlight * list views on address page * fix tests * fix links to current address in the list views * update tooltips * update tables layout * review fixes * fix spelling * update screenshots * update screenshot
72 lines
2.7 KiB
TypeScript
72 lines
2.7 KiB
TypeScript
import type { ApiResource } from '../types';
|
|
import type * as interchainIndexer from '@blockscout/interchain-indexer-types';
|
|
import type { CrossChainMessageFilters, CrossChainTransferFilters } from 'types/api/interchainIndexer';
|
|
|
|
export const INTERCHAIN_INDEXER_API_RESOURCES = {
|
|
messages: {
|
|
path: '/api/v1/interchain/messages',
|
|
filterFields: [ 'q' as const ],
|
|
paginated: true,
|
|
},
|
|
message: {
|
|
path: '/api/v1/interchain/messages/:id',
|
|
pathParams: [ 'id' as const ],
|
|
},
|
|
tx_messages: {
|
|
path: '/api/v1/interchain/messages\\:byTx/:hash',
|
|
pathParams: [ 'hash' as const ],
|
|
filterFields: [ 'q' as const ],
|
|
paginated: true,
|
|
},
|
|
address_messages: {
|
|
path: '/api/v1/interchain/messages\\:byAddress/:hash',
|
|
pathParams: [ 'hash' as const ],
|
|
paginated: true,
|
|
},
|
|
transfers: {
|
|
path: '/api/v1/interchain/transfers',
|
|
filterFields: [ 'q' as const ],
|
|
paginated: true,
|
|
},
|
|
tx_transfers: {
|
|
path: '/api/v1/interchain/transfers\\:byTx/:hash',
|
|
pathParams: [ 'hash' as const ],
|
|
filterFields: [ 'q' as const ],
|
|
paginated: true,
|
|
},
|
|
address_transfers: {
|
|
path: '/api/v1/interchain/transfers\\:byAddress/:hash',
|
|
pathParams: [ 'hash' as const ],
|
|
paginated: true,
|
|
},
|
|
stats_daily: {
|
|
path: '/api/v1/stats/daily',
|
|
},
|
|
stats_common: {
|
|
path: '/api/v1/stats/common',
|
|
},
|
|
} satisfies Record<string, ApiResource>;
|
|
|
|
export type InterchainIndexerApiResourceName = `interchainIndexer:${ keyof typeof INTERCHAIN_INDEXER_API_RESOURCES }`;
|
|
|
|
/* eslint-disable @stylistic/indent */
|
|
export type InterchainIndexerApiResourcePayload<R extends InterchainIndexerApiResourceName> =
|
|
R extends 'interchainIndexer:messages' ? interchainIndexer.GetMessagesResponse :
|
|
R extends 'interchainIndexer:message' ? interchainIndexer.InterchainMessage :
|
|
R extends 'interchainIndexer:tx_messages' ? interchainIndexer.GetMessagesResponse :
|
|
R extends 'interchainIndexer:address_messages' ? interchainIndexer.GetMessagesResponse :
|
|
R extends 'interchainIndexer:transfers' ? interchainIndexer.GetTransfersResponse :
|
|
R extends 'interchainIndexer:tx_transfers' ? interchainIndexer.GetTransfersResponse :
|
|
R extends 'interchainIndexer:address_transfers' ? interchainIndexer.GetTransfersResponse :
|
|
R extends 'interchainIndexer:stats_daily' ? interchainIndexer.GetDailyStatisticsResponse :
|
|
R extends 'interchainIndexer:stats_common' ? interchainIndexer.GetCommonStatisticsResponse :
|
|
never;
|
|
/* eslint-enable @stylistic/indent */
|
|
|
|
/* eslint-disable @stylistic/indent */
|
|
export type InterchainIndexerApiPaginationFilters<R extends InterchainIndexerApiResourceName> =
|
|
R extends 'interchainIndexer:messages' ? CrossChainMessageFilters :
|
|
R extends 'interchainIndexer:transfers' ? CrossChainTransferFilters :
|
|
never;
|
|
/* eslint-enable @stylistic/indent */
|