Skip to content

Instantly share code, notes, and snippets.

@OR13
Created May 28, 2020 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OR13/edb40f24a4fffc3bb1a63488163142dc to your computer and use it in GitHub Desktop.
Save OR13/edb40f24a4fffc3bb1a63488163142dc to your computer and use it in GitHub Desktop.
Example DID Resolution
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