diff --git a/src/modules/did.ts b/src/modules/did.ts index 981e12b..9f35c75 100644 --- a/src/modules/did.ts +++ b/src/modules/did.ts @@ -10,6 +10,7 @@ import { SpecValidationResult, VerificationMethods, DIDDocumentWithMetadata, + ServiceType, } from '../types'; import { MsgCreateDidDoc, @@ -45,6 +46,7 @@ export const contexts = { W3CSuiteEd255192020: 'https://w3id.org/security/suites/ed25519-2020/v1', W3CSuiteEd255192018: 'https://w3id.org/security/suites/ed25519-2018/v1', W3CSuiteJws2020: 'https://w3id.org/security/suites/jws-2020/v1', + LinkedDomainsContext: 'https://identity.foundation/.well-known/did-configuration/v1', } as const; export const protobufLiterals = { @@ -549,6 +551,9 @@ export class DIDModule extends AbstractCheqdSDKModule { }); const service = protobufDidDocument.service.map((s) => { + if (s.serviceType === ServiceType.LinkedDomains) + protobufDidDocument.context = [...protobufDidDocument.context, contexts.LinkedDomainsContext]; + return { id: s.id, type: s.serviceType, diff --git a/src/types.ts b/src/types.ts index b1e89b3..8f016de 100644 --- a/src/types.ts +++ b/src/types.ts @@ -102,3 +102,7 @@ export const ISignInputs = { return object.some((x) => 'privateKeyHex' in x); }, }; + +export enum ServiceType { + LinkedDomains = 'LinkedDomains', +}