From 99b801dfb6edcd3b7baaa8108ad361be4e05ff67 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Tue, 9 Jan 2024 09:15:23 +0700 Subject: [PATCH] fix: properly print key class (#1684) Signed-off-by: Timo Glastra --- packages/core/src/crypto/Key.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/core/src/crypto/Key.ts b/packages/core/src/crypto/Key.ts index 2ebe3651f2..ec44eead24 100644 --- a/packages/core/src/crypto/Key.ts +++ b/packages/core/src/crypto/Key.ts @@ -59,4 +59,13 @@ export class Key { public get supportsSigning() { return isSigningSupportedForKeyType(this.keyType) } + + // We return an object structure based on the key, so that when this object is + // serialized to JSON it will be nicely formatted instead of the bytes printed + private toJSON() { + return { + keyType: this.keyType, + publicKeyBase58: this.publicKeyBase58, + } + } }