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
8591802c
Commit
8591802c
authored
Sep 14, 2018
by
rongjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
8fef9667
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
kucoinCollector.js
kucoinCollector.js
+9
-11
No files found.
kucoinCollector.js
View file @
8591802c
const
BaseCollector
=
require
(
'./baseCollector'
);
const
BaseCollector
=
require
(
'./baseCollector'
);
const
baseCurrencies
=
[
"ETH"
,
"BTC"
,
"USDT"
,
"NEO"
,
"KCS"
];
const
baseCurrencies
=
[
"ETH"
,
"BTC"
,
"USDT"
,
"NEO"
,
"KCS"
];
const
restCurrencies
=
[
"USDT"
,
"BTC"
,
"ETH"
,
"NEO"
,
"KCS"
,
];
const
restCurrencies
=
[
"
PRA"
,
"AAC"
,
"AT"
,
"RED"
,
"BU"
,
"QTUM"
,
"EOSDAC"
,
"HPB"
,
"ORME"
,
"TRX"
,
"TTC"
,
"
USDT"
,
"BTC"
,
"ETH"
,
"NEO"
,
"KCS"
,
];
// const machine = process.env['MACHINE'];
// const machine = process.env['MACHINE'];
const
machine
=
'K'
const
machine
=
'K'
const
biboxApi
=
require
(
'./api_kucoin'
);
const
biboxApi
=
require
(
'./api_kucoin'
);
...
@@ -30,9 +30,7 @@ class BiboxCollector extends BaseCollector{
...
@@ -30,9 +30,7 @@ class BiboxCollector extends BaseCollector{
const
symbolDetails
=
data
.
data
;
const
symbolDetails
=
data
.
data
;
const
symbolMap
=
{};
const
symbolMap
=
{};
for
(
let
detail
of
symbolDetails
){
for
(
let
detail
of
symbolDetails
){
if
(
detail
.
change
>=
0
){
symbolMap
[
detail
.
symbol
]
=
detail
;
symbolMap
[
detail
.
symbol
]
=
detail
;
}
}
}
callback
(
null
,
symbolMap
);
callback
(
null
,
symbolMap
);
}
}
...
@@ -61,13 +59,13 @@ class BiboxCollector extends BaseCollector{
...
@@ -61,13 +59,13 @@ class BiboxCollector extends BaseCollector{
// })
// })
}
}
_fetchDepthByRest
(
symbols
,
depth
,
callback
){
_fetchDepthByRest
(
symbols
,
depth
,
callback
){
const
restSymbols
=
symbols
;
const
restSymbols
=
[]
;
//
for(let symbol of symbols){
for
(
let
symbol
of
symbols
){
//
const midCurrency = symbol.split("-")[0];
const
midCurrency
=
symbol
.
split
(
"-"
)[
0
];
//
if(restCurrencies.includes(midCurrency)){
if
(
restCurrencies
.
includes
(
midCurrency
)){
//
restSymbols.push(symbol);
restSymbols
.
push
(
symbol
);
//
}
}
//
}
}
const
perInterval
=
500
;
const
perInterval
=
500
;
const
totalInterval
=
perInterval
*
restSymbols
.
length
+
50
;
const
totalInterval
=
perInterval
*
restSymbols
.
length
+
50
;
setInterval
(()
=>
{
setInterval
(()
=>
{
...
...
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