/
userData.js
49 lines (46 loc) · 1.1 KB
/
userData.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict'
/**
* Websocket API user data stream endpoints
* @module Websocket
* @param {*} superclass
*/
const UserData = superclass => class extends superclass {
/**
*
* Start a new user data stream.<br>
*
*
* {@link https://binance-docs.github.io/apidocs/websocket_api/en/#start-user-data-stream-user_stream}
*
*/
startUserDataStream () {
this.sendMessageWithAPIKey('userDataStream.start')
}
/**
* Ping user data stream.< br>
*
* Ping a user data stream to keep it alive.<br>
*
*
* {@link https://binance-docs.github.io/apidocs/websocket_api/en/#ping-user-data-stream-user_stream}
*
* @param {string} listenKey
*
*/
pingUserDataStream (listenKey) {
this.sendMessageWithAPIKey('userDataStream.ping', { listenKey })
}
/**
* Stop user data stream.< br>
*
* Explicitly stop and close the user data stream.<br>
*
*
* {@link https://binance-docs.github.io/apidocs/websocket_api/en/#stop-user-data-stream-user_stream}
*
*/
stopUserDataStream (listenKey) {
this.sendMessageWithAPIKey('userDataStream.stop', { listenKey })
}
}
module.exports = UserData