tfchain/TFChainClient.py
def address_get(self, unlockhash):
        """
        Get the ERC20 (withdraw) address for the given unlock hash,
        ExplorerNoContent error is raised when no address could be found for the given unlock hash.

        Only type 01 addresses can be looked up for this method (personal wallet addresses),
        as there can be no MultiSignature (wallet) address registered as an ERC20 withdraw address.

        @param unlockhash: the str or wallet address to be looked up
        """
        if isinstance(unlockhash, str):
            unlockhash = UnlockHash.from_json(unlockhash)
        elif not isinstance(unlockhash, UnlockHash):
            raise TypeError("{} is not a valid type and cannot be used as unlock hash".format(type(unlockhash)))
        if unlockhash.type != UnlockHashType.PUBLIC_KEY:
            raise TypeError("only person wallet addresses cannot be registered as withdrawel addresses: {} is an invalid unlock hash type".format(unlockhash.type))
    
        endpoint = "/explorer/hashes/"+str(unlockhash)
        resp = self._client.explorer_get(endpoint=endpoint)
        resp = json_loads(resp)
        try:
            if resp['hashtype'] != 'unlockhash':
                raise tfchain.errors.ExplorerInvalidResponse("expected hash type 'unlockhash' not '{}'".format(resp['hashtype']), endpoint, resp)
            # parse the ERC20 Info
            if not 'erc20info' in resp:
                raise tfchain.errors.ExplorerNoContent("{} could be found but is not registered as an ERC20 withdraw address".format(str(unlockhash)), endpoint=endpoint)
            info = resp['erc20info']
            return ERC20AddressInfo(
                address_tft=UnlockHash.from_json(info['tftaddress']),
                address_erc20=ERC20Address.from_json(info['erc20address']),
                confirmations=int(info['confirmations']),
            )
        except KeyError as exc:
            # return a KeyError as an invalid Explorer Response
            raise tfchain.errors.ExplorerInvalidResponse(str(exc), endpoint, resp) from exc

        Get the ERC20 (withdraw) address for the given unlock hash,
        ExplorerNoContent error is raised when no address could be found for the given unlock hash.

        Only type 01 addresses can be looked up for this method (personal wallet addresses),
        as there can be no MultiSignature (wallet) address registered as an ERC20 withdraw address.

        @param unlockhash: the str or wallet address to be looked up
        
Get the ERC20 (withdraw) address for the given unlock hash,
ExplorerNoContent error is raised when no address could be found for the given unlock hash.

Only type 01 addresses can be looked up for this method (personal wallet addresses),
as there can be no MultiSignature (wallet) address registered as an ERC20 withdraw address.
Get the ERC20 ( withdraw ) address for the given unlock hash ExplorerNoContent error is raised when no address could be found for the given unlock hash . Only type 01 addresses can be looked up for this method ( personal wallet addresses ) as there can be no MultiSignature ( wallet ) address registered as an ERC20 withdraw address .
def address_get(self, unlockhash):
        if isinstance(unlockhash, str):
            unlockhash = UnlockHash.from_json(unlockhash)
        elif not isinstance(unlockhash, UnlockHash):
            raise TypeError("{} is not a valid type and cannot be used as unlock hash".format(type(unlockhash)))
        if unlockhash.type != UnlockHashType.PUBLIC_KEY:
            raise TypeError("only person wallet addresses cannot be registered as withdrawel addresses: {} is an invalid unlock hash type".format(unlockhash.type))
        endpoint = "/explorer/hashes/"+str(unlockhash)
        resp = self._client.explorer_get(endpoint=endpoint)
        resp = json_loads(resp)
        try:
            if resp['hashtype'] != 'unlockhash':
                raise tfchain.errors.ExplorerInvalidResponse("expected hash type 'unlockhash' not '{}'".format(resp['hashtype']), endpoint, resp)
            if not 'erc20info' in resp:
                raise tfchain.errors.ExplorerNoContent("{} could be found but is not registered as an ERC20 withdraw address".format(str(unlockhash)), endpoint=endpoint)
            info = resp['erc20info']
            return ERC20AddressInfo(
                address_tft=UnlockHash.from_json(info['tftaddress']),
                address_erc20=ERC20Address.from_json(info['erc20address']),
                confirmations=int(info['confirmations']),
            )
        except KeyError as exc:
            raise tfchain.errors.ExplorerInvalidResponse(str(exc), endpoint, resp) from exc
def address_get ( self , unlockhash ) : if isinstance ( unlockhash , str ) : unlockhash = UnlockHash . from_json ( unlockhash ) elif not isinstance ( unlockhash , UnlockHash ) : raise TypeError ( "{} is not a valid type and cannot be used as unlock hash" . format ( type ( unlockhash ) ) ) if unlockhash . type != UnlockHashType . PUBLIC_KEY : raise TypeError ( "only person wallet addresses cannot be registered as withdrawel addresses: {} is an invalid unlock hash type" . format ( unlockhash . type ) ) endpoint = "/explorer/hashes/" + str ( unlockhash ) resp = self . _client . explorer_get ( endpoint = endpoint ) resp = json_loads ( resp ) try : if resp [ 'hashtype' ] != 'unlockhash' : raise tfchain . errors . ExplorerInvalidResponse ( "expected hash type 'unlockhash' not '{}'" . format ( resp [ 'hashtype' ] ) , endpoint , resp ) if not 'erc20info' in resp : raise tfchain . errors . ExplorerNoContent ( "{} could be found but is not registered as an ERC20 withdraw address" . format ( str ( unlockhash ) ) , endpoint = endpoint ) info = resp [ 'erc20info' ] return ERC20AddressInfo ( address_tft = UnlockHash . from_json ( info [ 'tftaddress' ] ) , address_erc20 = ERC20Address . from_json ( info [ 'erc20address' ] ) , confirmations = int ( info [ 'confirmations' ] ) , ) except KeyError as exc : raise tfchain . errors . ExplorerInvalidResponse ( str ( exc ) , endpoint , resp ) from exc
Get the ERC20 (withdraw) address for the given unlock hash,
ExplorerNoContent error is raised when no address could be found for the given unlock hash.
Get the ERC20 ( withdraw ) address for the given unlock hash ExplorerNoContent error is raised when no address could be found for the given unlock hash .
"""
        Get the ERC20 (withdraw) address for the given unlock hash,
        ExplorerNoContent error is raised when no address could be found for the given unlock hash.

        Only type 01 addresses can be looked up for this method (personal wallet addresses),
        as there can be no MultiSignature (wallet) address registered as an ERC20 withdraw address.

        @param unlockhash: the str or wallet address to be looked up
        """ # parse the ERC20 Info # return a KeyError as an invalid Explorer Response
self
unlockhash
the str or wallet address to be looked up
the str or wallet address to be looked up