From a946bdc71a6065b96bf46c859d889fd54b8172ea Mon Sep 17 00:00:00 2001 From: frosty00 Date: Thu, 31 May 2018 21:26:43 +0100 Subject: [PATCH] rebase --- js/gateio.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/gateio.js b/js/gateio.js index 18ca0d992965..5ff64b234c42 100644 --- a/js/gateio.js +++ b/js/gateio.js @@ -22,6 +22,9 @@ module.exports = class gateio extends Exchange { 'withdraw': true, 'createDepositAddress': true, 'fetchDepositAddress': true, + 'fetchClosedOrders': true, + 'fetchOpenOrders': true, + 'fetchOrders': true, }, 'urls': { 'logo': 'https://user-images.githubusercontent.com/1294454/31784029-0313c702-b509-11e7-9ccc-bc0da6a0e435.jpg', @@ -450,6 +453,23 @@ module.exports = class gateio extends Exchange { return await this.queryDepositAddress ('Deposit', code, params); } + async fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) { + await this.loadMarkets (); + let market = this.market (symbol); + let response = this.privatePostOpenOrders (); + return this.parseOrders (response['orders'], market, since, limit); + } + + async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) { + if (typeof symbol === 'undefined') + throw new ExchangeError (this.id + ' fetchMyTrades requires symbol param'); + await this.loadMarkets (); + let market = this.market (symbol); + let id = market['id']; + let response = this.privatePostTradeHistory (this.extend ({ 'currencyPair': id }, params)); + return this.parseTrades (response['trades'], market, since, limit); + } + async withdraw (currency, amount, address, tag = undefined, params = {}) { this.checkAddress (address); await this.loadMarkets ();