<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def get_did_endpoint(self, remote_did: str) -> EndpointInfo: """ Return endpoint info for remote DID. Raise BadIdentifier for bad remote DID. Raise WalletState if bypassing cache but wallet is closed. Raise AbsentRecord for no such endpoint. :param remote_did: pairwise remote DID :return: endpoint and (transport) verification key as EndpointInfo """


        LOGGER.debug('BaseAnchor.get_did_endpoint >>> remote_did: %s', remote_did)

        if not ok_did(remote_did):
            LOGGER.debug('BaseAnchor.get_did_endpoint <!< Bad DID %s', remote_did)
            raise BadIdentifier('Bad DID {}'.format(remote_did))

        if not self.wallet.handle:
            LOGGER.debug('BaseAnchor.get_did_endpoint <!< Wallet %s is closed', self.name)
            raise WalletState('Wallet {} is closed'.format(self.name))

        pairwise_info = (await self.wallet.get_pairwise(remote_did)).get(remote_did, None)
        if not (pairwise_info and 'did_endpoint' in pairwise_info.metadata):
            LOGGER.debug('BaseAnchor.get_did_endpoint <!< No endpoint for remote DID %s', remote_did)
            raise AbsentRecord('No endpoint for remote DID {}'.format(remote_did))
        rv = EndpointInfo(pairwise_info.metadata['did_endpoint'], pairwise_info.their_verkey)

        LOGGER.debug('BaseAnchor.get_did_endpoint <<< %s', rv)
        return rv