export type SaveDropEditsPriceRequest = {contract_address: string, unit: string}; export type SaveDropEditsStageRequest = {allowlist_file_token?: (string | null) | undefined, description?: (string | null) | undefined, end_time: string, label: string, max_token_supply_for_stage?: (string | null) | undefined, max_total_mintable_by_wallet: string, price: SaveDropEditsPriceRequest, stage_type: 'public_sale' | 'signed_presale', start_time: string, uuid: string}; export type SaveDropEditsRequest = {creator_payout_address?: (string | null) | undefined, launch_date_pending?: boolean | undefined, max_supply?: (string | null) | undefined, stages: Array}; export type CreateApiApiV2DropsSlugArgs = {slug: string, body: SaveDropEditsRequest}; export type CreateApiApiV2DropsSlugOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, WalletAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Creator Studio drop edits * * POST /api/v2/drops/{slug} */ export const createApiApiV2DropsSlug = async (args: CreateApiApiV2DropsSlugArgs, options?: CreateApiApiV2DropsSlugOptions) => { 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))}${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() };