Documentation
    Preparing search index...

    Class ClientAbstract

    This abstract class handles the a big part of the logic that is shared between the dapp and wallet client. For example, it selects and manages the transport and accounts.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _beaconId: ExposedPromise<string> = ...

    The beaconId is a public key that is used to identify one specific application (dapp or wallet). This is used inside a message to specify the sender, for example.

    _keyPair: ExposedPromise<KeyPair> = ...

    The local keypair that is used for the communication encryption

    _transport: ExposedPromise<Transport<any, any, any>> = ...
    accountManager: AccountManager
    appUrl?: string

    The URL of the dApp.

    handleResponse: (
        _event: BeaconRequestMessage | BeaconMessageWrapper<BeaconBaseMessage>,
        connectionInfo: ConnectionContext,
    ) => void
    iconUrl?: string

    The URL of the dApp Icon. This can be used to display the icon of the dApp on in the wallet

    matrixNodes: NodeDistributions
    name: string

    The name of the client

    rateLimit: number = 2

    How many requests can be sent after another

    rateLimitWindowInSeconds: number = 5

    The time window in seconds in which the "rateLimit" is checked

    requestCounter: number[] = []

    Stores the times when requests have been made to determine if the rate limit has been reached

    storage: Storage

    Accessors

    Methods

    • Add a new request (current timestamp) to the pending requests, remove old ones and check if we are above the limit

      Returns Promise<boolean>