mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
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:
@@ -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 },
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 },
|
||||
});
|
||||
|
||||
@@ -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>>;
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user