45typedef enum swap_error_common_code_e {
46 SWAP_EC_ERROR_INTERNAL = 0x00,
47 SWAP_EC_ERROR_WRONG_AMOUNT = 0x01,
48 SWAP_EC_ERROR_WRONG_DESTINATION = 0x02,
49 SWAP_EC_ERROR_WRONG_FEES = 0x03,
50 SWAP_EC_ERROR_WRONG_METHOD = 0x04,
51 SWAP_EC_ERROR_CROSSCHAIN_WRONG_MODE = 0x05,
52 SWAP_EC_ERROR_CROSSCHAIN_WRONG_METHOD = 0x06,
53 SWAP_EC_ERROR_CROSSCHAIN_WRONG_HASH = 0x07,
54 SWAP_EC_ERROR_GENERIC = 0xFF,
55} swap_error_common_code_t;
65 uint8_t application_specific_error_code);
76 uint8_t application_specific_error_code,
87#define SWAP_ERROR_HELPER_MAX_BUFFER_COUNT 8
90 uint8_t application_specific_error_code,
107#define send_swap_error_with_string( \
108 status_word, common_error_code, application_specific_error_code, format, ...) \
111 char format_buffer[sizeof(G_io_apdu_buffer) - sizeof(status_word) - 2] = {0}; \
114 snprintf(format_buffer, sizeof(format_buffer), format, ##__VA_ARGS__); \
115 PRINTF("send_swap_error_with_string %s\n", format_buffer); \
116 buffer_t string_buffer; \
117 string_buffer.ptr = (uint8_t *) &format_buffer; \
118 string_buffer.size = strnlen(format_buffer, sizeof(format_buffer)); \
119 string_buffer.offset = 0; \
120 send_swap_error_with_buffers( \
121 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