Encrypted, ephemeral, private memos on atproto
1import type { MiniDoc } from "./types.ts";
2
3export async function resolveMiniDoc(
4 handle: string,
5 slingshotUrl?: string,
6): Promise<MiniDoc> {
7 const url = new URL(
8 "/xrpc/com.bad-example.identity.resolveMiniDoc",
9 slingshotUrl ?? "https://slingshot.microcosm.blue",
10 );
11
12 url.searchParams.set("identifier", handle);
13
14 const result = await fetch(url.toString());
15
16 if (!result.ok) {
17 throw new Error(
18 `failed to fetch identity mini doc: Error ${result.status} ${result.statusText}`,
19 );
20 }
21
22 return await result.json();
23}