Skip to content

Commit

Permalink
add changesets and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Oct 21, 2024
1 parent 8241256 commit 131db7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/shy-grapes-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@web5/agent": patch
"@web5/identity-agent": patch
"@web5/proxy-agent": patch
"@web5/user-agent": patch
---

Add ability to update the Identity Metadata name field.
8 changes: 8 additions & 0 deletions packages/agent/src/identity-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ export class AgentIdentityApi<TKeyManager extends AgentKeyManager = AgentKeyMana
await this.agent.did.update({ portableDid, tenant: this.agent.agentDid.uri });
}

/**
* Updates the Identity's metadata name field.
*
* @param didUri - The DID URI of the Identity to update.
* @param name - The new name to set for the Identity.
*
* @throws An error if the Identity is not found, name is not provided, or no changes are detected.
*/
public async setMetadataName({ didUri, name }: { didUri: string; name: string }): Promise<void> {
if (!name) {
throw new Error('AgentIdentityApi: Failed to set metadata name due to missing name value.');
Expand Down

0 comments on commit 131db7c

Please sign in to comment.