This class manages IoM requests.

The IoM Request is exchanged using IoMRequest objects that are locally registered at the IoMRequestRegistry.

The class allows you to create an IoMRequest that is distributed to the other participants. They are then notified through the onNewRequest event and can affirm the request. Affirmation works by creating an affirmation certificate that is then distributed back to all other participants.

TODO:

  • At the moment we cannot decline the request, only ignore it.
  • At the moment you should only create 1:1 requests, because if you have more participants the synchronization between all participants is complicated. Therefore we might remove support for multiple participants in the future when adding the ability to decline requests.

Constructors

Properties

onError: OEvent<((message: any) => void)> = ...
onNewRequest: OEvent<((requestHash: SHA256Hash<IoMRequest>, request: IoMRequest) => void)> = ...
onRequestComplete: OEvent<((requestHash: SHA256Hash<IoMRequest>, request: IoMRequest) => void)> = ...
onRequestUpdate: OEvent<((requestHash: SHA256Hash<IoMRequest>, request: IoMRequest) => void)> = ...

Methods

  • Creates a new IoM request.

    Parameters

    • initiator: SHA256IdHash<Person>

      The person who initiated the request

    • mainId: SHA256IdHash<Person>

      The identity that becomes the main identity on both sides

    • alternateId: SHA256IdHash<Person>

      The identity that will become an alternate identity (not main)

    • mode: "full" | "light" = 'full'

      'full' means that both identities will get private keys on both sides 'light' means that only the main identity will get private keys on both sides

    Returns Promise<void>