Rewards2/teepy_rewards2/scrapper.py
def _algoexplorer(self, address: str, pages: Union[int, None]=None):
        """
        Makes a request to algoExplorer API to fetch transaction data for the given address.

        Args:
            - address: desired address for transaction data
            - pages: desired number of pages for response[can be skipped to fetch all pages]
        Returns:
            - List[{}]: A list of transaction data for the given address
        """
        page = 1
        limit = 50
        data = []
        while True:

            if pages:
                if page == pages:
                    break
            url = f"{self.api_base_url}?page={page}&limit={limit}&address={address}"
            resp = requests.get(url)
            try:
                dat = resp.json()['transactions']
            except Exception as e:
                break
            data.extend(list(map(lambda item: {'from': item['sender'], 'amount': item['asset-transfer-transaction']['amount']} if item.get('asset-transfer-transaction', None) else {'from': item['sender'], 'amount': item['payment-transaction']['amount']}, dat)))
            page += 1
        return data

        Makes a request to algoExplorer API to fetch transaction data for the given address.

        Args:
            - address: desired address for transaction data
            - pages: desired number of pages for response[can be skipped to fetch all pages]
        Returns:
            - List[{}]: A list of transaction data for the given address
        
Makes a request to algoExplorer API to fetch transaction data for the given address.
Makes a request to algoExplorer API to fetch transaction data for the given address .
def _algoexplorer(self, address: str, pages: Union[int, None]=None):
        page = 1
        limit = 50
        data = []
        while True:
            if pages:
                if page == pages:
                    break
            url = f"{self.api_base_url}?page={page}&limit={limit}&address={address}"
            resp = requests.get(url)
            try:
                dat = resp.json()['transactions']
            except Exception as e:
                break
            data.extend(list(map(lambda item: {'from': item['sender'], 'amount': item['asset-transfer-transaction']['amount']} if item.get('asset-transfer-transaction', None) else {'from': item['sender'], 'amount': item['payment-transaction']['amount']}, dat)))
            page += 1
        return data
def _algoexplorer ( self , address : str , pages : Union [ int , None ] = None ) : page = 1 limit = 50 data = [ ] while True : if pages : if page == pages : break url = f"{self.api_base_url}?page={page}&limit={limit}&address={address}" resp = requests . get ( url ) try : dat = resp . json ( ) [ 'transactions' ] except Exception as e : break data . extend ( list ( map ( lambda item : { 'from' : item [ 'sender' ] , 'amount' : item [ 'asset-transfer-transaction' ] [ 'amount' ] } if item . get ( 'asset-transfer-transaction' , None ) else { 'from' : item [ 'sender' ] , 'amount' : item [ 'payment-transaction' ] [ 'amount' ] } , dat ) ) ) page += 1 return data
Makes a request to algoExplorer API to fetch transaction data for the given address.
Makes a request to algoExplorer API to fetch transaction data for the given address .
"""
        Makes a request to algoExplorer API to fetch transaction data for the given address.

        Args:
            - address: desired address for transaction data
            - pages: desired number of pages for response[can be skipped to fetch all pages]
        Returns:
            - List[{}]: A list of transaction data for the given address
        """
A list of transaction data for the given address
A list of transaction data for the given address
- List[{}]
self
address
str
pages
Union[int, None]
- address
desired address for transaction data
desired address for transaction data
- pages
desired number of pages for response[can be skipped to fetch all pages]
desired number of pages for response [ can be skipped to fetch all pages ]