export type CreateApiWorkspaceFreezeArgs = {'Idempotency-Key'?: string | undefined}; export type CreateApiWorkspaceFreezeOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Freeze * * POST /workspace/freeze */ export const createApiWorkspaceFreeze = async (args: CreateApiWorkspaceFreezeArgs, options?: CreateApiWorkspaceFreezeOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Idempotency-Key'] != null) headers.set("Idempotency-Key", String(args['Idempotency-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/workspace/freeze${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 };