Skip to content

Commit

Permalink
huobipro: withdraw: implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
kornrunner committed Feb 1, 2018
1 parent f1d1ac7 commit 322dada
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions js/huobipro.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = class huobipro extends Exchange {
'fetchOHCLV': true,
'fetchOrders': true,
'fetchOpenOrders': true,
'withdraw': true,
},
'timeframes': {
'1m': '1min',
Expand Down Expand Up @@ -443,6 +444,25 @@ module.exports = class huobipro extends Exchange {
return await this.privatePostOrderOrdersIdSubmitcancel ({ 'id': id });
}

async withdraw (currency, amount, address, tag = undefined, params = {}) {
let request = {
'address': address, // only supports existing addresses in your withdraw address list
'amount': amount,
'currency': currency.toLowerCase (),
};
if (tag)
request['addr-tag'] = tag; // only for XRP?
let response = await this.privatePostDwWithdrawApiCreate (this.extend (request, params));
let id = undefined;
if ('data' in response) {
id = response['data'];
}
return {
'info': response,
'id': id,
};
}

sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
let url = '/';
if (api === 'market')
Expand Down

0 comments on commit 322dada

Please sign in to comment.