export type GetApiApiV2AccountsResolveIdentifierArgs = {identifier: string}; export type GetApiApiV2AccountsResolveIdentifierOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resolve an account identifier * * GET /api/v2/accounts/resolve/{identifier} */ export const getApiApiV2AccountsResolveIdentifier = async (args: GetApiApiV2AccountsResolveIdentifierArgs, options?: GetApiApiV2AccountsResolveIdentifierOptions) => { const {baseUrl = "https://api.opensea.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/accounts/resolve/${encodeURIComponent(String(args.identifier))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };