57typedef enum swap_error_common_code_e {
58 SWAP_EC_ERROR_INTERNAL = 0x00,
59 SWAP_EC_ERROR_WRONG_AMOUNT = 0x01,
60 SWAP_EC_ERROR_WRONG_DESTINATION = 0x02,
61 SWAP_EC_ERROR_WRONG_FEES = 0x03,
62 SWAP_EC_ERROR_WRONG_METHOD = 0x04,
63 SWAP_EC_ERROR_CROSSCHAIN_WRONG_MODE = 0x05,
64 SWAP_EC_ERROR_CROSSCHAIN_WRONG_METHOD = 0x06,
65 SWAP_EC_ERROR_CROSSCHAIN_WRONG_HASH = 0x07,
66 SWAP_EC_ERROR_GENERIC = 0xFF,
67} swap_error_common_code_t;
79 uint8_t application_specific_error_code);
91 uint8_t application_specific_error_code,
103#define SWAP_ERROR_HELPER_MAX_BUFFER_COUNT 8
106 uint8_t application_specific_error_code,
124#define send_swap_error_with_string( \
125 status_word, common_error_code, application_specific_error_code, format, ...) \
128 char format_buffer[sizeof(G_io_apdu_buffer) - sizeof(status_word) - 2] = {0}; \
131 snprintf(format_buffer, sizeof(format_buffer), format, ##__VA_ARGS__); \
132 PRINTF("send_swap_error_with_string %s\n", format_buffer); \
133 buffer_t string_buffer; \
134 string_buffer.ptr = (uint8_t *) &format_buffer; \
135 string_buffer.size = strnlen(format_buffer, sizeof(format_buffer)); \
136 string_buffer.offset = 0; \
137 send_swap_error_with_buffers( \
138 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