ledger/btc.py
def _parse_public_key_response(response: bytes) -> LedgerXPub:
    '''
    Parse the Ledger's serializied key response into a data structure
    '''
    pubkey_len = response[0]
    pubkey = response[1:1 + pubkey_len]
    address = response[1 + pubkey_len + 1:-32]
    chain_code = response[-32:]  # last 32 are chain_code
    return LedgerXPub(
        pubkey=bytes(pubkey),
        address=address.decode('utf8'),
        chain_code=bytes(chain_code))

    Parse the Ledger's serializied key response into a data structure
    
Parse the Ledger's serializied key response into a data structure
Parse the Ledger ' s serializied key response into a data structure
def _parse_public_key_response(response: bytes) -> LedgerXPub:
    pubkey_len = response[0]
    pubkey = response[1:1 + pubkey_len]
    address = response[1 + pubkey_len + 1:-32]
    chain_code = response[-32:]  
    return LedgerXPub(
        pubkey=bytes(pubkey),
        address=address.decode('utf8'),
        chain_code=bytes(chain_code))
def _parse_public_key_response ( response : bytes ) -> LedgerXPub : pubkey_len = response [ 0 ] pubkey = response [ 1 : 1 + pubkey_len ] address = response [ 1 + pubkey_len + 1 : - 32 ] chain_code = response [ - 32 : ] return LedgerXPub ( pubkey = bytes ( pubkey ) , address = address . decode ( 'utf8' ) , chain_code = bytes ( chain_code ) )
Parse the Ledger's serializied key response into a data structure
Parse the Ledger ' s serializied key response into a data structure
'''
    Parse the Ledger's serializied key response into a data structure
    ''' # last 32 are chain_code
response
bytes