handy online tools for AT Protocol
boat.kelinci.net
atproto
bluesky
atcute
typescript
solidjs
1import { defs } from '@atcute/did-plc';
2import type { Did } from '@atcute/lexicons/syntax';
3
4export const getPlcAuditLogs = async ({ did, signal }: { did: Did<'plc'>; signal?: AbortSignal }) => {
5 const origin = import.meta.env.VITE_PLC_DIRECTORY_URL;
6 const response = await fetch(`${origin}/${did}/log/audit`, { signal });
7 if (!response.ok) {
8 throw new Error(`got resposne ${response.status}`);
9 }
10
11 const json = await response.json();
12 return defs.indexedEntryLog.parse(json);
13};