Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
address_book_entrypoints.h File Reference
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "identity.h"
#include "nbgl_use_case.h"
#include "ledger_account.h"
Include dependency graph for address_book_entrypoints.h:
This graph shows which files directly or indirectly include this file:

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.

Function Documentation

◆ display_register_ledger_account_review()

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).

◆ finalize_ui_edit_contact_name()

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.

◆ finalize_ui_edit_identifier()

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.

◆ finalize_ui_edit_scope()

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.

◆ finalize_ui_ledger_account()

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.

◆ finalize_ui_register_identity()

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.

◆ get_edit_identifier_tagValue()

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:

  • index 0: "Contact name" → contact name (unchanged)
  • index 1: "Old address" → old identifier (hex)
  • index 2: "New address" → new identifier (hex)
  • index 3: "Scope" → contact scope (if non-empty)
  • index 4: "Network" → network of identity.chain_id (Ethereum family only, mandatory) Return NULL for out-of-range indices.
Parameters
[in]pairIndexIndex of the tag-value pair to retrieve (0-based).
Returns
Pointer to the tag-value pair, or NULL if pairIndex is out of range.

◆ get_register_identity_tagValue()

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.

Parameters
[in]pairIndexIndex of the tag-value pair to retrieve (0-based).
Returns
Pointer to the tag-value pair, or NULL if pairIndex is out of range.

◆ handle_check_edit_identifier()

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.

Parameters
[in]paramsContact name, old identifier, and new identity data
Returns
true if the edit is acceptable, false to reject

◆ handle_check_edit_ledger_account()

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.

Parameters
[in,out]paramsParsed edit data; coin app fills params->address
Returns
true if the edit is acceptable, false to reject

◆ handle_check_register_identity()

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.

Parameters
[in]paramsParsed identity data (contact_name, scope, identifier, identifier_len, bip32_path)
Returns
true if the identity is acceptable, false to reject

◆ handle_check_register_ledger_account()

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.

Parameters
[in]paramsParsed ledger account data (account_name, bip32_path, chain_id, blockchain_family)
Returns
true if the account is acceptable, false to reject

◆ handle_provide_identity()

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.

Parameters
[in]contactFully verified identity (name, scope, identifier, identifier_len, blockchain_family, chain_id)
Returns
true if the contact was accepted and stored, false to reject

◆ handle_provide_ledger_account()

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.

Parameters
[in]accountVerified Ledger Account (account_name, bip32_path, chain_id, blockchain_family)
Returns
true if the contact was accepted and stored, false to reject

◆ on_edit_contact_name_applied()

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.

Parameters
[in]editParsed edit data (old_contact_name, contact_name)

◆ on_edit_identifier_applied()

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.

Parameters
[in]editParsed edit data (old_identifier, identity)

◆ on_edit_ledger_account_applied()

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.

Parameters
[in]editParsed edit data (old_account_name, ledger_account)

◆ on_edit_scope_applied()

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.

Parameters
[in]editParsed edit data (old_scope, identity)