From 2c35fdc6c50895552a58a86ccb8cc383424308ee Mon Sep 17 00:00:00 2001 From: DaevMithran Date: Tue, 10 Sep 2024 17:29:24 +0530 Subject: [PATCH] fix: Add LinkedDomain jsonld context in querier --- src/modules/did.ts | 5 +++++ src/types.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/modules/did.ts b/src/modules/did.ts index 981e12b..e201271 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', + DIFDIDConfiguration: '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.DIFDIDConfiguration]; + 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', +}