export type DeleteApiV0PlatformLabelsAddressesAddressArgs = {address: string, label: string, chain?: (string | null) | undefined}; export type DeleteApiV0PlatformLabelsAddressesAddressOptions = {baseUrl?: string | undefined, APIKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Address Label * * DELETE /v0/platform/labels/addresses/{address} * * Also accepts auth: ClientID */ export const deleteApiV0PlatformLabelsAddressesAddress = async (args: DeleteApiV0PlatformLabelsAddressesAddressArgs, options?: DeleteApiV0PlatformLabelsAddressesAddressOptions) => { const {baseUrl = "https://api.blockaid.io", fetch: fetchFn = fetch, APIKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.label != null) query.append("label", String(args.label)) if (args.chain != null) query.append("chain", String(args.chain)) if (APIKey !== undefined) headers.set("X-API-Key", APIKey) const url = `${baseUrl.replace(/\/+$/, '')}/v0/platform/labels/addresses/${encodeURIComponent(String(args.address))}${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 };