2
Follow
0
Followers
[FMZ プラットフォーム拡張 API の問題] 拡張 API にアクセスすると、JS 言語のシグネチャが常に間違っています。専門家のアドバイスをお願いします。
Created 2019-10-10 19:31:03
6
1913
例えば,PYとGOの例を挙げると,署名に関するこの段落は,MD5暗号化とUTF-8コード化,PYはライブラリに直接導入されているが,JSはUTF-8コードの関数を持っていない.
method と accessKey の前に 付加値があります。
var d = {
version: '1.0',
access_key: accessKey,
method: method,
args: [],
nonce: _N(UnixNano() / 1000000, 0),
}
var m = d.version + "|" + d.method + "|" + d.args + "|" + d.nonce + "|" + secretKey
d.sign = HMAC("md5", "hex", m, "pass")
var h = JSON.parse(HttpQuery("https://www.fmz.cn/api/v1?access_key="+accessKey+"&nonce="+d.nonce+"&args=[]&sign="+d.sign+"&version=1.0&method="+d.method))
Related Recommendations
Advanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?5.5 Trading strategy optimization
Comment
All comments (5)
写了一个,测试可以访问通了,您参考下:
function main() {
var accessKey = ""
var secretKey = ""
var method = "GetNodeList"
var d = {
version: '1.0',
access_key: accessKey,
method: method,
args: "null",
nonce: (new Date().getTime()).toString()
}
var m = d.version + "|" + d.method + "|" + d.args + "|" + d.nonce + "|" + secretKey
d.sign = Hash("md5", "hex", m)
var ret = HttpQuery("https://www.fmz.com/api/v1?access_key=" + accessKey + "&nonce=" + d.nonce + "&args=null&sign=" + d.sign + "&version=1.0&method=" + d.method)
Log(ret)
}
accessKey , secretKey 填写自己的KEY 就可以了。
7 years ago
- 1
