export type CreateApiV2AccountsAccountIdReindexArgs = {account_id: unknown}; export type CreateApiV2AccountsAccountIdReindexOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update internal cache for a particular account * * POST /v2/accounts/{account_id}/reindex */ export const createApiV2AccountsAccountIdReindex = async (args: CreateApiV2AccountsAccountIdReindexArgs, options?: CreateApiV2AccountsAccountIdReindexOptions) => { const {baseUrl = "https://tonapi.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/accounts/${encodeURIComponent(String(args.account_id))}/reindex${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 };