UI Client interface
These data types are defined in the channel between Clef and the UISignDataRequest
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 themessage
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 acall_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 thetransaction, 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 callclef -> 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:

