aries / net.globalid.aries.features.connection / DefaultConnectionService / createRequest

createRequest

open fun createRequest(agent: Agent, recordId: String): Single<Pair<SentRequest, ConnectionRequestMessage>>

See ConnectionService.createRequest.

Creates a request for a given record. If the record is in the ReceivedInvitation state, we transition to the SentRequest state and then create the message. If we are already in the SentRequest state, we only (re)create the message. In any other state, we cannot create a request, so we throw an exception.

The connection request message is used to communicate our DidDoc to the inviter. Based on the contents, the inviter will either accept or reject the connection request. If the request fails for some reason, we can construct a new one by calling this function again.