@ln-markets/sdk
Version:
TypeScript SDK for LNMarkets API
23 lines (18 loc) • 495 B
text/typescript
import type { KyInstance } from 'ky'
export interface AddBitcoinAddressInput {
format?: 'p2tr' | 'p2wpkh'
}
export interface AddBitcoinAddressOutput {
address: string
createdAt: string
}
type AddBitcoinAddress = (
input?: AddBitcoinAddressInput
) => Promise<AddBitcoinAddressOutput>
export const createAddBitcoinAddress = (
instance: KyInstance
): AddBitcoinAddress => {
return async (input) => {
return instance.post('account/address/bitcoin', { json: input }).json()
}
}