export type CreateApiVaultsIdIngotsHashCheckArgs = {id: string}; export type CreateApiVaultsIdIngotsHashCheckOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, VaultAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /vaults/{id}/ingots/hash-check * * Also accepts auth: BearerAuth + VaultAccessToken */ export const createApiVaultsIdIngotsHashCheck = async (args: CreateApiVaultsIdIngotsHashCheckArgs, options?: CreateApiVaultsIdIngotsHashCheckOptions) => { const {baseUrl = "https://api.sparkvault.com/v1", fetch: fetchFn = fetch, ApiKeyAuth, VaultAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) if (VaultAccessToken !== undefined) headers.set("X-Vault-Access-Token", VaultAccessToken) const url = `${baseUrl.replace(/\/+$/, '')}/vaults/${encodeURIComponent(String(args.id))}/ingots/hash-check${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };