export type CreateApiV1VaultsOperationsSignedArgs = {body: BodyInit}; export type CreateApiV1VaultsOperationsSignedOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Import signed operations * * POST /v1/vaults/operations/signed */ export const createApiV1VaultsOperationsSigned = async (args: CreateApiV1VaultsOperationsSignedArgs, options: CreateApiV1VaultsOperationsSignedOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/vaults/operations/signed${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };