export type ValidateDropAllowlistRequest = {allowlist_file_token: string}; export type CreateApiApiV2DropsSlugAllowlistValidateArgs = {slug: string, body: ValidateDropAllowlistRequest}; export type CreateApiApiV2DropsSlugAllowlistValidateOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, WalletAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Validate drop allowlist * * POST /api/v2/drops/{slug}/allowlist/validate */ export const createApiApiV2DropsSlugAllowlistValidate = async (args: CreateApiApiV2DropsSlugAllowlistValidateArgs, options?: CreateApiApiV2DropsSlugAllowlistValidateOptions) => { const {baseUrl = "https://api.opensea.io", fetch: fetchFn = fetch, ApiKeyAuth, WalletAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) if (WalletAuth !== undefined) headers.set('authorization', `Bearer ${WalletAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/drops/${encodeURIComponent(String(args.slug))}/allowlist/validate${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() };