docs: async def get_endpoint(self, target_did: str = None, from_cache: bool = True) -> str:
          """
          Get endpoint attribute for anchor having input DID (default own DID).
          Raise WalletState if target DID is default (own DID) value but wallet does not have it
          (neither created nor opened since initialization).
  
          :param target_did: DID of anchor for which to find endpoint attribute on ledger
          :param from_cache: check endpoint cache first before visiting ledger; always update cache with ledger value
          :return: endpoint attribute value, or None for no such value
          """
  
          LOGGER.debug('BaseAnchor.get_endpoint >>> target_did: %s, from_cache: %s', target_did, from_cache)
  
          rv = None
  
          if not (target_did or self.did):
              LOGGER.debug('BaseAnchor.get_endpoint <!< Bad wallet state: DID for %s unavailable', self.name)
              raise WalletState('Bad wallet state: DID for {} unavailable'.format(self.name))
  
          target_did = target_did or self.did
          if not ok_did(target_did):
              LOGGER.debug('BaseAnchor.get_endpoint <!< Bad DID %s', target_did)
              raise BadIdentifier('Bad DID {}'.format(target_did))
  
          if from_cache:
              with ENDPOINT_CACHE.lock:
                  if target_did in ENDPOINT_CACHE:
                      LOGGER.info('BaseAnchor.get_endpoint: got endpoint for %s from cache', target_did)
                      rv = ENDPOINT_CACHE[target_did]
                      LOGGER.debug('BaseAnchor.get_endpoint <<< %s', rv)
                      return rv
  
          req_json = await ledger.build_get_attrib_request(
              self.did,
              target_did,
              'endpoint',
              None,
              None)
          resp_json = await self._submit(req_json)
  
          data_json = (json.loads(resp_json))['result']['data']  # it's double-encoded on the ledger
          if data_json:
              rv = json.loads(data_json)['endpoint'].get('endpoint', None)
          else:
              LOGGER.info('_AgentCore.get_endpoint: ledger query returned response with no data')
  
          with ENDPOINT_CACHE.lock:
              if rv:
                  ENDPOINT_CACHE[target_did] = rv
              else:
                  ENDPOINT_CACHE.pop(target_did, None)
                  assert target_did not in ENDPOINT_CACHE
  
          LOGGER.debug('BaseAnchor.get_endpoint <<< %s', rv)
          return rv