|
Embedded SDK
Embedded SDK
|
#include <stddef.h>#include <stdbool.h>#include <stdint.h>#include "identity.h"#include "nbgl_use_case.h"#include "ledger_account.h"

Go to the source code of this file.
Functions | |
| bool | handle_check_register_identity (identity_t *params) |
| Handle called to validate the received Identity. | |
| void | finalize_ui_register_identity (void) |
| Handle called to finalize the UI flow for registering an Identity. | |
| nbgl_contentTagValue_t * | get_register_identity_tagValue (uint8_t pairIndex) |
| Callback to retrieve a tag-value pair for the Register Identity UI. | |
| void | finalize_ui_edit_contact_name (void) |
| Handle called to finalize the UI flow for editing a contact name. | |
| void | on_edit_contact_name_applied (const edit_contact_name_t *edit) |
| Notification that a contact name edit was successfully applied. | |
| bool | handle_check_edit_identifier (const edit_identifier_t *params) |
| Handle called to validate and store the Edit Identifier parameters. | |
| nbgl_contentTagValue_t * | get_edit_identifier_tagValue (uint8_t pairIndex) |
| Callback to retrieve a tag-value pair for the Edit Identifier UI. | |
| void | finalize_ui_edit_identifier (void) |
| Handle called to finalize the UI flow for editing an Identifier. | |
| void | on_edit_identifier_applied (const edit_identifier_t *edit) |
| Notification that an identifier edit was successfully applied. | |
| void | finalize_ui_edit_scope (void) |
| Handle called to finalize the UI flow for editing a scope. | |
| void | on_edit_scope_applied (const edit_scope_t *edit) |
| Notification that a scope edit was successfully applied. | |
| bool | handle_provide_identity (const identity_t *contact) |
| Handle called to store a verified contact. | |
| bool | handle_check_register_ledger_account (ledger_account_t *params) |
| Handle called to validate the received Ledger Account. | |
| void | display_register_ledger_account_review (nbgl_choiceCallback_t choice_callback) |
| Handle called to display the Ledger Account registration review screen. | |
| void | finalize_ui_ledger_account (void) |
| Handle called to finalize the UI flow for a Ledger Account operation. | |
| bool | handle_check_edit_ledger_account (edit_ledger_account_t *params) |
| Handle called to validate the Edit Ledger Account parameters. | |
| void | on_edit_ledger_account_applied (const edit_ledger_account_t *edit) |
| Notification that a Ledger Account edit was successfully applied. | |
| bool | handle_provide_ledger_account (const ledger_account_t *account) |
| Handle called to store a verified Ledger Account contact. | |
| void display_register_ledger_account_review | ( | nbgl_choiceCallback_t | choice_callback | ) |
Handle called to display the Ledger Account registration review screen.
Called after handle_check_register_ledger_account() succeeds. The app must display the review UI and invoke choice_callback on confirmation or rejection. The app owns the UI flow from this point and is responsible for adapting the display to the target device (touch vs Nano).
| void finalize_ui_edit_contact_name | ( | void | ) |
Handle called to finalize the UI flow for editing a contact name.
Called after the user has confirmed or rejected the edit. The new HMAC proof has already been sent to the host at this point. The app should release any UI resources and return the device to idle.
| void finalize_ui_edit_identifier | ( | void | ) |
Handle called to finalize the UI flow for editing an Identifier.
Called after the user has confirmed or rejected the edit. The new HMAC proof has already been sent to the host at this point. The app should release any UI resources and return the device to idle.
| void finalize_ui_edit_scope | ( | void | ) |
Handle called to finalize the UI flow for editing a scope.
Called after the user has confirmed or rejected the edit. The new HMAC proof has already been sent to the host at this point. The app should release any UI resources and return the device to idle.
| void finalize_ui_ledger_account | ( | void | ) |
Handle called to finalize the UI flow for a Ledger Account operation.
Shared by the Register and Edit flows (they use the same review UI). Called after the user has confirmed or rejected the operation; the HMAC proof has already been sent to the host at this point. The app should release any UI resources and return the device to idle.
| void finalize_ui_register_identity | ( | void | ) |
Handle called to finalize the UI flow for registering an Identity.
Called after the user has confirmed or rejected the registration. The HMAC proof has already been sent to the host at this point. The app should release any UI resources and return the device to idle.
| nbgl_contentTagValue_t * get_edit_identifier_tagValue | ( | uint8_t | pairIndex | ) |
Callback to retrieve a tag-value pair for the Edit Identifier UI.
Called by NBGL during the review flow to populate the display. Typical mapping:
| [in] | pairIndex | Index of the tag-value pair to retrieve (0-based). |
| nbgl_contentTagValue_t * get_register_identity_tagValue | ( | uint8_t | pairIndex | ) |
Callback to retrieve a tag-value pair for the Register Identity UI.
Called by NBGL during the review flow to populate the display. Typical mapping: index 0 = contact name, index 1 = identifier (hex or string). Return NULL for out-of-range indices to signal the end of the list.
| [in] | pairIndex | Index of the tag-value pair to retrieve (0-based). |
| bool handle_check_edit_identifier | ( | const edit_identifier_t * | params | ) |
Handle called to validate and store the Edit Identifier parameters.
Called after TLV parsing and HMAC proof verification, before displaying the review UI. The coin app should validate the new identifier (e.g. checksum, encoding) and copy the data it needs for display. Return false to reject and abort the flow.
| [in] | params | Contact name, old identifier, and new identity data |
| bool handle_check_edit_ledger_account | ( | edit_ledger_account_t * | params | ) |
Handle called to validate the Edit Ledger Account parameters.
Called after TLV parsing and HMAC proof verification, before displaying the review UI. The coin app must derive the Ethereum address from params->ledger_account.bip32_path and store it in params->address so that on_edit_ledger_account_applied() can locate the cache entry without re-deriving. Return false to reject and abort the edit flow.
| [in,out] | params | Parsed edit data; coin app fills params->address |
| bool handle_check_register_identity | ( | identity_t * | params | ) |
Handle called to validate the received Identity.
Called after TLV parsing, before displaying to the user. The coin app may perform chain-specific validation of the identifier (e.g. checksum, encoding). Return false to reject and abort the flow.
| [in] | params | Parsed identity data (contact_name, scope, identifier, identifier_len, bip32_path) |
| bool handle_check_register_ledger_account | ( | ledger_account_t * | params | ) |
Handle called to validate the received Ledger Account.
Called after TLV parsing, before displaying to the user. The coin app must verify that the BIP32 derivation path and chain parameters correspond to a valid account on the chain. Return false to reject and abort the registration flow.
| [in] | params | Parsed ledger account data (account_name, bip32_path, chain_id, blockchain_family) |
| bool handle_provide_identity | ( | const identity_t * | contact | ) |
Handle called to store a verified contact.
Called after TLV parsing and full HMAC verification (group_handle, HMAC_PROOF, HMAC_REST). No UI is shown; the app must store the contact for later use (e.g. address substitution during transaction review). Return false to reject the contact and abort the command with an error.
| [in] | contact | Fully verified identity (name, scope, identifier, identifier_len, blockchain_family, chain_id) |
| bool handle_provide_ledger_account | ( | const ledger_account_t * | account | ) |
Handle called to store a verified Ledger Account contact.
Called after TLV parsing and HMAC Proof of Registration verification. No UI is shown; the app must derive the address from the BIP32 path and store the contact for later use (e.g. address substitution during transaction review). Return false to reject and abort with an error.
| [in] | account | Verified Ledger Account (account_name, bip32_path, chain_id, blockchain_family) |
| void on_edit_contact_name_applied | ( | const edit_contact_name_t * | edit | ) |
Notification that a contact name edit was successfully applied.
Called only when the user confirmed the edit and the new HMAC proof was successfully sent to the host. The app should use this to update in place all cached contacts whose name matches edit->old_contact_name, replacing it with edit->contact_name so that no re-provide is needed.
| [in] | edit | Parsed edit data (old_contact_name, contact_name) |
| void on_edit_identifier_applied | ( | const edit_identifier_t * | edit | ) |
Notification that an identifier edit was successfully applied.
Called only when the user confirmed the edit and the new HMAC proof was successfully sent to the host. The app should use this to update in place the cached contact entry for (edit->old_identifier, edit->identity.chain_id), replacing the identifier with edit->identity.identifier so that no re-provide is needed.
| [in] | edit | Parsed edit data (old_identifier, identity) |
| void on_edit_ledger_account_applied | ( | const edit_ledger_account_t * | edit | ) |
Notification that a Ledger Account edit was successfully applied.
Called only when the user confirmed the edit and the new HMAC proof was successfully sent to the host. The app should use this to update in place the cached Ledger Account contact derived from edit->ledger_account, replacing the account name with edit->ledger_account.account_name so that no re-provide is needed.
| [in] | edit | Parsed edit data (old_account_name, ledger_account) |
| void on_edit_scope_applied | ( | const edit_scope_t * | edit | ) |
Notification that a scope edit was successfully applied.
Called only when the user confirmed the edit and the new HMAC proof was successfully sent to the host. The app should use this to update in place the cached contact entry for (edit->identity.identifier, edit->identity.chain_id), replacing the scope with edit->identity.scope so that no re-provide is needed.
| [in] | edit | Parsed edit data (old_scope, identity) |