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
4f2228b8
Commit
4f2228b8
authored
Oct 08, 2018
by
zihan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
502也继续创建卖单
parent
09cc245f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
48 deletions
+1
-48
api_kucoin.js
api_kucoin.js
+0
-47
kucoinStrategy3.js
kucoinStrategy3.js
+1
-1
No files found.
api_kucoin.js
View file @
4f2228b8
...
...
@@ -48,53 +48,6 @@ class biboxApi {
this
.
allowRequest
=
true
;
}
// subscribeSymbolsAndTicker(symbols, callback) {
// this._publicRequest('/v1/bullet/usercenter/loginUser',{protocol:'websocket',encrypt:true},(error,result)=>{
// if(error){
// console.log("fetch ws token error");
// this.subscribeSymbolsAndTicker(symbols,callback);
// }else{
// const token = result.data.bulletToken;
// this._openWs(symbols,token,callback);
// }
// });
// }
// _openWs(symbols,token, callback) {
// const reqURL = `${wsUrl}?bulletToken=${token}&format=json&resource=api`;
// const wss = new WebSocket(reqURL, {agent});
// wss.on('open', () => {
// console.log("websocket on open");
// });
// wss.on('message', (data) => {
// const response = JSON.parse(data);
// if(response.type === 'ack'){
// const id = response.id;
// for(const symbol of symbols){
// wss.send(JSON.stringify({id,type:'subscribe','topic':`/trade/${symbol}_TRADE`}))
// }
// setInterval(()=>{
// wss.send(JSON.stringify({id,type:'ping'}))
// },40000);
// }else if(response.type === 'subscribe'){
// callback(null,response);
// }else{
// console.log(data);
// }
// });
// wss.on('error', (error) => {
// console.log(" websocket error:");
// console.log(error);
// })
// wss.on('close', () => {
// console.log("websocket closed");
// setTimeout(() => {
// this.subscribeSymbolsAndTicker(symbols, callback);
// }, 2000);
// })
// }
subscribeSymbols
(
symbols
,
depth
,
callback
)
{
this
.
_publicRequest
(
'/v1/bullet/usercenter/loginUser'
,{
protocol
:
'websocket'
,
encrypt
:
true
},(
error
,
result
)
=>
{
if
(
error
){
...
...
kucoinStrategy3.js
View file @
4f2228b8
...
...
@@ -37,7 +37,7 @@ class BiboxStrategy3 extends Strategy3 {
sellSymbol
,
sellPrice
,
amount
,
constants
.
OrderSideSell
,
(
error
,
order
)
=>
{
if
(
error
)
{
if
(
error
.
code
===
"NO_BALANCE"
||
(
error
.
code
===
'ERROR'
&&
error
.
msg
===
'SYMBOL NOT FOUND'
)){
if
(
error
.
code
===
"NO_BALANCE"
||
(
error
.
code
===
'ERROR'
&&
error
.
msg
===
'SYMBOL NOT FOUND'
)
||
error
.
statusCode
==
502
){
if
(
retryTime
>
0
&&
!
createdSellOrder
){
console
.
log
(
"提示余额不足,再次尝试"
);
retryTime
--
;
...
...
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