tiagosiebler / binance

Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & browser support, integration tests, beautification & more.
MIT License
747 stars 266 forks source link

Margin Accountbug simple suggested fix #285

Closed TomToms55 closed 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 );
    } );
},
tiagosiebler commented 1 year ago

Hi @TomToms55 ,

I think you may be referring to a different SDK. My connectors all use promises instead of callbacks, and this particular pair of endpoints is exposed as two separate functions in the MainClient class: https://github.com/tiagosiebler/binance/blob/master/src/main-client.ts#L910 https://github.com/tiagosiebler/binance/blob/master/src/main-client.ts#L970

TomToms55 commented 1 year ago

Your are right! Sorry about that. Too many tabs opened. I wanted to comment on node-binance-api. Your SDK is fully functional :) Have a great day