Interface: IIdentityResolver
Defined in: src/types/interfaces/identity.interface.ts:77
Identity resolver interface.
Remarks
Provides DID and handle resolution for the AT Protocol.
Implementation notes:
- Uses
did:plcdirectory ordid:webresolution - Caches DID documents with TTL
- Retries on failure with exponential backoff
Methods
getPDSEndpoint()
getPDSEndpoint(
did):Promise<null|string>
Defined in: src/types/interfaces/identity.interface.ts:131
Gets PDS endpoint URL for a DID.
Parameters
did
DID
Returns
Promise<null | string>
PDS URL or null if not found
Remarks
Extracts PDS URL from DID document's service endpoints.
Example
const pdsUrl = await resolver.getPDSEndpoint(toDID('did:plc:abc123')!);
console.log('PDS URL:', pdsUrl); // "https://pds.example.com"
resolveDID()
resolveDID(
did):Promise<null|DIDDocument>
Defined in: src/types/interfaces/identity.interface.ts:94
Resolves a DID to its DID document.
Parameters
did
DID to resolve
Returns
Promise<null | DIDDocument>
DID document or null if not found
Example
const doc = await resolver.resolveDID(toDID('did:plc:z72i7hdynmk6r22z27h6tvur')!);
if (doc) {
console.log('PDS:', await resolver.getPDSEndpoint(doc.id));
}
resolveHandle()
resolveHandle(
handle):Promise<null|DID>
Defined in: src/types/interfaces/identity.interface.ts:112
Resolves a handle to its DID.
Parameters
handle
string
Handle to resolve (e.g., "alice.bsky.social")
Returns
Promise<null | DID>
DID or null if not found
Example
const did = await resolver.resolveHandle('alice.bsky.social');
if (did) {
console.log('DID:', did);
}