Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need to use the getKeyDidMappingByVerificationMethod method #1256

Closed
TimoGlastra opened this issue Feb 2, 2023 · 0 comments · Fixed by #1350
Closed

Remove the need to use the getKeyDidMappingByVerificationMethod method #1256

TimoGlastra opened this issue Feb 2, 2023 · 0 comments · Fixed by #1350

Comments

@TimoGlastra
Copy link
Contributor

Currently you have to use the getKeyDidMappingByVerificationMethod method to get access to the getKeyFromVerificationMethod method for a specific key type.

However this is a bit verbose and doesn't work nicely for the api.

E.g currently we have to write this:

    const didsApi = agentContext.dependencyManager.resolve(DidsApi)
    const didResult = await didsApi.resolve(`did:sov:${issuerId}`)

    if (!didResult.didDocument) throw new AriesFrameworkError('Unable to resolve did')

    const verificationMethod = didResult.didDocument.dereferenceKey('did:sov:${issuerId}#key-1')
    const { getKeyFromVerificationMethod } = getKeyDidMappingByVerificationMethod(verificationMethod)
    const key = getKeyFromVerificationMethod(verificationMethod)

it would be nice if we can just do this:

    const didsApi = agentContext.dependencyManager.resolve(DidsApi)
    const didResult = await didsApi.resolve(`did:sov:${issuerId}`)

    if (!didResult.didDocument) throw new AriesFrameworkError('Unable to resolve did')

    const verificationMethod = didResult.didDocument.dereferenceKey('did:sov:${issuerId}#key-1')
   const key = getKeyFromVerificationMethod(verificationMethod)

So the getKeyFromVerificationMethod just calls getKeyDidMappingByVerificationMethod internally.

auer-martin added a commit to auer-martin/aries-framework-javascript that referenced this issue Feb 27, 2023
…thod method

Closes openwallet-foundation#1256

Signed-off-by: martin auer <martin.auer97@gmail.com>
auer-martin added a commit to auer-martin/aries-framework-javascript that referenced this issue Feb 28, 2023
…thod method

Closes openwallet-foundation#1256

Signed-off-by: martin auer <martin.auer97@gmail.com>
auer-martin added a commit to auer-martin/aries-framework-javascript that referenced this issue Feb 28, 2023
…thod method

Closes openwallet-foundation#1256

Signed-off-by: martin auer <martin.auer97@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant