export type DeleteApiV1MinerRaceSelectionOptions = {baseUrl: string, SessionBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Clear pinned race candidate * * DELETE /v1/miner/race-selection * * Also accepts auth: X-Hotkey + X-Timestamp + X-Nonce + X-Signature */ export const deleteApiV1MinerRaceSelection = async (options: DeleteApiV1MinerRaceSelectionOptions) => { const {baseUrl, fetch: fetchFn = fetch, SessionBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (SessionBearer !== undefined) headers.set('authorization', `Bearer ${SessionBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/miner/race-selection${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };