【发布时间】:2021-07-13 15:44:27
【问题描述】:
我正在尝试通过币安链 API 获取公共地址的余额
account_id = "0x1f5ff990d661a4DFDC0Ff7D63Ae6A7E995475b95"
response = requests.get("https://dex.binance.org/api/v1/account/" + account_id.lower())
account = response.json()
但我收到以下错误
{'code': 400, 'message': 'decoding bech32 failed: failed converting data to bytes: invalid character not part of charset: 98'}
如何将公共地址转换为 bech32 格式?或者有没有更好的方法来提取地址的余额?
【问题讨论】:
标签: python binance-smart-chain