Construct a bitclout identity that can sign transactions using the BitClout identity service embedded in an iframe. You must first authenticate the user using WebAccount.loginUser, then pass the public key and account added to this constructor.
The public key of the user.
The identity service payload object for the user
The iframe element of the embedded identity service
Public key shown on account's bitclout profile
Sign user out (opens another window). Instance will no longer work after calling this.
Posts a message to the identity service iframe. Learn more.
The message (in JSON format). Must contain an id
if a response is expected (see WebAccount.waitForResponse)
Sends a request to the embedded identity service for a signed JWT. Throws a SigningError if the response doesn't contain a JWT.
A JWT signed with the user's private key, which can be used to authenticate them to the backend.
First, sends a request to the embedded iframe containing the account data and unsugned transaction hex, then waits for a response. If the response contains a signed hex, it's returned. Otherwise, it opens a new window to ask the user for approval to sign the transaction. If neither method succeeds, it throws a SigningError
The unsigned transaction hex
If true, a SigningError will be thrown immediately without opening an approval window if the initial response doesn't contain a signed transaction
The signed transaction hex
Open a window for the user to login to their BitClout account (learn more).
Which access level to authorize. Learn more.
An object of authenticated users' credentials. You can pass the returned public key and account data to the constructor.
Waits for a message from the identity service, and returns the first one that matches the supplied ID
The ID sent with the request (or leave empty to return the first message recieved)
The response data
Generated using TypeDoc
Can be used client-side to interact with the BitClout identity service. This is