diff --git a/src/polygon-did-registrar.ts b/src/polygon-did-registrar.ts index e665a35..7b6abb0 100644 --- a/src/polygon-did-registrar.ts +++ b/src/polygon-did-registrar.ts @@ -18,7 +18,10 @@ export async function wrapDidDocument( serviceEndpoint?: string, ) { return { - '@context': 'https://w3id.org/did/v1', + '@context': [ + 'https://w3id.org/did/v1', + 'https://w3id.org/security/suites/secp256k1-2019/v1', + ], id: did, verificationMethod: [ { diff --git a/src/polygon-did-update.ts b/src/polygon-did-update.ts index 79e78d2..10e3295 100644 --- a/src/polygon-did-update.ts +++ b/src/polygon-did-update.ts @@ -35,6 +35,7 @@ export async function updateDidDoc( if (!didDoc && !JSON.parse(didDoc)) { throw new Error('Invalid DID has been entered!') } + const didDocJson = JSON.parse(didDoc) if ( @@ -46,10 +47,7 @@ export async function updateDidDoc( } // Calling smart contract with update DID document on matic chain - const txnHash = await registry.updateDIDDoc( - parsedDid.didAddress, - didDocJson, - ) + const txnHash = await registry.updateDIDDoc(parsedDid.didAddress, didDoc) return BaseResponse.from(txnHash, 'Update DID document successfully') } catch (error) { diff --git a/src/registrar.ts b/src/registrar.ts index 3b06fcc..5102068 100644 --- a/src/registrar.ts +++ b/src/registrar.ts @@ -122,7 +122,7 @@ export class PolygonDID { // Calling smart contract with update DID document on matic chain const txnHash = await this.registry.updateDIDDoc( parsedDid.didAddress, - didDocJson, + didDoc, ) return {