def query_balance(self, asset: str, b58_address: str) -> int:
        """
        This interface is used to query the account's ONT or ONG balance.

        :param asset: a string which is used to indicate which asset we want to check the balance.
        :param b58_address: a base58 encode account address.
        :return: account balance.
        """
        raw_address = Address.b58decode(b58_address).to_bytes()
        contract_address = self.get_asset_address(asset)
        invoke_code = build_native_invoke_code(contract_address, b'\x00', "balanceOf", raw_address)
        tx = Transaction(0, 0xd1, int(time()), 0, 0, None, invoke_code, bytearray(), list())
        response = self.__sdk.rpc.send_raw_transaction_pre_exec(tx)
        try:
            balance = ContractDataParser.to_int(response['Result'])
            return balance
        except SDKException:
            return 0
def query_balance ( self , asset : str , b58_address : str ) -> int : raw_address = Address . b58decode ( b58_address ) . to_bytes ( ) contract_address = self . get_asset_address ( asset ) invoke_code = build_native_invoke_code ( contract_address , b'\x00' , "balanceOf" , raw_address ) tx = Transaction ( 0 , 0xd1 , int ( time ( ) ) , 0 , 0 , None , invoke_code , bytearray ( ) , list ( ) ) response = self . __sdk . rpc . send_raw_transaction_pre_exec ( tx ) try : balance = ContractDataParser . to_int ( response [ 'Result' ] ) return balance except SDKException : return 0
This interface is used to query the account's ONT or ONG balance.

        :param asset: a string which is used to indicate which asset we want to check the balance.
        :param b58_address: a base58 encode account address.
        :return: account balance.