Skip to content

Commit

Permalink
feat: add new DID context definition (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntn-x2 authored Dec 20, 2022
1 parent 55e8311 commit 7666361
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ const DID_RESOLUTION_RESPONSE_MIME =
'application/ld+json;profile="https://w3id.org/did-resolution"'

const DID_DOC_CONTEXT = 'https://www.w3.org/ns/did/v1'
const KILT_DID_CONTEXT = 'ipfs://QmU7QkuTCPz7NmD5bD7Z7mQVz2UsSPaEK58B5sYnjnPRNW'
const DID_RESOLUTION_RESPONSE_CONTEXT = 'https://w3id.org/did-resolution/v1'

module.exports = {
URI_DID,
DID_RESOLUTION_RESPONSE_MIME,
DID_RESOLUTION_RESPONSE_CONTEXT,
DID_DOC_CONTEXT
DID_DOC_CONTEXT,
KILT_DID_CONTEXT
}
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {
URI_DID,
DID_RESOLUTION_RESPONSE_MIME,
DID_DOC_CONTEXT,
KILT_DID_CONTEXT,
DID_RESOLUTION_RESPONSE_CONTEXT
} = require('./consts')

Expand Down Expand Up @@ -96,6 +97,8 @@ async function start() {
resolvedDidDetails.details,
isJsonLd ? 'application/ld+json' : 'application/json'
)
// TODO: This will be added by the SDK automatically once support for the new context is added (most likely 0.30.x).
didResolutionResult.didDocument['@context'].push(KILT_DID_CONTEXT)

if (
hasWeb3Names() &&
Expand Down

0 comments on commit 7666361

Please sign in to comment.