export type GetApiV1CryptosCryptoCodeGroupsGroupIdArgs = {cryptoCode: string, groupId: string}; export type GetApiV1CryptosCryptoCodeGroupsGroupIdOptions = {baseUrl: string, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Check whether a group is tracked * * GET /v1/cryptos/{cryptoCode}/groups/{groupId} */ export const getApiV1CryptosCryptoCodeGroupsGroupId = async (args: GetApiV1CryptosCryptoCodeGroupsGroupIdArgs, options: GetApiV1CryptosCryptoCodeGroupsGroupIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/cryptos/${encodeURIComponent(String(args.cryptoCode))}/groups/${encodeURIComponent(String(args.groupId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };