dragonchain/lib/dto/bnb.py
def check_balance(self, symbol: str = "BNB") -> int:
        """Check the balance of the address for this network
        Args:
            symbol: stock ticker symbol for token you're trying to check the balance of
        Returns:
            The amount of funds of that token in the wallet
        """
        _log.info(f"[BINANCE] Checking {symbol} balance for {self.address}")
        path = f"balances/{self.address}/{symbol}"  # params expected inside path string
        response = self._call_node_api(path)
        response_json = response.json()
        # cannot check HTTP status codes, errors will return 200 :
        if response_json.get("error") is not None:
            if "interface is nil, not types.NamedAccount" in response_json["error"]["data"] and response.status_code == 500:
                _log.warning(f"[BINANCE] Non 200 response from Binance node:")
                _log.warning(f"[BINANCE] response code: {response.status_code}")
                _log.warning(f"[BINANCE] response error: {response_json['error']['data']}")
                _log.warning("[BINANCE] This is actually expected for a zero balance address.")
                return 0  # return a zero balance
        bnb_balance = int(response_json["balance"]["free"])
        return bnb_balance
Check the balance of the address for this network
        Args:
            symbol: stock ticker symbol for token you're trying to check the balance of
        Returns:
            The amount of funds of that token in the wallet
        
Check the balance of the address for this network
Check the balance of the address for this network
def check_balance(self, symbol: str = "BNB") -> int:
        _log.info(f"[BINANCE] Checking {symbol} balance for {self.address}")
        path = f"balances/{self.address}/{symbol}"  
        response = self._call_node_api(path)
        response_json = response.json()
        if response_json.get("error") is not None:
            if "interface is nil, not types.NamedAccount" in response_json["error"]["data"] and response.status_code == 500:
                _log.warning(f"[BINANCE] Non 200 response from Binance node:")
                _log.warning(f"[BINANCE] response code: {response.status_code}")
                _log.warning(f"[BINANCE] response error: {response_json['error']['data']}")
                _log.warning("[BINANCE] This is actually expected for a zero balance address.")
                return 0  
        bnb_balance = int(response_json["balance"]["free"])
        return bnb_balance
def check_balance ( self , symbol : str = "BNB" ) -> int : _log . info ( f"[BINANCE] Checking {symbol} balance for {self.address}" ) path = f"balances/{self.address}/{symbol}" response = self . _call_node_api ( path ) response_json = response . json ( ) if response_json . get ( "error" ) is not None : if "interface is nil, not types.NamedAccount" in response_json [ "error" ] [ "data" ] and response . status_code == 500 : _log . warning ( f"[BINANCE] Non 200 response from Binance node:" ) _log . warning ( f"[BINANCE] response code: {response.status_code}" ) _log . warning ( f"[BINANCE] response error: {response_json['error']['data']}" ) _log . warning ( "[BINANCE] This is actually expected for a zero balance address." ) return 0 bnb_balance = int ( response_json [ "balance" ] [ "free" ] ) return bnb_balance
Check the balance of the address for this network
Check the balance of the address for this network
"""Check the balance of the address for this network
        Args:
            symbol: stock ticker symbol for token you're trying to check the balance of
        Returns:
            The amount of funds of that token in the wallet
        """ # params expected inside path string # cannot check HTTP status codes, errors will return 200 : # return a zero balance
The amount of funds of that token in the wallet
The amount of funds of that token in the wallet
self
symbol
str
stock ticker symbol for token you're trying to check the balance of
stock ticker symbol for token you ' re trying to check the balance of