import type { KyInstance } from 'ky' import type { PaginationInput } from '../../types.js' export type GetLastPriceInput = PaginationInput export type GetLastPriceOutput = { lastPrice: number time: string }[] type GetLastPrice = ( input?: Readonly ) => Promise export const createGetLastPrice = ( instance: Readonly ): GetLastPrice => { return async ({ from, limit, to } = {}) => { return instance .get('oracle/last-price', { searchParams: { from, limit, to }, }) .json() } }