【发布时间】:2021-10-28 18:46:52
【问题描述】:
我正在尝试从我的 Binance 账户中获取我的 Spot 钱包资产余额。
我尝试过的:
bal = client.get_account()
print(bal)
返回:
"makerCommission": 15,
"takerCommission": 15,
"buyerCommission": 0,
"sellerCommission": 0,
"canTrade": true,
"canWithdraw": true,
"canDeposit": true,
"balances": [
{
"asset": "BTC",
"free": "4723846.89208129",
"locked": "0.00000000"
},
{
"asset": "LTC",
"free": "4763368.68006011",
"locked": "0.00000000"
}
]
}
所以要达到我尝试的平衡值:
bal = client.get_account()
for i in bal:
if(i == 'balances'):
for e in i:
print(e)
但这返回了这个:
b
a
l
a
n
c
e
s
那么我如何访问我的资产余额?
提前致谢。
【问题讨论】:
标签: python-3.x list dictionary nested binance-api-client