export type WalletCashoutCommand = {amount: number, amountEnoughForSendingSms?: boolean | undefined, cardNumberMask?: string | undefined, description?: string | undefined, destinationAccountNumber?: string | undefined, destinationBank?: string | undefined, paymentNumber?: string | undefined, receiverFirstName?: string | undefined, receiverLastName?: string | undefined, senderAcceptorCode?: string | undefined, sheba?: string | undefined, transferType?: string | undefined, walletEventDepositId?: number | undefined, walletEventWithdrawId?: number | undefined}; export type CreateApiApiWalletCashoutArgs = {body: WalletCashoutCommand}; export type CreateApiApiWalletCashoutOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * cashout * * POST /api/wallet/cashout */ export const createApiApiWalletCashout = async (args: CreateApiApiWalletCashoutArgs, options: CreateApiApiWalletCashoutOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/wallet/cashout${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };