diff --git a/packages/credential-sdk/src/types/did/document/index.js b/packages/credential-sdk/src/types/did/document/index.js index 5b908b004..c13492103 100644 --- a/packages/credential-sdk/src/types/did/document/index.js +++ b/packages/credential-sdk/src/types/did/document/index.js @@ -396,7 +396,8 @@ export class CheqdDIDDocument extends TypedStruct { const { verificationMethod } = this; this.verificationMethod = verificationMethod.filter( - (verMethod) => !verMethod.isOffchain(), + (verMethod) => !verMethod.isOffchain() + && !verMethod.publicKeyBytes().every((item) => !item), ); const offchainVerMethod = verificationMethod.filter((verMethod) => verMethod.isOffchain()); @@ -423,14 +424,16 @@ export class CheqdDIDDocument extends TypedStruct { service, } = this; - const assertionMethodOffchainKeys = [...assertionMethod] - .filter((keyRefOrKey) => keyRefOrKey.id); + const assertionMethodOffchainKeys = [...assertionMethod].filter( + (keyRefOrKey) => keyRefOrKey.id, + ); const verificationMethodWithOffchainKeys = [ ...verificationMethod, ...assertionMethodOffchainKeys, ]; - const assertionMethodOnlyRefs = [...assertionMethod] - .map((keyRefOrKey) => keyRefOrKey.id ?? keyRefOrKey); + const assertionMethodOnlyRefs = [...assertionMethod].map( + (keyRefOrKey) => keyRefOrKey.id ?? keyRefOrKey, + ); return new DIDDocument( context,