Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

Protected _beaconId

_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.

Protected _keyPair

_keyPair: ExposedPromise<KeyPair, unknown> = ...

The local keypair that is used for the communication encryption

Protected _transport

_transport: ExposedPromise<Transport<any, any, any>, unknown> = ...

Protected Readonly accountManager

accountManager: AccountManager

Optional Readonly appUrl

appUrl: string

The URL of the dApp.

Protected Readonly events

Protected handleResponse

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

Type declaration

Optional Readonly iconUrl

iconUrl: string

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

Protected Readonly matrixNodes

matrixNodes: string[]

Readonly name

name: string

The name of the client

Protected Readonly rateLimit

rateLimit: number = 2

How many requests can be sent after another

Protected Readonly rateLimitWindowInSeconds

rateLimitWindowInSeconds: number = 5

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

Protected requestCounter

requestCounter: number[] = ...

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

Protected storage

storage: Storage

Accessors

beaconId

  • get beaconId(): Promise<string>

connectionStatus

Protected keyPair

  • get keyPair(): Promise<KeyPair>

ready

  • get ready(): Promise<void>

Protected transport

  • get transport(): Promise<Transport<any, any, any>>

Methods

Protected addListener

  • addListener(transport: Transport<any, any, any>): Promise<void>

addPeer

  • addPeer(peer: PeerInfo): Promise<void>

addRequestAndCheckIfRateLimited

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

    Returns Promise<boolean>

destroy

  • destroy(): Promise<void>

getAccount

  • getAccount(accountIdentifier: string): Promise<undefined | AccountInfo>

getAccounts

getOwnAppMetadata

getPeers

init

  • This method initializes the client. It will check if the connection should be established to a browser extension or if the P2P transport should be used.

    Parameters

    • transport: Transport<any, any, any>

      A transport that can be provided by the user

    Returns Promise<TransportType>

removeAccount

  • removeAccount(accountIdentifier: string): Promise<void>
  • Remove the account by ID

    Parameters

    • accountIdentifier: string

      The ID of an account

    Returns Promise<void>

removeAllAccounts

  • removeAllAccounts(): Promise<void>

Protected sendDisconnectToPeer

  • sendDisconnectToPeer(peer: PeerInfo, transport?: Transport<any, any, any>): Promise<void>

Protected setTransport

  • setTransport(transport?: Transport<any, any, any>): Promise<void>

Generated using TypeDoc