Class MessageBasedClientAbstract

Internalapi

Hierarchy

Constructors

Properties

activeListeners: Map<string, unknown>

The listeners that will be notified of new messages

eventHandlers: Map<ClientEvents, Function>
isMobileOS: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

keyPair?: KeyPair
name: string

Methods

  • Create a cryptobox client

    Parameters

    • otherPublicKey: string
    • selfKeypair: KeyPair

    Returns Promise<SessionKeys>

  • Create a cryptobox server

    Parameters

    • otherPublicKey: string
    • selfKeypair: KeyPair

    Returns Promise<SessionKeys>

  • Decrypt a message from a specific peer

    Parameters

    • senderPublicKey: string
    • payload: string

    Returns Promise<string>

  • Encrypt a message for a specific publicKey (receiver)

    Parameters

    • recipientPublicKey: string
    • message: string

    Returns Promise<string>

  • Encrypt a message for a specific publicKey (receiver, asymmetric)

    Parameters

    • recipientPublicKey: string
    • message: string

    Returns Promise<string>

  • Get the pairing request information. This will be shared with the peer during the connection setup

    Returns Promise<PostMessagePairingRequest>

  • Get the public key

    Returns Promise<string>

  • get the public key hash

    Returns Promise<string>

  • Initialize the connection

    Returns Promise<void>

  • Parameters

    Returns Promise<void>

  • start the client and make sure all dependencies are ready

    Returns Promise<void>

  • Unsubscribe from encrypted messages from a specific peer

    Parameters

    • senderPublicKey: string

    Returns Promise<void>

Generated using TypeDoc