@@ -1628,11 +1628,29 @@ def solana_sign_tx(self, address_n, raw_tx):
16281628 )
16291629
16301630 @expect (solana_proto .SolanaMessageSignature )
1631- def solana_sign_message (self , address_n , message ):
1631+ def solana_sign_message (self , address_n , message , show_display = False ):
16321632 return self .call (
1633- solana_proto .SolanaSignMessage (address_n = address_n , message = message )
1633+ solana_proto .SolanaSignMessage (
1634+ address_n = address_n ,
1635+ message = message ,
1636+ show_display = show_display ,
1637+ )
16341638 )
16351639
1640+ @expect (solana_proto .SolanaOffchainMessageSignature )
1641+ def solana_sign_offchain_message (self , address_n , message , message_format = None ,
1642+ version = 0 , show_display = False ):
1643+ kwargs = {
1644+ "address_n" : address_n ,
1645+ "version" : version ,
1646+ "message" : message ,
1647+ "show_display" : show_display ,
1648+ }
1649+ if message_format is not None :
1650+ kwargs ["message_format" ] = message_format
1651+
1652+ return self .call (solana_proto .SolanaSignOffchainMessage (** kwargs ))
1653+
16361654 # ── Tron ───────────────────────────────────────────────────
16371655 @expect (tron_proto .TronAddress )
16381656 def tron_get_address (self , address_n , show_display = False ):
@@ -1646,6 +1664,37 @@ def tron_sign_tx(self, address_n, raw_tx):
16461664 tron_proto .TronSignTx (address_n = address_n , raw_tx = raw_tx )
16471665 )
16481666
1667+ @expect (tron_proto .TronMessageSignature )
1668+ def tron_sign_message (self , address_n , message , show_display = False ):
1669+ return self .call (
1670+ tron_proto .TronSignMessage (
1671+ address_n = address_n ,
1672+ message = message ,
1673+ show_display = show_display ,
1674+ )
1675+ )
1676+
1677+ @expect (proto .Success )
1678+ def tron_verify_message (self , address , signature , message ):
1679+ return self .call (
1680+ tron_proto .TronVerifyMessage (
1681+ address = address ,
1682+ signature = signature ,
1683+ message = message ,
1684+ )
1685+ )
1686+
1687+ @expect (tron_proto .TronTypedDataSignature )
1688+ def tron_sign_typed_hash (self , address_n , domain_separator_hash ,
1689+ message_hash = None ):
1690+ kwargs = dict (
1691+ address_n = address_n ,
1692+ domain_separator_hash = domain_separator_hash ,
1693+ )
1694+ if message_hash is not None :
1695+ kwargs ['message_hash' ] = message_hash
1696+ return self .call (tron_proto .TronSignTypedHash (** kwargs ))
1697+
16491698 # ── TON ────────────────────────────────────────────────────
16501699 @expect (ton_proto .TonAddress )
16511700 def ton_get_address (self , address_n , show_display = False ):
@@ -1659,6 +1708,16 @@ def ton_sign_tx(self, address_n, raw_tx):
16591708 ton_proto .TonSignTx (address_n = address_n , raw_tx = raw_tx )
16601709 )
16611710
1711+ @expect (ton_proto .TonMessageSignature )
1712+ def ton_sign_message (self , address_n , message , show_display = False ):
1713+ return self .call (
1714+ ton_proto .TonSignMessage (
1715+ address_n = address_n ,
1716+ message = message ,
1717+ show_display = show_display ,
1718+ )
1719+ )
1720+
16621721 # ── Zcash Address Display ─────────────────────────────────
16631722 @expect (zcash_proto .ZcashAddress )
16641723 def zcash_display_address (self , address_n , address , ak , nk , rivk , account = None ):
0 commit comments