-1

我正在尝试集成新的Coinbase python 库。我想让 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 设置中授予。

4

1 回答 1

0

您可能想查看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
于 2015-03-29T00:26:06.663 回答