@credo-ts/core
Version:
<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1
35 lines (31 loc) • 804 B
JavaScript
import { DidJwk } from "./DidJwk.mjs";
//#region src/modules/dids/methods/jwk/JwkDidResolver.ts
var JwkDidResolver = class {
constructor() {
this.supportedMethods = ["jwk"];
this.allowsCaching = false;
this.allowsLocalDidRecord = false;
}
async resolve(_agentContext, did) {
const didDocumentMetadata = {};
try {
return {
didDocument: DidJwk.fromDid(did).didDocument,
didDocumentMetadata,
didResolutionMetadata: { contentType: "application/did+ld+json" }
};
} catch (error) {
return {
didDocument: null,
didDocumentMetadata,
didResolutionMetadata: {
error: "notFound",
message: `resolver_error: Unable to resolve did '${did}': ${error}`
}
};
}
}
};
//#endregion
export { JwkDidResolver };
//# sourceMappingURL=JwkDidResolver.mjs.map