34#include "tlv_library.h"
38#include "status_words.h"
41#ifdef HAVE_ADDRESS_BOOK
43ab_payload_u g_ab_payload = {0};
53bool address_book_handle_derivation_path(
const tlv_data_t *data,
path_bip32_t *bip32_path)
57 if (!get_buffer_from_tlv_data(data, &path_buffer, 1,
MAX_BIP32_PATH * 4 + 1)) {
58 PRINTF(
"DERIVATION_PATH: failed to extract\n");
64 PRINTF(
"DERIVATION_PATH: failed to parse BIP32 path\n");
78bool address_book_handle_chain_id(
const tlv_data_t *data, uint64_t *chain_id)
80 if (!get_uint64_t_from_tlv_data(data, chain_id)) {
81 PRINTF(
"CHAIN_ID: failed to extract\n");
94bool address_book_handle_blockchain_family(
const tlv_data_t *data,
blockchain_family_e *family)
97 if (!get_uint8_t_from_tlv_data(data, &value)) {
98 PRINTF(
"UINT8: failed to extract\n");
102 PRINTF(
"BLOCKCHAIN_FAMILY: Value out of range (%d, max %d)!\n", value,
FAMILY_COUNT - 1);
119bool address_book_handle_printable_string(
const tlv_data_t *data,
124 if (!get_string_from_tlv_data(data, output_buffer, 1, buffer_size)) {
125 PRINTF(
"String extraction failed\n");
128 if (!is_printable_string(output_buffer, strlen(output_buffer))) {
129 PRINTF(
"String contains non-printable characters\n");
148 const char *reviewTitle,
149 const char *confirmText,
152 g_ab_ui.list.wrapping =
true;
174 io_send_sw(SWO_INCORRECT_DATA);
191void address_book_finalize_review(
bool success,
192 const char *successMsg,
193 const char *errorMsg,
200 io_send_sw(SWO_INCORRECT_DATA);
bool buffer_get_path_bip32(buffer_t *buffer, path_bip32_t *bip32)
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
API of the Advanced BOLOS Graphical Library, for typical application use-cases.
void(* nbgl_callback_t)(void)
prototype of generic callback function
void(* nbgl_choiceCallback_t)(bool confirm)
prototype of choice callback function
void nbgl_useCaseStatus(const char *message, bool isSuccess, nbgl_callback_t quitCallback)
void nbgl_useCaseReviewLight(nbgl_operationType_t operationType, const nbgl_contentTagValueList_t *tagValueList, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const char *finishTitle, nbgl_choiceCallback_t choiceCallback)
#define ADDRESS_BOOK_OPERATION
This is to use in nbgl_operationType_t when the operation is related to "Address Book" to adapt wordi...
@ TYPE_OPERATION
For other types of operation (generic type)