我正在尝试使用一个经过身份验证的访问令牌将一些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始终返回“金额低于当前最低金额”错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17412510/

10-09 19:18