Suite of AT Protocol TypeScript libraries built on web standards
1import { DidResolver } from "./did/did-resolver.ts";
2import { HandleResolver } from "./handle/index.ts";
3import type { IdentityResolverOpts } from "./types.ts";
4
5/**
6 * A single identity resolver class combining Did resolver and Handle resolver.
7 * Can resolve handles and dids to atproto data with an optional cache.
8 */
9export class IdResolver {
10 public handle: HandleResolver;
11 public did: DidResolver;
12
13 constructor(opts: IdentityResolverOpts = {}) {
14 const { timeout = 3000, plcUrl, didCache } = opts;
15 this.handle = new HandleResolver({
16 timeout,
17 backupNameservers: opts.backupNameservers,
18 });
19 this.did = new DidResolver({ timeout, plcUrl, didCache });
20 }
21}