22
22
#define DERIV_ACCOUNT 0
23
23
#define DERIV_CHANGE 0
24
24
25
+ #define TEXT_LOADING "Loading..."
26
+ #define TEXT_NEW_WALLET "New wallet"
27
+ #define TEXT_DEFAULT_COIN "Coin"
28
+ #define TEXT_RECEIVE_ADDRESS "receive address:"
29
+ #define TEXT_DEFAULT_DERIV "m/44'/X'/0'/0"
30
+
31
+ const char * TEXT_INFO = "-Scroll pages with up/down-"
32
+ "p1,2) Mnemonic/Seed "
33
+ "p3) xprv Root Key "
34
+ "p4,5) xprv/xpub Accnt Keys"
35
+ "p6,7) xprv/xpub Extnd Keys"
36
+ "p8+) Receive Addresses " ;
37
+
25
38
// bip44_coin, xprv_version, xpub_version, addr_version, wif_version, addr_format
26
39
const uint32_t COIN_INFO_ARRAY [3 ][6 ] = {
27
40
{COIN_BTC , 0x0488ade4 , 0x0488b21e , 0x00 , 0x80 , FlipBipCoinBTC0 },
@@ -63,7 +76,7 @@ static CONFIDENTIAL char s_disp_text3[30 + 1];
63
76
static CONFIDENTIAL char s_disp_text4 [30 + 1 ];
64
77
static CONFIDENTIAL char s_disp_text5 [30 + 1 ];
65
78
static CONFIDENTIAL char s_disp_text6 [30 + 1 ];
66
- static const char * s_derivation_text = "m/44'/X'/0'/0" ;
79
+ static const char * s_derivation_text = TEXT_DEFAULT_DERIV ;
67
80
//static bool s_busy = false;
68
81
69
82
void flipbip_scene_1_set_callback (
@@ -234,13 +247,7 @@ void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
234
247
235
248
flipbip_scene_1_clear_text ();
236
249
if (model -> page == 1 ) {
237
- const char * info = "-Scroll pages with up/down-"
238
- "p1,2) Mnemonic/Seed "
239
- "p3) xprv Root Key "
240
- "p4,5) xprv/xpub Accnt Keys"
241
- "p6,7) xprv/xpub Extnd Keys"
242
- "p8+) Receive Addresses " ;
243
- flipbip_scene_1_draw_generic (info , 27 );
250
+ flipbip_scene_1_draw_generic (TEXT_INFO , 27 );
244
251
} else if (model -> page == 2 ) {
245
252
flipbip_scene_1_draw_mnemonic (model -> mnemonic );
246
253
} else if (model -> page == 3 ) {
@@ -261,18 +268,19 @@ void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
261
268
262
269
if (model -> page == 0 ) {
263
270
canvas_set_font (canvas , FontPrimary );
264
- canvas_draw_str (canvas , 1 , 10 , "Loading..." );
271
+ canvas_draw_str (canvas , 1 , 10 , TEXT_LOADING );
265
272
canvas_draw_str (canvas , 6 , 30 , s_derivation_text );
266
273
canvas_draw_icon (canvas , 86 , 25 , & I_Keychain_39x36 );
267
274
} else if (model -> page >= 9 && model -> page <= 13 ) {
268
275
canvas_set_font (canvas , FontSecondary );
269
276
// coin_name, derivation_path
270
277
const char * receive_text = COIN_TEXT_ARRAY [model -> coin ][0 ];
271
278
if (receive_text == NULL ) {
272
- receive_text = "Coin" ;
279
+ receive_text = TEXT_DEFAULT_COIN ;
273
280
}
281
+ const size_t receive_len = strlen (receive_text ) * 7 ;
274
282
canvas_draw_str_aligned (canvas , 1 , 2 , AlignLeft , AlignTop , receive_text );
275
- canvas_draw_str_aligned (canvas , strlen ( receive_text ) * 7 , 2 , AlignLeft , AlignTop , "receive address:" );
283
+ canvas_draw_str_aligned (canvas , receive_len , 2 , AlignLeft , AlignTop , TEXT_RECEIVE_ADDRESS );
276
284
canvas_set_font (canvas , FontPrimary );
277
285
canvas_draw_str (canvas , 6 , 22 , s_disp_text1 );
278
286
canvas_draw_str (canvas , 6 , 34 , s_disp_text2 );
@@ -519,6 +527,9 @@ void flipbip_scene_1_enter(void* context) {
519
527
520
528
// Overwrite the saved seed with a new one setting
521
529
bool overwrite = app -> overwrite_saved_seed != 0 ;
530
+ if (overwrite ) {
531
+ s_derivation_text = TEXT_NEW_WALLET ;
532
+ }
522
533
523
534
flipbip_play_happy_bump (app );
524
535
flipbip_led_set_rgb (app , 255 , 0 , 0 );
0 commit comments