Skip to content

Commit

Permalink
added comments to the Identity and Did Api classes, will expand on DI…
Browse files Browse the repository at this point in the history
…D in subsequent PR
  • Loading branch information
LiranCohen committed Sep 26, 2024
1 parent e5dd4ec commit c06a929
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/agent/src/did-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export function isDidRequest<T extends DidInterface>(
return didRequest.messageType === messageType;
}

/**
* This API is used to manage and interact with DIDs within the Web5 Agent framework.
*
* If a DWN Data Store is used, the DID information is stored under DID's own tenant by default.
* If a tenant property is passed, that tenant will be used to store the DID information.
*/
export class AgentDidApi<TKeyManager extends AgentKeyManager = AgentKeyManager> extends UniversalResolver {
/**
* Holds the instance of a `Web5PlatformAgent` that represents the current execution context for
Expand Down
10 changes: 10 additions & 0 deletions packages/agent/src/identity-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ export function isPortableIdentity(obj: unknown): obj is PortableIdentity {
&& isPortableDid(obj.did);
}

/**
* This API is used to manage and interact with Identities within the Web5 Agent framework.
* An Identity is a DID that is associated with metadata that describes the Identity.
* Metadata includes A name(label), and whether or not the Identity is connected (delegated to act on the behalf of another DID).
*
* A KeyManager is used to manage the cryptographic keys associated with the Identities.
*
* The `DidApi` is used internally to create, store, and manage DIDs.
* When a DWN Data Store is used, the Identity and DID information are stored under the Agent DID's tenant.
*/
export class AgentIdentityApi<TKeyManager extends AgentKeyManager = AgentKeyManager> {
/**
* Holds the instance of a `Web5PlatformAgent` that represents the current execution context for
Expand Down

0 comments on commit c06a929

Please sign in to comment.