61typedef enum swap_error_common_code_e {
62 SWAP_EC_ERROR_INTERNAL = 0x00,
63 SWAP_EC_ERROR_WRONG_AMOUNT = 0x01,
64 SWAP_EC_ERROR_WRONG_DESTINATION = 0x02,
65 SWAP_EC_ERROR_WRONG_FEES = 0x03,
66 SWAP_EC_ERROR_WRONG_METHOD = 0x04,
67 SWAP_EC_ERROR_CROSSCHAIN_WRONG_MODE = 0x05,
68 SWAP_EC_ERROR_CROSSCHAIN_WRONG_METHOD = 0x06,
69 SWAP_EC_ERROR_CROSSCHAIN_WRONG_HASH = 0x07,
70 SWAP_EC_ERROR_GENERIC = 0xFF,
71} swap_error_common_code_t;
81__attribute__((noreturn))
void send_swap_error_simple(uint16_t status_word,
82 uint8_t common_error_code,
83 uint8_t application_specific_error_code);
93__attribute__((noreturn))
void send_swap_error_with_buffer(uint16_t status_word,
94 uint8_t common_error_code,
95 uint8_t application_specific_error_code,
107#define SWAP_ERROR_HELPER_MAX_BUFFER_COUNT 8
108__attribute__((noreturn))
void send_swap_error_with_buffers(uint16_t status_word,
109 uint8_t common_error_code,
110 uint8_t application_specific_error_code,
128#define send_swap_error_with_string( \
129 status_word, common_error_code, application_specific_error_code, format, ...) \
132 char format_buffer[sizeof(G_io_apdu_buffer) - sizeof(status_word) - 2] = {0}; \
135 snprintf(format_buffer, sizeof(format_buffer), format, ##__VA_ARGS__); \
136 PRINTF("send_swap_error_with_string %s\n", format_buffer); \
137 buffer_t string_buffer; \
138 string_buffer.ptr = (uint8_t *) &format_buffer; \
139 string_buffer.size = strnlen(format_buffer, sizeof(format_buffer)); \
140 string_buffer.offset = 0; \
141 send_swap_error_with_buffers( \
142 status_word, common_error_code, application_specific_error_code, &string_buffer, 1); \
__attribute__((section("._nbgl_fonts_"))) const
return the non-unicode font corresponding to the given font ID