我无法弄清楚 Kraken API 输入的去向。我使用 https://api.kraken.com/0/private/AddOrder作为起点。输入包括:pair = XBTUSD、type = buy、ordertype = limit 等。我是 API 新手,我意识到这不是一种典型的方法,但我非常感谢任何指导。
我已经成功地将 API 用于检索帐户余额等其他事情。只是不确定输入适合的位置。我无法从这里的文档中弄清楚https://www.kraken.com/help/api。我想使用一个特定的购买订单作为学习示例。即买入0.003 BTC,配对XBTUSD,限5000 USD...
相关的代码 -
function buyKraken () {
var path = "/0/private/AddOrder";
var nonce = new Date () * 1000;
var postdata = "nonce=" + nonce;
var signature = getKrakenSignature (path, postdata, nonce);
var url = 'https://api.kraken.com' + path;
var options = {
method: 'post',
headers: {
'API-Key': "###########",
'API-Sign': signature
},
payload: postdata
};
var response = UrlFetchApp.fetch (url, options);
Logger.log(response);
;
}