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

Represents a connection between two peers in a Ditto mesh network.

Type declaration

  • Optional approximateDistanceInMeters?: number
  • connectionType: ConnectionType

    Type of transport enabling this connection.

  • id: string

    Unique identifier for the connection.

    This ID is deterministic for any two peers 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.

    Deprecated

    Use peerKeyString1 instead.

  • peer2: Uint8Array

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

    This peer key is lexicographically larger than peer1.

    Deprecated

    Use peerKeyString2 instead.

  • peerKeyString1: string

    The peer key of the peer at one end of the connection, as a string.

    The assignment to peerKeyString1 and peerKeyString2 is deterministic and stable for any two peers.

  • peerKeyString2: string

    The peer key of the peer at the other end of the connection, as a string.

    The assignment to peerKeyString1 and peerKeyString2 is deterministic and stable for any two peers.