@ln-markets/sdk
Version:
TypeScript SDK for LNMarkets API v2
25 lines (22 loc) • 617 B
text/typescript
import snakecaseKeys from 'snakecase-keys'
import type { RestFetcher } from '../../rest.js'
import type { User } from './types.js'
export const createUpdateUser = (request: RestFetcher) => {
/**
* @see https://docs.lnmarkets.com/api/operations/userupdate
*/
return async (body: {
autoWithdrawEnabled?: boolean
autoWithdrawLightningAddress?: boolean
nostrPubkey?: string
showLeaderboard?: boolean
username?: string
useTaprootAddresses?: boolean
}) =>
request<User>({
body: snakecaseKeys(body),
method: 'PUT',
path: '/user',
requireAuth: true,
})
}