我在python中尝试过:
from coinbase.wallet.client import Client
from coinbase.wallet.error import AuthenticationError
import config
class API:
def auth():
try:
client = Client(config.API_KEY, config.API_SECRET)
accounts = client.get_accounts()
for wallet in accounts.data:
print(str(wallet['balance']['currency']) )
except AuthenticationError:
print("Login failed!")
有很多货币名称,但我没有一个。为什么?
发布于 2021-11-01 04:43:55
明白了。由于某种原因,并不是所有货币都在这里列出。
ethAccount = client.get_account('ETH')
print(str(ethAccount['name']) + ' ' + str(ethAccount['balance']['amount']))
https://stackoverflow.com/questions/69796980
复制相似问题