Skip to content

Commit

Permalink
Updated API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Eyrick authored Nov 19, 2017
1 parent f5848a1 commit d4f06e7
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions node-binance-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ module.exports = function() {
const WebSocket = require('ws');
const request = require('request');
const crypto = require('crypto');
const base = 'https://www.binance.com/api/';
const wapi = 'https://www.binance.com/wapi/';
const base = 'https://api.binance.com/api/';
const wapi = 'https://api.binance.com/wapi/';
const websocket_base = 'wss://stream.binance.com:9443/ws/';
let messageQueue = {};
let depthCache = {};
Expand Down Expand Up @@ -383,6 +383,22 @@ module.exports = function() {
if ( callback ) return callback.call(this, data, symbol);
});
},
withdraw: function(asset, address, amount, addressTag = false, callback = false) {
let params = {asset, address, amount};
if ( addressTag ) params.addressTag = addressTag;
signedRequest(wapi+"v3/withdraw.html", params, callback, "POST");
},
withdrawHistory: function(callback, asset = false) {
let params = asset ? {asset:asset} : {};
signedRequest(wapi+"v3/withdrawHistory.html", params, callback);
},
depositHistory: function(callback, asset = false) {
let params = asset ? {asset:asset} : {};
signedRequest(wapi+"v3/depositHistory.html", params, callback);
},
depositAddress: function(asset, callback) {
signedRequest(wapi+"v3/depositAddress.html", {asset:asset}, callback);
},
account: function(callback) {
signedRequest(base+"v3/account", {}, callback);
},
Expand Down

0 comments on commit d4f06e7

Please sign in to comment.