Type alias Connection

Connection: {
    approximateDistanceInMeters?: number;
    connectionType: ConnectionType;
    id: string;
    peer1: Uint8Array;
    peer2: Uint8Array;
}

Represents a connection between two peers on the Ditto mesh network.

Type declaration

  • Optional approximateDistanceInMeters?: number
  • connectionType: ConnectionType

    Type of transport enabling this connection.

  • id: string

    Unique identifier for the connection.

    These IDs are stable for any two peer keys and a given connection type.

    Example ID

    "1<->2:Bluetooth"

  • peer1: Uint8Array

    Peer key of the peer at one end of the connection.

    This peer key is lexicographically smaller than peer2.

  • peer2: Uint8Array

    Peer key of the peer at the other end of the connection.

    This peer key is lexicographically larger than peer1.