IPC removed, replaced by WS

This commit is contained in:
Luis Fernando Molina committed 2020-04-06 08:33:07 +02:00
1 parent ba4217fb24
commit 656c193511
503 files changed
+28128 -34498

No files matched your search

+42 -2
View File
@@ -15,6 +15,7 @@ module.exports = class gateio extends Exchange {
'countries': [ 'CN' ],
'version': '2',
'rateLimit': 1000,
'pro': true,
'has': {
'CORS': false,
'createMarketOrder': false,
@@ -68,6 +69,7 @@ module.exports = class gateio extends Exchange {
'pairs',
'marketinfo',
'marketlist',
'coininfo',
'tickers',
'ticker/{id}',
'orderBook/{id}',
@@ -89,6 +91,7 @@ module.exports = class gateio extends Exchange {
'getOrder',
'openOrders',
'tradeHistory',
'feelist',
'withdraw',
],
},
@@ -152,6 +155,10 @@ module.exports = class gateio extends Exchange {
},
},
},
'commonCurrencies': {
'BTCBEAR': 'BEAR',
'BTCBULL': 'BULL',
},
});
}
@@ -373,6 +380,18 @@ module.exports = class gateio extends Exchange {
}
parseTrade (trade, market = undefined) {
// {
// "tradeID": 3175762,
// "date": "2017-08-25 07:24:28",
// "type": "sell",
// "rate": 29011,
// "amount": 0.0019,
// "total": 55.1209,
// "fee": "0",
// "fee_coin": "btc",
// "gt_fee":"0",
// "point_fee":"0.1213",
// },
let timestamp = this.safeTimestamp2 (trade, 'timestamp', 'time_unix');
timestamp = this.safeTimestamp (trade, 'time', timestamp);
const id = this.safeString2 (trade, 'tradeID', 'id');
@@ -381,6 +400,7 @@ module.exports = class gateio extends Exchange {
const price = this.safeFloat2 (trade, 'rate', 'price');
const amount = this.safeFloat (trade, 'amount');
const type = this.safeString (trade, 'type');
const takerOrMaker = this.safeString (trade, 'role');
let cost = undefined;
if (price !== undefined) {
if (amount !== undefined) {
@@ -391,6 +411,25 @@ module.exports = class gateio extends Exchange {
if (market !== undefined) {
symbol = market['symbol'];
}
let fee = undefined;
let feeCurrency = this.safeCurrencyCode (this.safeString (trade, 'fee_coin'));
let feeCost = this.safeFloat (trade, 'point_fee');
if ((feeCost === undefined) || (feeCost === 0)) {
feeCost = this.safeFloat (trade, 'gt_fee');
if ((feeCost === undefined) || (feeCost === 0)) {
feeCost = this.safeFloat (trade, 'fee');
} else {
feeCurrency = this.safeCurrencyCode ('GT');
}
} else {
feeCurrency = this.safeCurrencyCode ('POINT');
}
if (feeCost !== undefined) {
fee = {
'cost': feeCost,
'currency': feeCurrency,
};
}
return {
'id': id,
'info': trade,
@@ -400,11 +439,11 @@ module.exports = class gateio extends Exchange {
'order': orderId,
'type': undefined,
'side': type,
'takerOrMaker': undefined,
'takerOrMaker': takerOrMaker,
'price': price,
'amount': amount,
'cost': cost,
'fee': undefined,
'fee': fee,
};
}
@@ -496,6 +535,7 @@ module.exports = class gateio extends Exchange {
}
return {
'id': id,
'clientOrderId': undefined,
'datetime': this.iso8601 (timestamp),
'timestamp': timestamp,
'lastTradeTimestamp': lastTradeTimestamp,