export type CreateApiV1PayoutBatchWithdrawalIdVerifyArgs = {'x-api-key'?: string | undefined, body: {verification_code?: string | undefined}}; export type CreateApiV1PayoutBatchWithdrawalIdVerifyOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Verify payout * * POST /v1/payout/{batch-withdrawal-id}/verify */ export const createApiV1PayoutBatchWithdrawalIdVerify = async (args: CreateApiV1PayoutBatchWithdrawalIdVerifyArgs, options?: CreateApiV1PayoutBatchWithdrawalIdVerifyOptions) => { const {baseUrl = "https://api.nowpayments.io", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/payout/${encodeURIComponent(String(args['batch-withdrawal-id']))}/verify${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 };