-
Notifications
You must be signed in to change notification settings - Fork 12
/
flipbip.h
90 lines (80 loc) · 2.24 KB
/
flipbip.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#include <furi.h>
#include <furi_hal.h>
#include <gui/gui.h>
#include <input/input.h>
#include <stdlib.h>
//#include <notification/notification_messages.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/submenu.h>
#include <gui/scene_manager.h>
#include <gui/modules/dialog_ex.h>
#include <gui/modules/variable_item_list.h>
#include <gui/modules/text_input.h>
#include "scenes/flipbip_scene.h"
#include "views/flipbip_scene_1.h"
#include "flipbip_coins.h"
#define FLIPBIP_VERSION "v1.18"
#define TEXT_BUFFER_SIZE 256
typedef struct {
Gui* gui;
// NotificationApp* notification;
ViewDispatcher* view_dispatcher;
Submenu* submenu;
SceneManager* scene_manager;
VariableItemList* variable_item_list;
TextInput* text_input;
DialogEx* renew_dialog;
FlipBipScene1* flipbip_scene_1;
char* mnemonic_menu_text;
// Settings options
int bip39_strength;
int passphrase;
// Main menu options
int coin_type;
int overwrite_saved_seed;
int import_from_mnemonic;
// Text input
int input_state;
char passphrase_text[TEXT_BUFFER_SIZE];
char import_mnemonic_text[TEXT_BUFFER_SIZE];
char input_text[TEXT_BUFFER_SIZE];
void (*wallet_create)(void* context);
} FlipBip;
typedef enum {
FlipBipViewIdStartscreen,
FlipBipViewIdMenu,
FlipBipViewIdScene1,
FlipBipViewIdSettings,
FlipBipViewIdTextInput,
FlipBipViewRenewConfirm,
} FlipBipViewId;
typedef enum {
FlipBipStrength128,
FlipBipStrength192,
FlipBipStrength256,
} FlipBipStrengthState;
typedef enum {
FlipBipPassphraseOff,
FlipBipPassphraseOn,
} FlipBipPassphraseState;
typedef enum {
FlipBipTextInputDefault,
FlipBipTextInputPassphrase,
FlipBipTextInputMnemonic
} FlipBipTextInputState;
typedef enum {
FlipBipStatusSuccess = 0,
FlipBipStatusReturn = 10,
FlipBipStatusLoadError = 11,
FlipBipStatusSaveError = 12,
FlipBipStatusMnemonicCheckError = 13,
} FlipBipStatus;
// There's a scene ID for each coin, then these scenes are after so need to offset the first entry by at least NUM_COINS
typedef enum {
SubmenuIndexScene1New = NUM_COINS + 1,
SubmenuIndexScene1Renew,
SubmenuIndexScene1Import,
SubmenuIndexSettings,
SubmenuIndexNOP,
} SubmenuIndex;