oobRequestPresentation function

OutOfBandMessage oobRequestPresentation({
  1. required PresentationDefinition presentationDefinition,
  2. required String oobId,
  3. required String threadId,
  4. required List<String> replyTo,
  5. required String issuerDid,
  6. required String connectionDid,
  7. required String challenge,
  8. required String domain,
})

Implementation

OutOfBandMessage oobRequestPresentation({
  required PresentationDefinition presentationDefinition,
  required String oobId,
  required String threadId,
  required List<String> replyTo,
  required String issuerDid,
  required String connectionDid,
  required String challenge,
  required String domain,
}) {
  var request = RequestPresentation(
      id: threadId,
      threadId: threadId,
      parentThreadId: threadId,
      from: connectionDid,
      replyTo: replyTo,
      presentationDefinition: [
        PresentationDefinitionWithOptions(
          domain: domain,
          challenge: challenge,
          presentationDefinition: presentationDefinition,
        )
      ]);

  var oob = OutOfBandMessage(
      id: oobId,
      from: connectionDid,
      threadId: threadId,
      goalCode: 'streamlined-vp',
      attachments: [Attachment(data: AttachmentData(json: request.toJson()))],
      replyTo: replyTo);

  return oob;
}