python - Coinbase send_money API 总是返回 "amount is below the current minimum"错误

标签 python python-requests bitcoin

我正在尝试使用经过身份验证的 access_token 将一些 btc 发送到另一个 coinbase 地址。一切似乎都正常,除了 Coinbase 总是以“低于最低金额”作为回应。谁能看出我在这里做错了什么?

url = "https://coinbase.com/api/v1/transactions/send_money?access_token=XXX"
params = {
             "transaction": { 
                 "to": "1G8f9pRvgprVMUymuQugZrhYSqBNXuwzNt", 
                 "amount": "0.011", 
                 "notes": "Testing transaction" 
             }
         }

r = requests.post(url, data=json.dumps(params)

Coinbase 返回:

{
   "success":false,
   "errors":["You must enter a positive amount","This transaction amount is below the current minimum amount to be accepted by the bitcoin network. (0.00005430 BTC)"],
   "transaction":{"id":"XXX",
                  "created_at":null,
                  "hsh":null,
                  "notes":null,
                  "amount":{"amount":"0.00000000","currency":"BTC"},
                  "request":false,
                  "status":"pending",
                  "recipient_address":""
   }
}

最佳答案

呃。忘记设置标题 :(

这个有效:

url = "https://coinbase.com/api/v1/transactions/send_money?access_token=XXX"
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
params = {
             "transaction": { 
                 "to": "1G8f9pRvgprVMUymuQugZrhYSqBNXuwzNt", 
                 "amount": "0.011", 
                 "notes": "Testing transaction" 
             }
         }

r = requests.post(url, data=json.dumps(postData), headers=headers)

关于python - Coinbase send_money API 总是返回 "amount is below the current minimum"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17412510/

相关文章:

python - 使用固定字符在 Z3 中定义位向量

linux - Python - [SSL : CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl. c:1091)

c++ - 通过 C a #define(或其他代码/编译时解决方案)省略核心转储?

java - 使用bitcoinj观看地址

python - 如何在python中对Wikipedia类别进行分组?

python - Python 中有限重复的组合

python - 在Python中写入文件时数据被切断

python - Google App Engine 中的证书存储

Python 请求库将 PDF 传递给 Django 服务器

ruby - 加密货币地址生成