API Reference
Last updated
Last updated
CasperDash injects a global API into websites visited by its users at window.casperDashHelper
. This API allows websites to request users' Casper accounts, read data from blockchains the user is connected to, and suggest that the user sign messages and transactions.
Requests a connection to the DApp
Requests to switch connected account
Returns true
if the provider is connected to the current chain, and false
otherwise
Requests a disconnection from the Casper Network DApp
Suggest that the user sign a message
Suggest that the user sign a deploy
Return the current connected account's public key
The CasperDash provider emits this event whenever the return value of the activeKey
changes. This means that activeKeyChanged
will be emitted whenever the user's exposed account address changes.
The CasperDash provider emits this event when it first becomes able to submit RPC requests to a chain. We recommend using a connect
event handler and the in order to determine when/if the provider is connected.
The CasperDash provider emits this event if it becomes unable to submit RPC requests to any chain. In general, this will only happen due to network connectivity issues, some unforeseen error or DApp invokes method.