gnosis/eth/ethereum_client.py
def get_transfer_history(self, from_block: int, to_block: Optional[int] = None,
                             from_address: Optional[str] = None, to_address: Optional[str] = None,
                             token_address: Optional[str] = None) -> List[Dict[str, any]]:
        """
        Get events for erc20 transfers. At least one of `from_address`, `to_address` or `token_address` must be
        defined
        An example of event:
        {
            "args": {
                "from": "0x1Ce67Ea59377A163D47DFFc9BaAB99423BE6EcF1",
                "to": "0xaE9E15896fd32E59C7d89ce7a95a9352D6ebD70E",
                "value": 15000000000000000
            },
            "event": "Transfer",
            "logIndex": 42,
            "transactionIndex": 60,
            "transactionHash": "0x71d6d83fef3347bad848e83dfa0ab28296e2953de946ee152ea81c6dfb42d2b3",
            "address": "0xfecA834E7da9D437645b474450688DA9327112a5",
            "blockHash": "0x054de9a496fc7d10303068cbc7ee3e25181a3b26640497859a5e49f0342e7db2",
            "blockNumber": 7265022
        }
        :param from_block: Block to start querying from
        :param to_block: Block to stop querying from
        :param from_address: Address sending the erc20 transfer
        :param to_address: Address receiving the erc20 transfer
        :param token_address: Address of the token
        :return: List of events
        :throws: ReadTimeout
        """
        assert from_address or to_address or token_address, 'At least one parameter must be provided'

        erc20 = get_erc20_contract(self.w3)

        argument_filters = {}
        if from_address:
            argument_filters['from'] = from_address
        if to_address:
            argument_filters['to'] = to_address

        return erc20.events.Transfer.createFilter(fromBlock=from_block,
                                                  toBlock=to_block,
                                                  address=token_address,
                                                  argument_filters=argument_filters).get_all_entries()
def get_transfer_history(self, from_block: int, to_block: Optional[int] = None,
                             from_address: Optional[str] = None, to_address: Optional[str] = None,
                             token_address: Optional[str] = None) -> List[Dict[str, any]]:
        """
        Get events for erc20 transfers. At least one of `from_address`, `to_address` or `token_address` must be
        defined
        An example of event:
        {
            "args": {
                "from": "0x1Ce67Ea59377A163D47DFFc9BaAB99423BE6EcF1",
                "to": "0xaE9E15896fd32E59C7d89ce7a95a9352D6ebD70E",
                "value": 15000000000000000
            },
            "event": "Transfer",
            "logIndex": 42,
            "transactionIndex": 60,
            "transactionHash": "0x71d6d83fef3347bad848e83dfa0ab28296e2953de946ee152ea81c6dfb42d2b3",
            "address": "0xfecA834E7da9D437645b474450688DA9327112a5",
            "blockHash": "0x054de9a496fc7d10303068cbc7ee3e25181a3b26640497859a5e49f0342e7db2",
            "blockNumber": 7265022
        }
        :param from_block: Block to start querying from
        :param to_block: Block to stop querying from
        :param from_address: Address sending the erc20 transfer
        :param to_address: Address receiving the erc20 transfer
        :param token_address: Address of the token
        :return: List of events
        :throws: ReadTimeout
        """
        assert from_address or to_address or token_address, 'At least one parameter must be provided'

        erc20 = get_erc20_contract(self.w3)

        argument_filters = {}
        if from_address:
            argument_filters['from'] = from_address
        if to_address:
            argument_filters['to'] = to_address

        return erc20.events.Transfer.createFilter(fromBlock=from_block,
                                                  toBlock=to_block,
                                                  address=token_address,
                                                  argument_filters=argument_filters).get_all_entries()
def get_transfer_history ( self , from_block : int , to_block : Optional [ int ] = None , from_address : Optional [ str ] = None , to_address : Optional [ str ] = None , token_address : Optional [ str ] = None ) -> List [ Dict [ str , any ] ] : assert from_address or to_address or token_address , 'At least one parameter must be provided' erc20 = get_erc20_contract ( self . w3 ) argument_filters = { } if from_address : argument_filters [ 'from' ] = from_address if to_address : argument_filters [ 'to' ] = to_address return erc20 . events . Transfer . createFilter ( fromBlock = from_block , toBlock = to_block , address = token_address , argument_filters = argument_filters ) . get_all_entries ( )
Get events for erc20 transfers. At least one of `from_address`, `to_address` or `token_address` must be
        defined
        An example of event:
        {
            "args": {
                "from": "0x1Ce67Ea59377A163D47DFFc9BaAB99423BE6EcF1",
                "to": "0xaE9E15896fd32E59C7d89ce7a95a9352D6ebD70E",
                "value": 15000000000000000
            },
            "event": "Transfer",
            "logIndex": 42,
            "transactionIndex": 60,
            "transactionHash": "0x71d6d83fef3347bad848e83dfa0ab28296e2953de946ee152ea81c6dfb42d2b3",
            "address": "0xfecA834E7da9D437645b474450688DA9327112a5",
            "blockHash": "0x054de9a496fc7d10303068cbc7ee3e25181a3b26640497859a5e49f0342e7db2",
            "blockNumber": 7265022
        }
        :param from_block: Block to start querying from
        :param to_block: Block to stop querying from
        :param from_address: Address sending the erc20 transfer
        :param to_address: Address receiving the erc20 transfer
        :param token_address: Address of the token
        :return: List of events
        :throws: ReadTimeout
Get events for erc20 transfers . At least one of from_address to_address or token_address must be defined An example of event : { args : { from : 0x1Ce67Ea59377A163D47DFFc9BaAB99423BE6EcF1 to : 0xaE9E15896fd32E59C7d89ce7a95a9352D6ebD70E value : 15000000000000000 } event : Transfer logIndex : 42 transactionIndex : 60 transactionHash : 0x71d6d83fef3347bad848e83dfa0ab28296e2953de946ee152ea81c6dfb42d2b3 address : 0xfecA834E7da9D437645b474450688DA9327112a5 blockHash : 0x054de9a496fc7d10303068cbc7ee3e25181a3b26640497859a5e49f0342e7db2 blockNumber : 7265022 } : param from_block : Block to start querying from : param to_block : Block to stop querying from : param from_address : Address sending the erc20 transfer : param to_address : Address receiving the erc20 transfer : param token_address : Address of the token : return : List of events : throws : ReadTimeout