Coinbase python APIError: Failed to send money

Coinbase python APIError: Failed to send money

我正在尝试集成新的 Coinbase python library。我想让 send_money 有效。但不管我怎么试,它一直说

transaction = account.send_money(address, bitcoins)
File "C:\Python27\lib\site-packages\coinbase\model.py", line 360, in send_money
'Failed to send money')
File "C:\Python27\lib\site-packages\coinbase\error.py", line 58, in build_api_error
raise error
APIError: Failed to send money

我的python代码:

bitcoins = 0.0001
# address = a bitcoin wallet address
client = Client(API_KEY, API_SECRET)
account = client.get_account()
transaction = account.send_money(address, str(bitcoins))

我可以查看余额,所以 account 正常。此外,所有权限均在 Coinbase 网站的 API 设置中授予。

您可能需要查看错误的 response 以了解调用失败的原因。发生这种情况的原因有多种,但错误消息应该会告诉您更多信息。

https://github.com/coinbase/coinbase-python#error-handling

from coinbase.error import CoinbaseError

try:
    transaction = account.send_money(address, bitcoins)
except CoinbaseError as e:
    print e.response.text