export type CreateApiAtlasSettlementsSettlementIdRejectArgs = {settlementId: string, 'Api-Signature': string, 'Api-Timestamp': number}; export type CreateApiAtlasSettlementsSettlementIdRejectOptions = {baseUrl?: string | undefined, ApiAccessKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reject a settlement proposal * * POST /atlas/settlements/{settlementId}/reject */ export const createApiAtlasSettlementsSettlementIdReject = async (args: CreateApiAtlasSettlementsSettlementIdRejectArgs, options?: CreateApiAtlasSettlementsSettlementIdRejectOptions) => { const {baseUrl = "https://api.anchorage-staging.com/v2", fetch: fetchFn = fetch, ApiAccessKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Api-Signature'] != null) headers.set("Api-Signature", String(args['Api-Signature'])) if (args['Api-Timestamp'] != null) headers.set("Api-Timestamp", String(args['Api-Timestamp'])) if (ApiAccessKey !== undefined) headers.set("Api-Access-Key", ApiAccessKey) const url = `${baseUrl.replace(/\/+$/, '')}/atlas/settlements/${encodeURIComponent(String(args.settlementId))}/reject${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 };