2022-05-12 17:29:35 +02:00
|
|
|
#ifndef UI_LOGIC_712_H_
|
|
|
|
|
#define UI_LOGIC_712_H_
|
|
|
|
|
|
2022-05-16 10:59:20 +02:00
|
|
|
#ifdef HAVE_EIP712_FULL_SUPPORT
|
|
|
|
|
|
2022-05-12 17:29:35 +02:00
|
|
|
#include <stdint.h>
|
2022-05-12 17:30:26 +02:00
|
|
|
#include "ux.h"
|
2024-04-12 11:09:06 +02:00
|
|
|
#include "uint256.h"
|
2022-07-19 11:49:18 +02:00
|
|
|
|
|
|
|
|
typedef enum { EIP712_FILTERING_BASIC, EIP712_FILTERING_FULL } e_eip712_filtering_mode;
|
2022-11-18 11:26:06 +01:00
|
|
|
typedef enum {
|
|
|
|
|
EIP712_FIELD_LATER,
|
|
|
|
|
EIP712_FIELD_INCOMING,
|
|
|
|
|
EIP712_NO_MORE_FIELD
|
|
|
|
|
} e_eip712_nfs; // next field state
|
2022-07-19 11:49:18 +02:00
|
|
|
|
2022-05-12 17:29:35 +02:00
|
|
|
bool ui_712_init(void);
|
2022-05-12 17:30:26 +02:00
|
|
|
void ui_712_deinit(void);
|
2022-11-18 11:26:06 +01:00
|
|
|
e_eip712_nfs ui_712_next_field(void);
|
2022-06-24 18:12:07 +02:00
|
|
|
void ui_712_review_struct(const void *const struct_ptr);
|
2024-06-20 11:32:09 +02:00
|
|
|
bool ui_712_feed_to_display(const void *field_ptr,
|
|
|
|
|
const uint8_t *data,
|
|
|
|
|
uint8_t length,
|
|
|
|
|
bool first,
|
|
|
|
|
bool last);
|
2022-05-12 17:29:35 +02:00
|
|
|
void ui_712_end_sign(void);
|
2022-08-25 10:26:48 +02:00
|
|
|
unsigned int ui_712_approve();
|
|
|
|
|
unsigned int ui_712_reject();
|
2024-06-20 11:32:09 +02:00
|
|
|
void ui_712_set_title(const char *str, size_t length);
|
|
|
|
|
void ui_712_set_value(const char *str, size_t length);
|
2022-07-19 11:49:18 +02:00
|
|
|
void ui_712_message_hash(void);
|
|
|
|
|
void ui_712_redraw_generic_step(void);
|
2024-05-13 17:40:26 +02:00
|
|
|
void ui_712_flag_field(bool show, bool name_provided, bool token_join, bool datetime);
|
2022-07-19 11:49:18 +02:00
|
|
|
void ui_712_field_flags_reset(void);
|
|
|
|
|
void ui_712_finalize_field(void);
|
|
|
|
|
void ui_712_set_filtering_mode(e_eip712_filtering_mode mode);
|
2022-06-20 15:15:58 +02:00
|
|
|
e_eip712_filtering_mode ui_712_get_filtering_mode(void);
|
2022-08-19 18:31:00 +02:00
|
|
|
void ui_712_set_filters_count(uint8_t count);
|
|
|
|
|
uint8_t ui_712_remaining_filters(void);
|
2022-07-19 11:49:18 +02:00
|
|
|
void ui_712_queue_struct_to_review(void);
|
2022-08-19 18:31:00 +02:00
|
|
|
void ui_712_notify_filter_change(void);
|
2024-04-12 11:09:06 +02:00
|
|
|
void ui_712_token_join_prepare_addr_check(uint8_t index);
|
|
|
|
|
void ui_712_token_join_prepare_amount(uint8_t index, const char *name, uint8_t name_length);
|
2024-06-17 16:33:45 +02:00
|
|
|
void amount_join_set_token_received(void);
|
2024-06-20 11:32:09 +02:00
|
|
|
bool ui_712_show_raw_key(const void *field_ptr);
|
2024-06-06 18:13:11 +02:00
|
|
|
#ifdef SCREEN_SIZE_WALLET
|
|
|
|
|
char *get_ui_pairs_buffer(size_t *size);
|
|
|
|
|
#endif
|
2022-05-12 17:29:35 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#endif // HAVE_EIP712_FULL_SUPPORT
|
2022-05-16 10:59:20 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#endif // UI_LOGIC_712_H_
|