export type CreateApiCommunitiesCommunityPKOnDemandBalanceCheckArgs = {communityPK: string}; export type CreateApiCommunitiesCommunityPKOnDemandBalanceCheckOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, authenticatedEncryption?: string | undefined, ethereum?: string | undefined, collabLandOAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /communities/{communityPK}/on-demand-balance-check */ export const createApiCommunitiesCommunityPKOnDemandBalanceCheck = async (args: CreateApiCommunitiesCommunityPKOnDemandBalanceCheckArgs, options?: CreateApiCommunitiesCommunityPKOnDemandBalanceCheckOptions) => { const {baseUrl = "https://api.collab.land", fetch: fetchFn = fetch, apiKey, authenticatedEncryption, ethereum, collabLandOAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("x-api-key", apiKey) if (authenticatedEncryption !== undefined) headers.set("Authorization", authenticatedEncryption) if (ethereum !== undefined) headers.set("Authorization", ethereum) if (collabLandOAuth2 !== undefined) headers.set('authorization', `Bearer ${collabLandOAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/communities/${encodeURIComponent(String(args.communityPK))}/on-demand-balance-check${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 };