Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kucoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rongjun
kucoin
Commits
eb6c91be
Commit
eb6c91be
authored
May 30, 2019
by
zihan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
06c8f7bb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
api_kucoin.js
api_kucoin.js
+12
-7
test_kucoin.js
test_kucoin.js
+5
-5
No files found.
api_kucoin.js
View file @
eb6c91be
...
...
@@ -244,7 +244,11 @@ class biboxApi {
_genSign
(
timestamp
,
method
,
path
,
params
){
let
signStr
=
null
;
if
(
params
){
if
(
method
===
'GET'
){
signStr
=
timestamp
+
method
+
path
+
"?"
+
this
.
transform
(
params
)
}
else
{
signStr
=
timestamp
+
method
+
path
+
JSON
.
stringify
(
params
);
}
}
else
{
signStr
=
timestamp
+
method
+
path
;
}
...
...
@@ -259,6 +263,12 @@ class biboxApi {
}
let
url
=
host
+
path
;
const
timestamp
=
Date
.
now
()
+
''
;
const
requestParams
=
{};
if
(
method
===
'GET'
&&
params
)
{
url
+=
'?'
+
this
.
transform
(
params
);
}
else
if
(
method
===
'POST'
){
requestParams
[
"body"
]
=
JSON
.
stringify
(
params
);
}
const
sign
=
this
.
_genSign
(
timestamp
,
method
,
path
,
params
);
const
headers
=
{
'KC-API-KEY'
:
this
.
apiKey
,
...
...
@@ -267,12 +277,7 @@ class biboxApi {
'KC-API-PASSPHRASE'
:
this
.
pass
,
"Content-Type"
:
"application/json"
}
const
requestParams
=
{};
if
(
method
===
'GET'
&&
params
)
{
url
+=
'?'
+
this
.
transform
(
params
);
}
else
if
(
method
===
'POST'
){
requestParams
[
"body"
]
=
JSON
.
stringify
(
params
);
}
requestParams
[
"url"
]
=
url
;
requestParams
[
"method"
]
=
method
;
requestParams
[
"headers"
]
=
headers
;
...
...
@@ -322,7 +327,7 @@ class biboxApi {
}
balance
(
callback
)
{
this
.
_request
(
"GET"
,
"/api/v1/accounts"
,
null
,
callback
);
this
.
_request
(
"GET"
,
"/api/v1/accounts"
,
{
type
:
'trade'
}
,
callback
);
}
// coins_info(callback) {
...
...
test_kucoin.js
View file @
eb6c91be
...
...
@@ -43,7 +43,7 @@ function testCollector(){
// const strategy3 = new BiboxStrategy3(collector);
// strategy3.run();
}
//
testCollector();
testCollector
();
function
printCurrency
(){
const
currentArray
=
[,
'ETH'
,
'BTC'
,
'LTC'
,
'BCH'
,
'USDT'
,
'USD'
,
'RMB'
,
"RCN"
,
"WINGS"
,
"TRX"
,
"LEND"
,
"CMT"
,
"POWR"
,
"HSR"
,
"GAS"
,
"RDN"
,
"TNT"
,
"OAX"
...
...
@@ -141,10 +141,10 @@ function testOrder(){
// console.log(error);
// console.log(result);
// })
api
.
balance
((
error
,
result
)
=>
{
console
.
log
(
error
);
console
.
log
(
result
);
})
//
api.balance((error,result)=>{
//
console.log(error);
//
console.log(result);
//
})
// const sign = api._genSign('1547015186532','POST', '/api/v1/deposit-addresses',{'currency':'BTC'})
// console.log(sign === '7QP/oM0ykidMdrfNEUmng8eZjg/ZvPafjIqmxiVfYu4=');
// api.balance((error,data)=>{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment