API Reference
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.
Methods
casperDashHelper.requestConnection()
Requests a connection to the DApp
casperDashHelper.requestSwitchAccount()
Requests to switch connected account
casperDashHelper.isConnected()
Returns true
if the provider is connected to the current chain, and false
otherwise
casperDashHelper.disconnectFromSite()
Requests a disconnection from the Casper Network DApp
casperDashHelper.signMessage()
Suggest that the user sign a message
casperDashHelper.sign()
Suggest that the user sign a deploy
casperDashHelper.getActivePublicKey()
Return the current connected account's public key
Events
connected
disconnected
activeKeyChanged
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.
Last updated