export type DeleteApiV1ReferralAddressArgs = {address: string}; export type DeleteApiV1ReferralAddressOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unbind existing referral. For internal usage only. * * DELETE /v1/referral/{address} */ export const deleteApiV1ReferralAddress = async (args: DeleteApiV1ReferralAddressArgs, options?: DeleteApiV1ReferralAddressOptions) => { const {baseUrl = "https://backend.swap.coffee", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/referral/${encodeURIComponent(String(args.address))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };