Skip to content

Commit

Permalink
Merge branch 'master' into feat/store-update
Browse files Browse the repository at this point in the history
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
  • Loading branch information
Gancho Radkov committed Nov 8, 2023
2 parents 58942fa + c0a6bdc commit 80d2267
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions misc/identity-keys/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion misc/identity-keys/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@walletconnect/identity-keys",
"version": "0.2.0",
"version": "0.2.2",
"description": "Utilities to register, resolve and unregister identity keys",
"keywords": [
"identity",
Expand Down
9 changes: 9 additions & 0 deletions misc/identity-keys/src/identity-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ export class IdentityKeys implements IIdentityKeys {
if (response.status !== 200) {
throw new Error(`Failed to unregister on keyserver ${response.status}`);
}

await this.identityKeys.delete(account, {
code: -1,
message: `Account ${account} unregistered`,
});
} catch (error) {
this.core.logger.error(error);
throw error;
Expand All @@ -177,4 +182,8 @@ export class IdentityKeys implements IIdentityKeys {
public async getIdentity({ account }: GetIdentityParams): Promise<string> {
return this.identityKeys.get(account).identityKeyPub;
}

public async hasIdentity({ account }: GetIdentityParams): Promise<boolean> {
return this.identityKeys.keys.includes(account);
}
}

0 comments on commit 80d2267

Please sign in to comment.