Internalapi

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

Constructors

Properties

_beaconId: ExposedPromise<string, unknown> = ...

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, unknown> = ...

The local keypair that is used for the communication encryption

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

The URL of the dApp.

handleResponse: ((_event, connectionInfo) => void)

Type declaration

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
transportListeners: Map<TransportType, ((message, connectionInfo) => Promise<void>)> = ...

Type declaration

    • (message, connectionInfo): Promise<void>
    • Parameters

      Returns Promise<void>

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>

Generated using TypeDoc