File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const _isArray = require ( 'lodash/isArray' )
4
4
const _isFinite = require ( 'lodash/isFinite' )
5
- const runExample = require ( '../util/run_example' )
5
+ const { args : { apiKey, apiSecret } , debug } = require ( '../util/setup' )
6
+ const WSv2 = require ( '../../lib/transports/ws2' )
7
+
8
+ async function execute ( ) {
9
+ const ws = new WSv2 ( {
10
+ apiKey,
11
+ apiSecret,
12
+ transform : true
13
+ } )
14
+ ws . on ( 'error' , e => debug ( 'WSv2 error: %s' , e . message | e ) )
15
+ await ws . open ( )
16
+ await ws . auth ( )
6
17
7
- module . exports = runExample ( {
8
- name : 'ws2-sequencing' ,
9
- ws : { env : true , connect : true , auth : true }
10
- } , async ( { ws, debug } ) => {
11
18
// Enables internal sequence tracking; an error will be emitted if there is a
12
19
// seq # mis-match
13
20
await ws . enableSequencing ( { audit : true } )
@@ -39,4 +46,7 @@ module.exports = runExample({
39
46
debug ( 'recv public seq # %d, auth seq # %d' , seq , authSeq )
40
47
}
41
48
} )
42
- } )
49
+ await ws . close ( )
50
+ }
51
+
52
+ execute ( )
You can’t perform that action at this time.
0 commit comments