UNPKG

@vecrea/oid4vc-prex

Version:

A TypeScript library for handling OpenID for Verifiable Credentials (OID4VC) Presentation Exchange operations

15 lines (14 loc) 843 B
import { PresentationSubmission } from './types'; import { Result } from '@vecrea/oid4vc-core/utils'; export interface JsonParser { /** * Tries to parse the given [jsonString]/[inputStream] into a [PresentationSubmission]. * It is assumed that the [jsonString]/[inputStream] corresponds to a json object that either contains * a Json object under some well known location (embedded locations) or is the [PresentationSubmission] * * @param {string | ReadableStream<Uint8Array>} input the JSON string or stream * @return {Promise<Result<PresentationSubmission>>} the presentation submission * @see https://identity.foundation/presentation-exchange/spec/v2.0.0/#embed-locations */ decodePresentationSubmission(input: string | ReadableStream<Uint8Array>): Promise<Result<PresentationSubmission>>; }