【问题标题】:Coinbase API, some currencies are missing?Coinbase API,缺少一些货币?
【发布时间】:2021-12-16 04:30:06
【问题描述】:

我在 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!")

并且获得了很多货币名称,但没有一个是我拥有的。 为什么?

【问题讨论】:

    标签: python python-3.x cryptocurrency coinbase-api


    【解决方案1】:

    知道了。出于某种原因,此处并未列出所有货币。

    ethAccount = client.get_account('ETH')
    print(str(ethAccount['name']) + ' ' + str(ethAccount['balance']['amount']))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-11-22
      • 1970-01-01
      • 1970-01-01
      • 2021-08-02
      • 1970-01-01
      • 2018-05-02
      • 2018-03-05
      相关资源
      最近更新 更多