3

我正在尝试使用经过身份验证的 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":""
   }
}
4

2 回答 2

1

啊。忘记设置标题:(

这有效:

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)
于 2013-07-01T21:36:39.573 回答
1

如果其他人在使用 Coinbase API v2 时遇到此错误 - 您只能将小额支付发送到 Coinbase 电子邮件,而不是任何比特币钱包。

于 2016-08-30T23:37:11.923 回答