URL of the query endpoint.
VP Request object, compliant with https://w3c-ccg.github.io/vp-request-spec
Options object, including an authenticated fetch.
Optionalfetch?: {Optionalnormalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBaseThe resulting Verifiable Presentation wrapping all the Credentials matching the query.
a reason to the request is helpful when interacting with a user. The resulting Verifiable Presentation will wrap zero or more Verifiable Credentials.
const verifiablePresentation = await query(
"https://example.org/query", {
query: [{
type: "QueryByExample",
credentialQuery: [
{
reason: "Some reason",
example: {
type: ["SomeCredentialType"],
},
},
],
}]
},
{ fetch: session.fetch }
);
Optionaloptions: ParseOptions & {Optionalfetch?: {Optionalnormalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBaseOptionalreturnLegacyJsonld?: trueOptionaloptions: ParseOptions & {Optionalfetch?: {Optionalnormalize?: (vc: VerifiableCredentialBase) => VerifiableCredentialBaseOptionalreturnLegacyJsonld?: boolean
Send a Verifiable Presentation Request to a query endpoint in order to retrieve all Verifiable Credentials matching the query, wrapped in a single Presentation.