API resource refactoring (#2699)

* add prefix to API resources

* fix pw tests

* refactor config

* remove unnecessary prefixes in resource names

* fixes

* update screenshots
This commit is contained in:
tom goriunov
2025-05-01 15:22:38 +02:00
committed by GitHub
parent c982f332da
commit fae4990e1f
388 changed files with 3093 additions and 2721 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ const TokenDetails = ({ tokenQuery }: Props) => {
const hash = router.query.hash?.toString();
const tokenCountersQuery = useApiQuery('token_counters', {
const tokenCountersQuery = useApiQuery('general:token_counters', {
pathParams: { hash },
queryOptions: { enabled: Boolean(router.query.hash), placeholderData: TOKEN_COUNTERS },
});
+1 -1
View File
@@ -19,7 +19,7 @@ const TABS_HEIGHT = 88;
type Props = {
token?: TokenInfo;
holdersQuery: QueryWithPagesResult<'token_holders'>;
holdersQuery: QueryWithPagesResult<'general:token_holders'>;
shouldRender?: boolean;
tabsHeight?: number;
};
+1 -1
View File
@@ -18,7 +18,7 @@ import ResetIconButton from 'ui/shared/ResetIconButton';
import TokenInventoryItem from './TokenInventoryItem';
type Props = {
inventoryQuery: QueryWithPagesResult<'token_inventory'>;
inventoryQuery: QueryWithPagesResult<'general:token_inventory'>;
tokenQuery: UseQueryResult<TokenInfo, ResourceError<unknown>>;
ownerFilter?: string;
shouldRender?: boolean;
+1 -1
View File
@@ -40,7 +40,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
const appProps = useAppContext();
const addressHash = !tokenQuery.isPlaceholderData ? (tokenQuery.data?.address_hash || '') : '';
const verifiedInfoQuery = useApiQuery('token_verified_info', {
const verifiedInfoQuery = useApiQuery('contractInfo:token_verified_info', {
pathParams: { hash: addressHash, chainId: config.chain.id },
queryOptions: { enabled: Boolean(tokenQuery.data) && !tokenQuery.isPlaceholderData && config.features.verifiedTokens.isEnabled },
});
+1 -1
View File
@@ -23,7 +23,7 @@ import TokenTransferTable from 'ui/token/TokenTransfer/TokenTransferTable';
const TABS_HEIGHT = 88;
type Props = {
transfersQuery: QueryWithPagesResult<'token_transfers'> | QueryWithPagesResult<'token_instance_transfers'>;
transfersQuery: QueryWithPagesResult<'general:token_transfers'> | QueryWithPagesResult<'general:token_instance_transfers'>;
tokenId?: string;
tokenInstance?: TokenInstance;
tokenQuery: UseQueryResult<TokenInfo, ResourceError<unknown>>;
+1 -1
View File
@@ -5,7 +5,7 @@ import * as tokenStubs from 'stubs/token';
export default function useTokenQuery(hash: string) {
const { apiData } = useAppContext<'/token/[hash]'>();
return useApiQuery('token', {
return useApiQuery('general:token', {
pathParams: { hash },
queryOptions: {
enabled: Boolean(hash),