Created
May 28, 2020 16:41
-
-
Save OR13/edb40f24a4fffc3bb1a63488163142dc to your computer and use it in GitHub Desktop.
Example DID Resolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface IResolutionResponse { | |
didDocument: Buffer; | |
didDocumentMetaData: any; | |
resolverMetaData: any; | |
} | |
export interface IResolutionOptions {} | |
export const resolveBasic = async ( | |
did: string, | |
options: IResolutionOptions | |
): Promise<IResolutionResponse> => { | |
// gather your response.... | |
const response: any = {}; | |
return response; | |
}; | |
export const resolve = async ( | |
did: string, | |
options: IResolutionOptions | |
): Promise<IResolutionResponse> => { | |
const { didDocument, didDocumentMetaData } = await resolveBasic(did, options); | |
const parsedDidDocument = representation.parse( | |
didDocument, | |
didDocumentMetaData | |
); | |
return parsedDidDocument; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment