Skip to content
This repository was archived by the owner on Oct 30, 2023. It is now read-only.

Commit cd6d98e

Browse files
author
Jon Eyrick
authored
Add assetDetail and tradeFee functions
Add assetDetail and tradeFee functions ```js const Binance = require('node-binance-api'); const binance = new Binance().options("options.json"); binance.useServerTime( () => { binance.assetDetail((error, response) => { console.log(response); }); binance.tradeFee((error, response) => { console.log(response); }, "BNBBTC"); }); ```
2 parents 26f61e9 + 3a3b73e commit cd6d98e

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

node-binance-api.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,11 @@ let api = function Binance() {
13211321
/**
13221322
* Get the Withdraws history for a given asset
13231323
* @param {function} callback - the callback function
1324-
* @param {string} asset - the asset symbol
1324+
* @param {object} params - supports limit and fromId parameters
13251325
* @return {undefined}
13261326
*/
1327-
withdrawHistory: function (callback, asset = false) {
1328-
let params = asset ? { asset: asset } : {};
1327+
withdrawHistory: function (callback, params = {}) {
1328+
if (typeof params === 'string') params = { asset: params };
13291329
signedRequest(wapi + 'v3/withdrawHistory.html', params, callback);
13301330
},
13311331

@@ -1359,6 +1359,26 @@ let api = function Binance() {
13591359
signedRequest(wapi + 'v3/accountStatus.html', {}, callback);
13601360
},
13611361

1362+
/**
1363+
* Get the trade fee
1364+
* @param {function} callback - the callback function
1365+
* @param {string} symbol (optional)
1366+
* @return {undefined}
1367+
*/
1368+
tradeFee: function (callback, symbol = false) {
1369+
let params = symbol ? {symbol:symbol} : {};
1370+
signedRequest(wapi + 'v3/tradeFee.html', params, callback);
1371+
},
1372+
1373+
/**
1374+
* Fetch asset detail (minWithdrawAmount, depositStatus, withdrawFee, withdrawStatus, depositTip)
1375+
* @param {function} callback - the callback function
1376+
* @return {undefined}
1377+
*/
1378+
assetDetail: function (callback) {
1379+
signedRequest(wapi + 'v3/assetDetail.html', {}, callback);
1380+
},
1381+
13621382
/**
13631383
* Get the account
13641384
* @param {function} callback - the callback function
@@ -1735,7 +1755,7 @@ let api = function Binance() {
17351755
return symbol.toLowerCase() + '@depth';
17361756
});
17371757
subscription = subscribeCombined(streams, handleDepthStreamData, reconnect, function () {
1738-
async.mapLimit(symbols, symbols.length, getSymbolDepthSnapshot, (err, results) => {
1758+
async.mapLimit(symbols, 50, getSymbolDepthSnapshot, (err, results) => {
17391759
if (err) throw err;
17401760
results.forEach(updateSymbolDepthCache);
17411761
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-binance-api",
3-
"version": "0.8.0",
3+
"version": "0.8.2",
44
"description": "Binance API for node https://github.com/jaggedsoft/node-binance-api",
55
"main": "node-binance-api.js",
66
"dependencies": {

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let binance = new Binance();
2525
let util = require('util');
2626

2727
let num_pairs = 299;
28-
let num_currencies = 156;
28+
let num_currencies = 155;
2929

3030
let logger = {
3131
log: function (msg) {

0 commit comments

Comments
 (0)