Skip to content

Commit

Permalink
fix: Add LinkedDomain jsonld context in querier (#382)
Browse files Browse the repository at this point in the history
* fix: Add LinkedDomain jsonld context in querier

* Update did.ts

---------

Co-authored-by: Ankur Banerjee <[email protected]>
  • Loading branch information
DaevMithran and ankurdotb authored Sep 10, 2024
1 parent 6be4456 commit 0653e9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/did.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SpecValidationResult,
VerificationMethods,
DIDDocumentWithMetadata,
ServiceType,
} from '../types';
import {
MsgCreateDidDoc,
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ export const ISignInputs = {
return object.some((x) => 'privateKeyHex' in x);
},
};

export enum ServiceType {
LinkedDomains = 'LinkedDomains',
}

0 comments on commit 0653e9d

Please sign in to comment.