import { Connection } from './ConnectionInterface' ; import { InvitationDetails } from './InvitationInterface' ; import { MessageType } from '../../utils/MessageType' ; import { v4 as uuidv4 } from 'uuid' ; type Did = string ; type Verkey = string ; export async function createInvitationMessage ( { label , serviceEndpoint , recipientKeys , routingKeys , } ) { return { '@type' : MessageType . ConnectionInvitation , '@id' : uuidv4 ( ) , label , recipientKeys , serviceEndpoint , routingKeys , } ; } export function createConnectionRequestMessage ( connection , label , logo ) { return { '@type' : MessageType . ConnectionRequest , '@id' : uuidv4 ( ) , label : label , logo : logo , connection : { DID : connection . did , DIDDoc : connection . didDoc , } , } ; } export function createConnectionResponseMessage ( connection , thid ) { return { '@type' : MessageType . ConnectionResponse , '@id' : uuidv4 ( ) , '~thread' : { thid , } , connection : { DID : connection . did , DIDDoc : connection . didDoc , } , } ; } export function createAckMessage ( threadId ) { return { '@type' : MessageType . Ack , '@id' : uuidv4 ( ) , status : 'OK' , '~thread' : { thid : threadId , } , } ; } export function createForwardMessage ( to , msg ) { const forwardMessage = { '@type' : MessageType . ForwardMessage , to , msg , } ; return forwardMessage ; }