UNPKG

@ln-markets/sdk

Version:
20 lines (15 loc) 530 B
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?: GetLastPriceInput) => Promise<GetLastPriceOutput> export const createGetLastPrice = (instance: KyInstance): GetLastPrice => { return async ({ from, limit, to } = {}) => { return instance .get('oracle/last-price', { searchParams: { from, limit, to } }) .json() } }