import type { MastodonObject } from './base'; import { fetchAPI, type InstanceInfo } from './util'; export interface MastodonAccount extends MastodonObject { fqn: string; display_name: string; acct: string; url: string; avatar: string; avatar_static: string; note: string; bot: boolean; } export function linkAccount(account: MastodonAccount) { return '/acc/' + account.id; } export async function fetchAccount(instance: InstanceInfo, id: string): Promise { return await fetchAPI(instance, '/api/v1/accounts/' + id) .then((r) => r.json()) .then((b) => b as MastodonAccount); }