jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.58k stars 767 forks source link

Margin Accountbug simple suggested fix #868

Open TomToms55 opened 1 year ago

TomToms55 commented 1 year ago

Missing parenthesis in line 4813 function mgAccount.

endpoint += (isIsolated)?'/isolated':'' + '/account';

to

endpoint += ((isIsolated)?'/isolated':'') + '/account';

Context (corrected):

/**
 * Margin account details
 * @param {function} callback - the callback function
 * @param {boolean} isIsolated - the callback function
 * @return {undefined}
 */
mgAccount: function( callback ,isIsolated = false) {
    let endpoint = 'v1/margin';
    endpoint += ((isIsolated)?'/isolated':'') + '/account';
    signedRequest( sapi + endpoint, {}, function( error, data ) {
        if( callback ) return callback( error, data );
    } );
},