tfchain/TFChainWallet.py
def address_get(self, value=None):
        """
        Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address,
        either by specifying the address itself or by specifying the index of the address.
        If no value is defined the first wallet address will be used.

        Returns an ERC20AddressInfo named tuple.

        @param value: index of the TFT address or address itself, the address has to be owned by this wallet
        """
        if value is None:
            public_key = self._wallet.key_pair_get(unlockhash=self._wallet.address).public_key
        elif isinstance(value, (str, UnlockHash)):
            try:
                public_key = self._wallet.key_pair_get(unlockhash=value).public_key
            except KeyError as exc:
                if isinstance(value, str):
                    value = UnlockHash.from_json(value)
                raise tfchain.errors.AddressNotInWallet(address=value) from exc
        elif isinstance(value, int) and not isinstance(value, bool):
            addresses = self._wallet.addresses
            if value < 0 or value >= len(addresses):
                raise ValueError("address index {} is not a valid index for this wallet, has to be in the inclusive range of [0, {}]".format(
                    value, len(addresses)-1))
            public_key = self._wallet.key_pair_get(unlockhash=addresses[value]).public_key
        else:
            raise ValueError("value has to be a str, UnlockHash or int, cannot identify an address using value {} (type: {})".format(value, type(value)))

        # look up the wallet address and return it
        return self._wallet.client.erc20.address_get(unlockhash=public_key.unlockhash)

        Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address,
        either by specifying the address itself or by specifying the index of the address.
        If no value is defined the first wallet address will be used.

        Returns an ERC20AddressInfo named tuple.

        @param value: index of the TFT address or address itself, the address has to be owned by this wallet
        
Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address,
either by specifying the address itself or by specifying the index of the address.
If no value is defined the first wallet address will be used.

Returns an ERC20AddressInfo named tuple.
Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address either by specifying the address itself or by specifying the index of the address . If no value is defined the first wallet address will be used . Returns an ERC20AddressInfo named tuple .
def address_get(self, value=None):
        if value is None:
            public_key = self._wallet.key_pair_get(unlockhash=self._wallet.address).public_key
        elif isinstance(value, (str, UnlockHash)):
            try:
                public_key = self._wallet.key_pair_get(unlockhash=value).public_key
            except KeyError as exc:
                if isinstance(value, str):
                    value = UnlockHash.from_json(value)
                raise tfchain.errors.AddressNotInWallet(address=value) from exc
        elif isinstance(value, int) and not isinstance(value, bool):
            addresses = self._wallet.addresses
            if value < 0 or value >= len(addresses):
                raise ValueError("address index {} is not a valid index for this wallet, has to be in the inclusive range of [0, {}]".format(
                    value, len(addresses)-1))
            public_key = self._wallet.key_pair_get(unlockhash=addresses[value]).public_key
        else:
            raise ValueError("value has to be a str, UnlockHash or int, cannot identify an address using value {} (type: {})".format(value, type(value)))
        return self._wallet.client.erc20.address_get(unlockhash=public_key.unlockhash)
def address_get ( self , value = None ) : if value is None : public_key = self . _wallet . key_pair_get ( unlockhash = self . _wallet . address ) . public_key elif isinstance ( value , ( str , UnlockHash ) ) : try : public_key = self . _wallet . key_pair_get ( unlockhash = value ) . public_key except KeyError as exc : if isinstance ( value , str ) : value = UnlockHash . from_json ( value ) raise tfchain . errors . AddressNotInWallet ( address = value ) from exc elif isinstance ( value , int ) and not isinstance ( value , bool ) : addresses = self . _wallet . addresses if value < 0 or value >= len ( addresses ) : raise ValueError ( "address index {} is not a valid index for this wallet, has to be in the inclusive range of [0, {}]" . format ( value , len ( addresses ) - 1 ) ) public_key = self . _wallet . key_pair_get ( unlockhash = addresses [ value ] ) . public_key else : raise ValueError ( "value has to be a str, UnlockHash or int, cannot identify an address using value {} (type: {})" . format ( value , type ( value ) ) ) return self . _wallet . client . erc20 . address_get ( unlockhash = public_key . unlockhash )
Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address,
either by specifying the address itself or by specifying the index of the address.
Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address either by specifying the address itself or by specifying the index of the address .
"""
        Get the registration info of an existing TFT address of this wallet as an ERC20 Withdraw Address,
        either by specifying the address itself or by specifying the index of the address.
        If no value is defined the first wallet address will be used.

        Returns an ERC20AddressInfo named tuple.

        @param value: index of the TFT address or address itself, the address has to be owned by this wallet
        """ # look up the wallet address and return it
self
value
index of the TFT address or address itself, the address has to be owned by this wallet
index of the TFT address or address itself the address has to be owned by this wallet