@@ -17,15 +17,21 @@ const WARN_SHOULD_BE_UNDEFINED = 'should be undefined';
1717const WARN_SHOULD_BE_TYPE = 'should be a ' ;
1818const TIMEOUT = 10000 ;
1919
20- let chai = require ( 'chai' ) ;
21- let assert = chai . assert ;
22- let path = require ( 'path' ) ;
23- let Binance = require ( path . resolve ( __dirname , '../node-binance-api.js' ) ) ;
24- let binance = new Binance ( ) . options ( {
20+ const chai = require ( 'chai' ) ;
21+ const assert = chai . assert ;
22+ const path = require ( 'path' ) ;
23+ const Binance = require ( path . resolve ( __dirname , '../node-binance-api.js' ) ) ;
24+ const binance = new Binance ( ) . options ( {
2525 APIKEY : 'X4BHNSimXOK6RKs2FcKqExquJtHjMxz5hWqF0BBeVnfa5bKFMk7X0wtkfEz0cPrJ' ,
2626 APISECRET : 'x8gLihunpNq0d46F2q0TWJmeCDahX5LMXSlv3lSFNbMI3rujSOpTDKdhbcmPSf2i' ,
2727 test : true
2828} ) ;
29+ const futuresBinance = new Binance ( ) . options ( {
30+ APIKEY : '227719da8d8499e8d3461587d19f259c0b39c2b462a77c9b748a6119abd74401' ,
31+ APISECRET : 'b14b935f9cfacc5dec829008733c40da0588051f29a44625c34967b45c11d73c' ,
32+ hedgeMode : true ,
33+ test : true
34+ } ) ;
2935// binance.options.APIKEY = "X4BHNSimXOK6RKs2FcKqExquJtHjMxz5hWqF0BBeVnfa5bKFMk7X0wtkfEz0cPrJ"
3036// binance.options.APISECRET = "x8gLihunpNq0d46F2q0TWJmeCDahX5LMXSlv3lSFNbMI3rujSOpTDKdhbcmPSf2i"
3137// binance.options.test = true;
@@ -258,6 +264,23 @@ describe( 'MarketSell', function () {
258264 } ) . timeout ( TIMEOUT ) ;
259265} ) ;
260266
267+ describe ( 'Futures MarketBuy' , function ( ) {
268+ it ( 'futures Attempt to buy ETH at market price' , async function ( ) {
269+ let quantity = 0.1 ;
270+ const res = await futuresBinance . futuresMarketBuy ( 'ETHUSDT' , quantity )
271+ assert ( res [ 'orderId' ] !== undefined )
272+ } ) . timeout ( TIMEOUT ) ;
273+ } ) ;
274+
275+
276+ describe ( 'Futures MarketSell' , function ( ) {
277+ it ( 'futures Attempt to buy ETH at market price' , async function ( ) {
278+ let quantity = 0.1 ;
279+ const res = await futuresBinance . futuresMarketSell ( 'ETHUSDT' , quantity )
280+ assert ( res [ 'orderId' ] !== undefined )
281+ } ) . timeout ( TIMEOUT ) ;
282+ } ) ;
283+
261284// describe( 'MarketSell', function () {
262285// it( 'Attempt to sell ETH at market price', function ( done ) {
263286// let quantity = 1;
0 commit comments