@@ -571,6 +571,155 @@ def __post_init__(self):
571571
572572
573573
574+ @dataclass
575+ class SeedBIP352GeneratePaymentAddressScreen (ButtonListScreen ):
576+ payment_address : str = None
577+
578+ def __post_init__ (self ):
579+ self .title = "Payment Address"
580+ self .is_bottom_list = True
581+ super ().__post_init__ ()
582+
583+ self .components .append (FormattedAddress (
584+ address = self .payment_address ,
585+ font_size = GUIConstants .get_body_font_size () + 4 ,
586+ line_spacing = GUIConstants .BODY_LINE_SPACING - 2 ,
587+ screen_y = self .top_nav .height
588+ ))
589+
590+
591+
592+ @dataclass
593+ class SeedBIP352ExportScanningPrivkeyDetailsScreen (WarningEdgesMixin , ButtonListScreen ):
594+ is_bottom_list : bool = True
595+ fingerprint : str = None
596+ has_passphrase : bool = False
597+ derivation_path : str = "m/352'/0'/0'/1'/0"
598+ scanning_privkey : str = "xprv..."
599+ status_color : str = GUIConstants .DIRE_WARNING_COLOR
600+
601+ def __post_init__ (self ):
602+ self .button_data = [ButtonOption (_ ("Export Privkey via QR" ))]
603+ self .title = _ ("Scan Private Key Details" )
604+
605+ super ().__post_init__ ()
606+
607+ self .fingerprint_line = IconTextLine (
608+ icon_name = SeedSignerIconConstants .FINGERPRINT ,
609+ icon_color = GUIConstants .INFO_COLOR ,
610+ label_text = _ ("Fingerprint" ),
611+ value_text = self .fingerprint ,
612+ screen_x = GUIConstants .COMPONENT_PADDING ,
613+ screen_y = self .top_nav .height + GUIConstants .COMPONENT_PADDING ,
614+ )
615+ self .components .append (self .fingerprint_line )
616+
617+ self .derivation_line = IconTextLine (
618+ icon_name = SeedSignerIconConstants .DERIVATION ,
619+ icon_color = GUIConstants .INFO_COLOR ,
620+ label_text = _ ("Derivation" ),
621+ value_text = self .derivation_path ,
622+ screen_x = GUIConstants .COMPONENT_PADDING ,
623+ screen_y = self .components [- 1 ].screen_y + self .components [- 1 ].height + int (1.5 * GUIConstants .COMPONENT_PADDING ),
624+ )
625+ self .components .append (self .derivation_line )
626+
627+ font_name = GUIConstants .FIXED_WIDTH_FONT_NAME
628+ font_size = GUIConstants .get_body_font_size () + 2
629+ left , top , right , bottom = Fonts .get_font (font_name , font_size ).getbbox ("X" )
630+ char_width = right - left
631+ num_chars = int ((self .canvas_width - 2 * GUIConstants .COMPONENT_PADDING ) / char_width ) - 3
632+
633+ self .privkey_line = IconTextLine (
634+ icon_name = FontAwesomeIconConstants .X ,
635+ icon_color = GUIConstants .INFO_COLOR ,
636+ label_text = _ ("Scan Private Key" ),
637+ value_text = f"{ self .scanning_privkey [:num_chars ]} ..." ,
638+ font_name = GUIConstants .FIXED_WIDTH_FONT_NAME ,
639+ font_size = GUIConstants .get_body_font_size () + 2 ,
640+ screen_x = GUIConstants .COMPONENT_PADDING ,
641+ screen_y = self .components [- 1 ].screen_y + self .components [- 1 ].height + int (1.5 * GUIConstants .COMPONENT_PADDING ),
642+ )
643+ self .components .append (self .privkey_line )
644+
645+
646+
647+ @dataclass
648+ class SeedBIP352ExportSigningPubkeyDetailsScreen (WarningEdgesMixin , ButtonListScreen ):
649+ # Customize defaults
650+ is_bottom_list : bool = True
651+ fingerprint : str = None
652+ has_passphrase : bool = False
653+ derivation_path : str = "m/352'/0'/0'/0'/0"
654+ signing_pubkey : str = "xpub..."
655+
656+ def __post_init__ (self ):
657+ self .button_data = [ButtonOption (_ ("Export Pubkey via QR" ))]
658+ self .title = _ ("Spend Pubkey Details" )
659+
660+ super ().__post_init__ ()
661+
662+ # Set up the fingerprint and passphrase displays
663+ self .fingerprint_line = IconTextLine (
664+ icon_name = SeedSignerIconConstants .FINGERPRINT ,
665+ icon_color = GUIConstants .INFO_COLOR ,
666+ label_text = _ ("Fingerprint" ),
667+ value_text = self .fingerprint ,
668+ screen_x = GUIConstants .COMPONENT_PADDING ,
669+ screen_y = self .top_nav .height + GUIConstants .COMPONENT_PADDING ,
670+ )
671+ self .components .append (self .fingerprint_line )
672+
673+ self .derivation_line = IconTextLine (
674+ icon_name = SeedSignerIconConstants .DERIVATION ,
675+ icon_color = GUIConstants .INFO_COLOR ,
676+ label_text = _ ("Derivation" ),
677+ value_text = self .derivation_path ,
678+ screen_x = GUIConstants .COMPONENT_PADDING ,
679+ screen_y = self .components [- 1 ].screen_y + self .components [- 1 ].height + int (1.5 * GUIConstants .COMPONENT_PADDING ),
680+ )
681+ self .components .append (self .derivation_line )
682+
683+ font_name = GUIConstants .FIXED_WIDTH_FONT_NAME
684+ font_size = GUIConstants .get_body_font_size () + 2
685+ left , top , right , bottom = Fonts .get_font (font_name , font_size ).getbbox ("X" )
686+ char_width = right - left
687+ num_chars = int ((self .canvas_width - 2 * GUIConstants .COMPONENT_PADDING ) / char_width ) - 3
688+
689+ self .pubkey_line = IconTextLine (
690+ icon_name = FontAwesomeIconConstants .X ,
691+ icon_color = GUIConstants .INFO_COLOR ,
692+ label_text = _ ("Spend Public Key" ),
693+ value_text = f"{ self .signing_pubkey [:num_chars ]} ..." ,
694+ font_name = GUIConstants .FIXED_WIDTH_FONT_NAME ,
695+ font_size = GUIConstants .get_body_font_size () + 2 ,
696+ screen_x = GUIConstants .COMPONENT_PADDING ,
697+ screen_y = self .components [- 1 ].screen_y + self .components [- 1 ].height + int (1.5 * GUIConstants .COMPONENT_PADDING ),
698+ )
699+ self .components .append (self .pubkey_line )
700+
701+
702+
703+ @dataclass
704+ class SeedBIP352LabelEntryScreen (KeyboardScreen ):
705+ """
706+ Currently, labels are restricted to numeric characters only as a basic safeguard.
707+ TODO: Extend support to any arbitrary char string in future updates.
708+ """
709+ def __post_init__ (self ):
710+ self .title = _ ("Enter Label" )
711+ self .user_input = ""
712+
713+ # Specify the keys in the keyboard - numeric only
714+ self .rows = 3
715+ self .cols = 5
716+ self .keys_charset = "0123456789"
717+ self .show_save_button = True
718+
719+ super ().__post_init__ ()
720+
721+
722+
574723@dataclass
575724class SeedWordsBackupTestPromptScreen (ButtonListScreen ):
576725 def __post_init__ (self ):
0 commit comments