From d4f06e768b372acd4d65e76a028077cb653daba6 Mon Sep 17 00:00:00 2001 From: Jon Eyrick Date: Sun, 19 Nov 2017 10:23:32 -0800 Subject: [PATCH] Updated API endpoints --- node-binance-api.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/node-binance-api.js b/node-binance-api.js index c6f47aa0..fe36ce2d 100644 --- a/node-binance-api.js +++ b/node-binance-api.js @@ -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 = {}; @@ -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); },