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

Commit

Permalink
Add assetDetail and tradeFee functions
Browse files Browse the repository at this point in the history
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");
});
```
  • Loading branch information
Jon Eyrick authored Aug 29, 2018
2 parents 26f61e9 + 3a3b73e commit cd6d98e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
28 changes: 24 additions & 4 deletions node-binance-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1321,11 +1321,11 @@ let api = function Binance() {
/**
* Get the Withdraws history for a given asset
* @param {function} callback - the callback function
* @param {string} asset - the asset symbol
* @param {object} params - supports limit and fromId parameters
* @return {undefined}
*/
withdrawHistory: function (callback, asset = false) {
let params = asset ? { asset: asset } : {};
withdrawHistory: function (callback, params = {}) {
if (typeof params === 'string') params = { asset: params };
signedRequest(wapi + 'v3/withdrawHistory.html', params, callback);
},

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

/**
* Get the trade fee
* @param {function} callback - the callback function
* @param {string} symbol (optional)
* @return {undefined}
*/
tradeFee: function (callback, symbol = false) {
let params = symbol ? {symbol:symbol} : {};
signedRequest(wapi + 'v3/tradeFee.html', params, callback);
},

/**
* Fetch asset detail (minWithdrawAmount, depositStatus, withdrawFee, withdrawStatus, depositTip)
* @param {function} callback - the callback function
* @return {undefined}
*/
assetDetail: function (callback) {
signedRequest(wapi + 'v3/assetDetail.html', {}, callback);
},

/**
* Get the account
* @param {function} callback - the callback function
Expand Down Expand Up @@ -1735,7 +1755,7 @@ let api = function Binance() {
return symbol.toLowerCase() + '@depth';
});
subscription = subscribeCombined(streams, handleDepthStreamData, reconnect, function () {
async.mapLimit(symbols, symbols.length, getSymbolDepthSnapshot, (err, results) => {
async.mapLimit(symbols, 50, getSymbolDepthSnapshot, (err, results) => {
if (err) throw err;
results.forEach(updateSymbolDepthCache);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-binance-api",
"version": "0.8.0",
"version": "0.8.2",
"description": "Binance API for node https://github.com/jaggedsoft/node-binance-api",
"main": "node-binance-api.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let binance = new Binance();
let util = require('util');

let num_pairs = 299;
let num_currencies = 156;
let num_currencies = 155;

let logger = {
log: function (msg) {
Expand Down

0 comments on commit cd6d98e

Please sign in to comment.