export type CreateApiV1PartnershipClaimingArgs = {body: {access_token_name: string, token_address: string, distributor_address: string, total: unknown}}; export type CreateApiV1PartnershipClaimingOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Register new partner token for claiming center. For internal usage only. * * POST /v1/partnership/claiming */ export const createApiV1PartnershipClaiming = async (args: CreateApiV1PartnershipClaimingArgs, options?: CreateApiV1PartnershipClaimingOptions) => { const {baseUrl = "https://backend.swap.coffee", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/partnership/claiming${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };