I noticed that the types for the resolve method on CompositeDidDocumentResolver does not accept any input did, and isDid returns an incompatible type:
import { isDid } from "@atcute/lexicons/syntax";
import {
CompositeDidDocumentResolver,
PlcDidDocumentResolver,
WebDidDocumentResolver,
} from "@atcute/identity-resolver";
const argv = process.argv.slice(2);
const did = isDid(argv[0])
const didResolver = new CompositeDidDocumentResolver({
methods: {
plc: new PlcDidDocumentResolver(),
web: new WebDidDocumentResolver(),
},
})
didResolver.resolve(did) // Type Error: Type '`did:${string}:${string}`' is not assignable to type '`did:plc:${string}` | `did:web:${string}` | undefined'.
Perhaps there should be a isAtDid or something that narrows to did:plc: or did:web:? I can of course cast to AtprotoDid fine too, but it was a little unexpected when working with the atcute APIs.
I noticed that the types for the
resolvemethod on CompositeDidDocumentResolver does not accept any input did, andisDidreturns an incompatible type:Perhaps there should be a
isAtDidor something that narrows todid:plc:ordid:web:? I can of course cast toAtprotoDidfine too, but it was a little unexpected when working with the atcute APIs.