pybit/py3/common.py
def api_get(self,
                url: str="https://blockchain.info/rawblock/",
                wait: bool=False):
        """
        Returns none on fail or skip, otherwise returns json
        """

        # Check last query time and either continue, wait and continue,
        # or don't wait (False returned)
        if not self.api_wait(wait=wait):
            return None

        # Query
        try:
            resp = requests.get(url + str(self.hash))
        except:  # ConnectionError:
            # If no connection
            # Don't try again for ~20s
            # Record the last time
            API._lastQueryTime = time.time() + 10

            return None

        # Record the last time
        API._lastQueryTime = time.time()

        if resp.status_code == 200:
            # Get the json
            jr = resp.json()
        else:
            # Or return the response code on error
            jr = None

        return jr

        Returns none on fail or skip, otherwise returns json
        
Returns none on fail or skip, otherwise returns json
Returns none on fail or skip otherwise returns json
def api_get(self,
                url: str="https://blockchain.info/rawblock/",
                wait: bool=False):
        if not self.api_wait(wait=wait):
            return None
        try:
            resp = requests.get(url + str(self.hash))
        except:  
            API._lastQueryTime = time.time() + 10
            return None
        API._lastQueryTime = time.time()
        if resp.status_code == 200:
            jr = resp.json()
        else:
            jr = None
        return jr
def api_get ( self , url : str = "https://blockchain.info/rawblock/" , wait : bool = False ) : if not self . api_wait ( wait = wait ) : return None try : resp = requests . get ( url + str ( self . hash ) ) except : API . _lastQueryTime = time . time ( ) + 10 return None API . _lastQueryTime = time . time ( ) if resp . status_code == 200 : jr = resp . json ( ) else : jr = None return jr
Returns none on fail or skip, otherwise returns json
Returns none on fail or skip otherwise returns json
"""
        Returns none on fail or skip, otherwise returns json
        """ # Check last query time and either continue, wait and continue, # or don't wait (False returned) # Query # ConnectionError: # If no connection # Don't try again for ~20s # Record the last time # Record the last time # Get the json # Or return the response code on error
self
url
str
wait
bool