【问题标题】:Why Coinbase API doesn't return the sell price for XRP?为什么 Coinbase API 不返回 XRP 的售价?
【发布时间】:2021-02-26 21:05:06
【问题描述】:

对于各种加密货币,API 会返回包含卖出价或现货价的有效响应。就像在这个例子中一样:

❯ curl 'https://api.coinbase.com/v2/prices/XLM-EUR/sell'
{"data":{"base":"XLM","currency":"EUR","amount":"0.32"}}

但对于 XRP,它会返回错误。为什么?我猜测这可能与 Coinbase 已暂停购买 XRP 的事实有关,但仍然有可能出售它,因此可能需要获得汇率。

❯ curl 'https://api.coinbase.com/v2/prices/XRP-EUR/sell'
{"errors":[{"id":"not_found","message":"Invalid base currency"}]}

【问题讨论】:

    标签: coinbase-api


    【解决方案1】:

    我在使用以下代码的钱包客户端时遇到了同样的问题。

    coinbase.wallet.client.Client(
        my_key, my_secret, api_version=my_version,
    ).get_spot_price(currency_pair='XRP-USD')
    

    很高兴看到这个问题得到解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-19
      • 2016-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多