import type { KyInstance } from 'ky' import type { PaginatedResponse, PaginationInput } from '../../types.js' export type GetLightningDepositsInput = PaginationInput & { settled?: boolean } export type LightningDeposit = | { id: string createdAt: string amount: number paymentHash: string settledAt: string comment: string | null } | { id: string createdAt: string amount: number paymentHash: string settledAt: null comment: string | null } export type GetLightningDepositsOutput = PaginatedResponse type GetLightningDeposits = ( input?: Readonly ) => Promise export const createGetLightningDeposits = ( instance: Readonly ): GetLightningDeposits => { return async ({ cursor, from, limit, to, settled } = {}) => { return instance .get('account/deposits/lightning', { searchParams: { cursor, from, limit, to, settled }, }) .json() } }