The currently active account. For all requests that are associated to a specific request (operation request, signing request), the active account is used to determine the network and destination wallet
The currently active peer. This is used to address a peer in case the active account is not set. (Eg. for permission requests)
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.
The local keypair that is used for the communication encryption
The URL of the dApp.
The block explorer used by the SDK
The URL of the dApp Icon. This can be used to display the icon of the dApp on in the wallet
The name of the client
A map of requests that are currently "open", meaning we have sent them to a wallet and are still awaiting a response.
How many requests can be sent after another
The time window in seconds in which the "rateLimit" is checked
Stores the times when requests have been made to determine if the rate limit has been reached
Returns the connection status of the Client
Returns whether or not the transaport is ready
Adds a requests to the "openRequests" set so we know what messages have already been answered/handled.
The ID of the message
A promise that resolves once the response for that specific message is received
Add a new peer to the known peers
The new peer to add
Add a new request (current timestamp) to the pending requests, remove old ones and check if we are above the limit
Check if we have permissions to send the specific message type to the active account. If no active account is set, only permission requests are allowed.
The type of the message
Clear the active account
Return the account by ID
The ID of an account
Return all locally known accounts
Returns the active account
Returns the metadata of this DApp
Return all known peers
This method handles sending of requests to the DApp. It makes sure that the DAppClient is initialized and connected to the transport. After that rate limits and permissions will be checked, an ID is attached and the request is sent to the DApp over the transport.
The BeaconMessage to be sent to the wallet
This message will send an event when we receive a successful response to one of the requests we sent.
The request we sent
The response we received
Will remove the account from the local storage and set a new active account if necessary.
ID of the account
This method will remove all accounts associated with a specific peer.
An array of peers for which accounts should be removed
Remove all accounts and set active account to undefined
Remove all peers and all accounts that have been connected through those peers
Removes a peer and all the accounts that have been connected through that peer
Peer to be removed
This method sends an OperationRequest to the wallet. This method should be used for all kinds of operations, eg. transaction or delegation. Not all properties have to be provided. Data like "counter" and fees will be fetched and calculated by the wallet (but they can still be provided if required).
The message details we need to prepare the OperationRequest message.
Send a permission request to the DApp. This should be done as the first step. The wallet will respond with an publicKey and permissions that were given. The account returned will be set as the "activeAccount" and will be used for the following requests.
The message details we need to prepare the PermissionRequest message.
This method will send a "SignPayloadRequest" to the wallet. This method is meant to be used to sign arbitrary data (eg. a string). It will return the signature in the format of "edsig..."
The message details we need to prepare the SignPayloadRequest message.
This method will emit an internal error message.
The error message to send.
Sets the active account
The account that will be set as the active account
A "setter" for when the transport needs to be changed.
Allows the user to subscribe to specific events that are fired in the SDK
The event to subscribe to
The callback that will be called when the event occurs
Generated using TypeDoc