Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • CommunicationClient
    • P2PCommunicationClient

Index

Constructors

constructor

  • new P2PCommunicationClient(name: string, keyPair: KeyPair, replicationCount: number, storage: Storage, matrixNodes: string[], iconUrl?: string, appUrl?: string): P2PCommunicationClient

Properties

Private Readonly KNOWN_RELAY_SERVERS

KNOWN_RELAY_SERVERS: string[]

Private Readonly activeListeners

activeListeners: Map<string, (event: MatrixClientEvent<any>) => void> = ...

Private client

client: undefined | MatrixClient

Private initialEvent

initialEvent: undefined | MatrixClientEvent<MESSAGE>

Private initialListener

initialListener: undefined | ((event: MatrixClientEvent<MESSAGE>) => void)

Protected Readonly keyPair

keyPair: KeyPair

Readonly replicationCount

replicationCount: number

Methods

Protected createCryptoBox

  • createCryptoBox(otherPublicKey: string, selfPrivateKey: Uint8Array): Promise<[Uint8Array, Uint8Array, Uint8Array]>

Protected createCryptoBoxClient

  • createCryptoBoxClient(otherPublicKey: string, selfPrivateKey: Uint8Array): Promise<CryptoKX>

Protected createCryptoBoxServer

  • createCryptoBoxServer(otherPublicKey: string, selfPrivateKey: Uint8Array): Promise<CryptoKX>

deleteRoomIdFromRooms

  • deleteRoomIdFromRooms(roomId: string): Promise<void>

Protected encryptMessageAsymmetric

  • encryptMessageAsymmetric(recipientPublicKey: string, message: string): Promise<string>

Private getAbsoluteBigIntDifference

  • getAbsoluteBigIntDifference(firstHash: string, secondHash: string): Promise<BigNumber>

getPairingRequestInfo

getPairingResponseInfo

getPublicKey

  • getPublicKey(): Promise<string>

getPublicKeyHash

  • getPublicKeyHash(): Promise<string>

getRelayServer

  • getRelayServer(publicKeyHash?: string, nonce?: string): Promise<string>

Private getRelevantJoinedRoom

  • getRelevantJoinedRoom(recipient: string): Promise<MatrixRoom>

Private getRelevantRoom

  • getRelevantRoom(recipient: string): Promise<string>

isChannelOpenMessage

  • isChannelOpenMessage(content: MatrixClientEventMessageContent<string>): Promise<boolean>

isSender

  • isSender(event: MatrixClientEvent<MESSAGE>, senderPublicKey: string): Promise<boolean>

isTextMessage

  • isTextMessage(content: MatrixClientEventMessageContent<any>): content is MatrixClientEventMessageContent<string>

listenForChannelOpening

listenForEncryptedMessage

  • listenForEncryptedMessage(senderPublicKey: string, messageCallback: (message: string) => void): Promise<void>

sendMessage

sendPairingResponse

start

  • start(): Promise<void>

stop

  • stop(): Promise<void>

tryJoinRooms

  • tryJoinRooms(roomId: string, retry?: number): Promise<void>

unsubscribeFromEncryptedMessage

  • unsubscribeFromEncryptedMessage(senderPublicKey: string): Promise<void>

unsubscribeFromEncryptedMessages

  • unsubscribeFromEncryptedMessages(): Promise<void>

waitForJoin

  • waitForJoin(roomId: string, retry?: number): Promise<void>

Generated using TypeDoc