Datatypes
UI Client interface
These data types are defined in the channel between Clef and the UI
SignDataRequest
SignDataRequest contains information about a pending request to sign some data. The data to be signed can be of various types, defined by content-type. Clef has done most of the work in canonicalizing and making sense of the data, and it's up to the UI to present the user with the contents of the message
Example:
SignDataResponse - approve
Response to SignDataRequest
Example:
SignDataResponse - deny
Response to SignDataRequest
Example:
SignTxRequest
SignTxRequest contains information about a pending request to sign a transaction. Aside from the transaction itself, there is also a call_info
-struct. That struct contains messages of various types, that the user should be informed of.
As in any request, it's important to consider that the meta
info also contains untrusted data.
The transaction
(on input into clef) can have either data
or input
-- if both are set, they must be identical, otherwise an error is generated. However, Clef will always use data when passing this struct on (if Clef does otherwise, please file a ticket)
Example:
SignTxResponse - approve
Response to request to sign a transaction. This response needs to contain the transaction
, because the UI is free to make modifications to the transaction.
Example:
SignTxResponse - deny
Response to SignTxRequest. When denying a request, there's no need to provide the transaction in return
Example:
OnApproved - SignTransactionResult
SignTransactionResult is used in the call clef
-> OnApprovedTx(result)
This occurs after successful completion of the entire signing procedure, but right before the signed transaction is passed to the external caller. This method (and data) can be used by the UI to signal to the user that the transaction was signed, but it is primarily useful for ruleset implementations.
A ruleset that implements a rate limitation needs to know what transactions are sent out to the external interface. By hooking into this methods, the ruleset can maintain track of that count.
OBS: Note that if an attacker can restore your clef data to a previous point in time (e.g through a backup), the attacker can reset such windows, even if he/she is unable to decrypt the content.
The OnApproved method cannot be responded to, it's purely informative
Example:
UserInputRequest
Sent when clef needs the user to provide data. If 'password' is true, the input field should be treated accordingly (echo-free)
Example:
UserInputResponse
Response to UserInputRequest
Example:
ListRequest
Sent when a request has been made to list addresses. The UI is provided with the full accounts, including local directory names. Note: this information is not passed back to the external caller, who only sees the addresses.
Example:
ListResponse
Response to list request. The response contains a list of all addresses to show to the caller. Note: the UI is free to respond with any address the caller, regardless of whether it exists or not
Example:
Last updated