import { fetchGraphData } from './fetch-graph'; import { PrexApiService } from '../api'; import { PUM_TOKEN_PRICES_QUERY, PumTokenPricesEntities, transform, } from './query/pumpum/pum-token-price'; import { Address } from 'viem'; import { PagingOptions } from '../types'; export async function queryPumTokenPrice( apiService: PrexApiService, { token, interval, pageOptions, }: { token: Address; interval: 'HOUR' | 'DAY'; pageOptions: PagingOptions; } ) { const body = await fetchGraphData( apiService, 'pumTokenPrices', PUM_TOKEN_PRICES_QUERY, { token: token.toLowerCase(), interval: interval, offset: pageOptions.offset, limit: pageOptions.limit, } ); const pumTokenPrices = body as PumTokenPricesEntities; return transform(pumTokenPrices); }