@ln-markets/sdk
Version:
TypeScript SDK for LNMarkets API
15 lines (11 loc) • 336 B
text/typescript
import type { KyInstance } from 'ky'
export interface GetBestPriceOutput {
askPrice: number
bidPrice: number
}
type GetBestPrice = () => Promise<GetBestPriceOutput>
export const createGetBestPrice = (instance: KyInstance): GetBestPrice => {
return async () => {
return instance.get('synthetic-usd/best-price').json()
}
}