diff --git a/src/main/kotlin/com/rootsid/wal/library/DLT.kt b/src/main/kotlin/com/rootsid/wal/library/DLT.kt index 6d53667..c245e42 100644 --- a/src/main/kotlin/com/rootsid/wal/library/DLT.kt +++ b/src/main/kotlin/com/rootsid/wal/library/DLT.kt @@ -23,6 +23,7 @@ import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import pbandk.ByteArr +import pbandk.json.encodeToJsonString /** * Transaction id @@ -225,6 +226,11 @@ fun getDidDocument(wallet: Wallet, didAlias: String): PrismDidState { } } +@OptIn(PrismSdkInternal::class) +fun getDidDocumentJson(wallet: Wallet, didAlias: String): String { + return getDidDocument(wallet, didAlias).didData.toProto().encodeToJsonString() +} + /** * Publish did * @@ -571,7 +577,7 @@ fun verifyIssuedCredential(wallet: Wallet, credentialAlias: String): List { val messages = mutableListOf() - for(message in this.verificationErrors) { + for (message in this.verificationErrors) { messages.add(message.errorMessage) } return messages