sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.91k stars 2.19k forks source link

'Client' object has no attribute 'get_asset_balance' Unclosed client session #1285

Open m0h6m9d opened 1 year ago

m0h6m9d commented 1 year ago

import binance.client from binance.client import Client

Pkey = '' Skey = ''

client = Client(api_key = Pkey, api_secret = Skey)

balance = client.get_asset_balance(asset="BTC") print(balance)


balance = client.get_asset_balance(asset="BTC") AttributeError: 'Client' object has no attribute 'get_asset_balance' Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x0000021C51625908>


Screenshot (5)

sammchardy commented 1 year ago

Check your code, the screenshot and code posted don't match. Use the instance, not the class.