|
@@ -267,6 +267,12 @@ describe('deepcoin站点测试', () => {
|
|
|
|
|
|
|
|
test('签名', (done) => {
|
|
test('签名', (done) => {
|
|
|
|
|
|
|
|
|
|
+ // TODO 不知道哪来的
|
|
|
|
|
+ let info = {
|
|
|
|
|
+ 'i': 547798,
|
|
|
|
|
+ 's': '61dd6c49529a05569900e71f49a0cd87',
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function randomStr (e) {
|
|
function randomStr (e) {
|
|
|
e = e || 32
|
|
e = e || 32
|
|
|
var t = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
|
|
var t = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'
|
|
@@ -277,32 +283,29 @@ describe('deepcoin站点测试', () => {
|
|
|
return n
|
|
return n
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // TODO 不知道哪来的
|
|
|
|
|
- let info = {
|
|
|
|
|
- 'i': 547798,
|
|
|
|
|
- 's': '61dd6c49529a05569900e71f49a0cd87',
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 替换到params中
|
|
|
let timestamp = +new Date,
|
|
let timestamp = +new Date,
|
|
|
convertPOST = 1,
|
|
convertPOST = 1,
|
|
|
randomstr = randomStr(6),
|
|
randomstr = randomStr(6),
|
|
|
appid = info.i
|
|
appid = info.i
|
|
|
|
|
|
|
|
|
|
+
|
|
|
let params = {
|
|
let params = {
|
|
|
- "ExchangeID": "DeepCoin",
|
|
|
|
|
- "InstrumentID": "1BTCUSD",
|
|
|
|
|
- "MemberID": "9313134",
|
|
|
|
|
- "ActionType": "1",
|
|
|
|
|
- "AccountID": "9313134",
|
|
|
|
|
- "IsCrossMargin": 1,
|
|
|
|
|
- "TradeUnitID": "9313134",
|
|
|
|
|
- "LongLeverage": 32,
|
|
|
|
|
- "ShortLeverage": 32,
|
|
|
|
|
- "UserID": "9313134",
|
|
|
|
|
- "appid": 547798,
|
|
|
|
|
- "randomstr": "yw4d6k",
|
|
|
|
|
- "timestamp": 1734787294762,
|
|
|
|
|
- "convertPOST": convertPOST
|
|
|
|
|
|
|
+ 'ExchangeID': 'DeepCoin',
|
|
|
|
|
+ 'InstrumentID': '1BTCUSD',
|
|
|
|
|
+ 'MemberID': '9313134',
|
|
|
|
|
+ 'ActionType': '1',
|
|
|
|
|
+ 'AccountID': '9313134',
|
|
|
|
|
+ 'IsCrossMargin': 1,
|
|
|
|
|
+ 'TradeUnitID': '9313134',
|
|
|
|
|
+ 'LongLeverage': 32,
|
|
|
|
|
+ 'ShortLeverage': 32,
|
|
|
|
|
+ 'UserID': '9313134',
|
|
|
|
|
+
|
|
|
|
|
+ 'appid': 547798,
|
|
|
|
|
+ 'randomstr': 'yw4d6k',
|
|
|
|
|
+ 'timestamp': 1734787294762,
|
|
|
|
|
+ 'convertPOST': convertPOST,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let CryptoJS = require('crypto-js')
|
|
let CryptoJS = require('crypto-js')
|
|
@@ -322,7 +325,7 @@ describe('deepcoin站点测试', () => {
|
|
|
appid,
|
|
appid,
|
|
|
convertPOST,
|
|
convertPOST,
|
|
|
randomstr,
|
|
randomstr,
|
|
|
- 'timestamp': Date.now(),
|
|
|
|
|
|
|
+ timestamp,
|
|
|
...params,
|
|
...params,
|
|
|
}
|
|
}
|
|
|
|
|
|