export type WalletTransferCommand = {amount: number, hasOperationCost?: boolean | undefined, mobile: string, oneTimeCode?: string | undefined, receiverDescription?: string | undefined, senderAcceptorCode?: string | undefined, senderDescription?: string | undefined, transferType?: ('DEBIT' | 'DEBT' | 'GIFT' | 'SALARY' | 'CASH_MANAGEMENT' | 'BUY' | 'OTHER') | undefined}; export type CreateApiApiWalletTransferArgs = {body: WalletTransferCommand}; export type CreateApiApiWalletTransferOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * transfer * * POST /api/wallet/transfer */ export const createApiApiWalletTransfer = async (args: CreateApiApiWalletTransferArgs, options: CreateApiApiWalletTransferOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/wallet/transfer${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 res.blob() };