@@ -114,12 +114,12 @@ def getVerifyPinRemainingAttempts(self):
114114 return e .sw - 0x63c0
115115 raise e
116116
117- def getWalletPublicKey (self , path , showOnScreen = False , segwit = False , segwitNative = False ):
117+ def getWalletPublicKey (self , path , showOnScreen = False , segwit = False , segwitNative = False , cashAddr = False ):
118118 result = {}
119119 donglePath = parse_bip32_path (path )
120120 if self .needKeyCache :
121121 self .resolvePublicKeysInPath (path )
122- apdu = [ self .BTCHIP_CLA , self .BTCHIP_INS_GET_WALLET_PUBLIC_KEY , 0x01 if showOnScreen else 0x00 , 0x02 if segwitNative else 0x01 if segwit else 0x00 , len (donglePath ) ]
122+ apdu = [ self .BTCHIP_CLA , self .BTCHIP_INS_GET_WALLET_PUBLIC_KEY , 0x01 if showOnScreen else 0x00 , 0x03 if cashAddr else 0x02 if segwitNative else 0x01 if segwit else 0x00 , len (donglePath ) ]
123123 apdu .extend (donglePath )
124124 response = self .dongle .exchange (bytearray (apdu ))
125125 offset = 0
@@ -199,7 +199,7 @@ def getTrustedInput(self, transaction, index):
199199 result ['value' ] = response
200200 return result
201201
202- def startUntrustedTransaction (self , newTransaction , inputIndex , outputList , redeemScript , version = 0x01 ):
202+ def startUntrustedTransaction (self , newTransaction , inputIndex , outputList , redeemScript , version = 0x01 , cashAddr = False ):
203203 # Start building a fake transaction with the passed inputs
204204 segwit = False
205205 if newTransaction :
@@ -209,7 +209,7 @@ def startUntrustedTransaction(self, newTransaction, inputIndex, outputList, rede
209209 break
210210 if newTransaction :
211211 if segwit :
212- p2 = 0x02
212+ p2 = 0x03 if cashAddr else 0x02
213213 else :
214214 p2 = 0x00
215215 else :
0 commit comments