node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

Margin Accountbug simple suggested fix

Open TomToms55 opened this issue 3 years ago • 0 comments

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 );
    } );
},

TomToms55 avatar Jan 03 '23 10:01 TomToms55