From abac1559f1960fd37848271d23dc6f9f49666549 Mon Sep 17 00:00:00 2001 From: SondreB Date: Tue, 12 Nov 2024 09:33:13 +0100 Subject: [PATCH] Add DID lookup --- .../app/settings/debug/debug.component.html | 1 + app/src/app/settings/debug/debug.component.ts | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/app/src/app/settings/debug/debug.component.html b/app/src/app/settings/debug/debug.component.html index 2540c92..b4eefd2 100644 --- a/app/src/app/settings/debug/debug.component.html +++ b/app/src/app/settings/debug/debug.component.html @@ -30,6 +30,7 @@

Debug Tool

+ diff --git a/app/src/app/settings/debug/debug.component.ts b/app/src/app/settings/debug/debug.component.ts index 0c79052..22ae772 100644 --- a/app/src/app/settings/debug/debug.component.ts +++ b/app/src/app/settings/debug/debug.component.ts @@ -263,4 +263,25 @@ export class DebugComponent { this.result = ''; } } + + async resolveDid() { + if (!this.targetDid) { + this.status = 'Error: DID are required'; + return; + } + + try { + const result = await this.identity.web5.did.resolve(this.targetDid); + + if (result) { + // this.status = `${result.code}: ${status.detail}`; + this.result = JSON.stringify(result.didDocument, null, 2); + } else { + this.result = 'Not found'; + } + } catch (error) { + this.status = `Error: ${error}`; + this.result = ''; + } + } }