import type { KyInstance } from 'ky' export interface WithdrawLightningInput { invoice: string } export interface WithdrawLightningOutput { amount: number id: string maxFees: number paymentHash: string } type WithdrawLightning = ( input: Readonly ) => Promise export const createWithdrawLightning = ( instance: Readonly ): WithdrawLightning => { return async ({ invoice }) => { return instance .post('account/withdraw/lightning', { json: { invoice } }) .json() } }