Skip to content

Commit

Permalink
add doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Oct 16, 2024
1 parent 800e71e commit 8b03387
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/agent/src/identity-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,24 @@ export class AgentIdentityApi<TKeyManager extends AgentKeyManager = AgentKeyMana
await this._store.delete({ id: didUri, agent: this.agent });
}

/**
* Returns the DWN endpoints for the given DID.
*
* @param didUri - The DID URI to get the DWN endpoints for.
* @returns An array of DWN endpoints.
* @throws An error if the DID is not found, or no DWN service exists.
*/
public getDwnEndpoints({ didUri }: { didUri: string; }): Promise<string[]> {
return getDwnServiceEndpointUrls(didUri, this.agent.did);
}

/**
* Sets the DWN endpoints for the given DID.
*
* @param didUri - The DID URI to set the DWN endpoints for.
* @param endpoints - The array of DWN endpoints to set.
* @throws An error if the DID is not found, or if an update cannot be performed.
*/
public async setDwnEndpoints({ didUri, endpoints }: { didUri: string; endpoints: string[] }): Promise<void> {
const bearerDid = await this.agent.did.get({ didUri });
if (!bearerDid) {
Expand Down

0 comments on commit 8b03387

Please sign in to comment.