簡體   English   中英

使用 Coinbase 從一種加密貨幣轉換為另一種加密貨幣 API

[英]Convert from one crypto to another using Coinbase API

我試圖創建一個 python 程序來將 ETH 轉換為 BTC。 我正在使用命令:

client.transfer_money("ETH Account ID ", to="BTC Account ID", amount="0.1", currency=:"ETH")

我使用以下命令獲得了帳戶 ID:

client.get_accounts()

並將 ID 復制粘貼到我的傳輸命令中。 但是我收到此錯誤:

~/opt/anaconda3/envs/Coinbase/lib/python3.8/site-packages/coinbase/wallet/client.py in transfer_money(self, account_id, **params)
    338     params['type'] = 'transfer'
    339     response = self._post('v2', 'accounts', account_id, 'transactions', data=params)
--> 340     return self._make_api_object(response, Transaction)
    341 
    342   def request_money(self, account_id, **params):

~/opt/anaconda3/envs/Coinbase/lib/python3.8/site-packages/coinbase/wallet/client.py in _make_api_object(self, response, model_type)
    143     # All valid responses have a "data" key.
    144     if data is None:
--> 145       raise build_api_error(response, blob)
    146     # Warn the user about each warning that was returned.
    147     warnings_data = blob.get('warnings', None)

APIError: APIError(id=): 

有人能找出這個錯誤是什么嗎?

官方圖書館已棄用。

最近引入了三個錯誤由於不推薦使用而未處理),我已經在這個fork 庫中處理了這些錯誤並在 pypi 中發布。 您可以嘗試使用它,如果問題仍然存在,請在GitHub repo上提交問題

我寫了一個小腳本來在 Coinbase 上交換加密貨幣。 它仍然非常混亂並且沒有優化,因為我還是一個初學者,但它做了它應該做的事情。 https://github.com/Chel-Jessen/coinbase_convert

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM