ledger/eth.py
def _parse_public_key_response(response: bytes) -> LedgerPubkey:
    '''
    Parse the Ledger's serializied key response into a data structure
    '''
    pubkey_len = response[0]
    pubkey = response[1:1 + pubkey_len]

    address_len = response[1 + pubkey_len]
    address_offset = 1 + pubkey_len + 1

    # 20 byte address, but it's utf8 encoded
    address_bytes = response[address_offset: address_offset + address_len]

    return LedgerPubkey(
        pubkey=bytes(pubkey),
        address=f'0x{address_bytes.decode("utf8")}')

    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) -> LedgerPubkey:
    pubkey_len = response[0]
    pubkey = response[1:1 + pubkey_len]
    address_len = response[1 + pubkey_len]
    address_offset = 1 + pubkey_len + 1
    address_bytes = response[address_offset: address_offset + address_len]
    return LedgerPubkey(
        pubkey=bytes(pubkey),
        address=f'0x{address_bytes.decode("utf8")}')
def _parse_public_key_response ( response : bytes ) -> LedgerPubkey : pubkey_len = response [ 0 ] pubkey = response [ 1 : 1 + pubkey_len ] address_len = response [ 1 + pubkey_len ] address_offset = 1 + pubkey_len + 1 address_bytes = response [ address_offset : address_offset + address_len ] return LedgerPubkey ( pubkey = bytes ( pubkey ) , address = f'0x{address_bytes.decode("utf8")}' )
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
    ''' # 20 byte address, but it's utf8 encoded
response
bytes