File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
2+ const chai = require ( 'chai' ) ;
3+ const assert = chai . assert ;
4+ const Binance = require ( path . resolve ( __dirname , '../node-binance-api.js' ) ) ;
5+
6+ const apiKey = 'XXXXXXXXXXXXXXXX'
7+ const apiSecret = 'YYYYYYYYYYYYYYYYYYYYYY'
8+
9+ const binanceWithoutNew = Binance ( ) . options ( {
10+ APIKEY : apiKey ,
11+ APISECRET : apiSecret ,
12+ } )
13+
14+ assert ( binanceWithoutNew . getOptions ( ) . APIKEY === apiKey )
15+ assert ( binanceWithoutNew . getOptions ( ) . APISECRET === apiSecret )
16+
17+ const binanceWithOptions = new Binance ( ) . options ( {
18+ APIKEY : apiKey ,
19+ APISECRET : apiSecret ,
20+ } )
21+
22+ assert ( binanceWithOptions . getOptions ( ) . APIKEY === apiKey )
23+ assert ( binanceWithOptions . getOptions ( ) . APISECRET === apiSecret )
24+
25+ const binance = new Binance ( {
26+ APIKEY : apiKey ,
27+ APISECRET : apiSecret ,
28+ } ) ;
29+
30+ assert ( binance . getOptions ( ) . APIKEY === apiKey )
31+ assert ( binance . getOptions ( ) . APISECRET === apiSecret )
32+
33+
34+ // async function main() {
35+ // const ticker = await binanceWithOptions.prices( 'BNBBTC' )
36+ // console.log(ticker)
37+ // }
You can’t perform that action at this time.
0 commit comments