Skip to content

Commit

Permalink
aofex fetchTradingFee
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Mar 27, 2020
1 parent 7937c2b commit a990465
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions js/aofex.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = class aofex extends Exchange {
'fetchOpenOrders': true,
'fetchClosedOrders': true,
'fetchClosedOrder': true,
'fetchTradingFee': true,
},
'timeframes': {
'1m': '1min',
Expand Down Expand Up @@ -330,15 +331,28 @@ module.exports = class aofex extends Exchange {
return this.parseBalance (result);
}

async fetchTradingFees (params = {}) {
async fetchTradingFee (symbol, params = {}) {
await this.loadMarkets ();
const fees = await this.privatePostReturnFeeInfo (params);
const market = this.market (symbol);
const request = {
'symbol': market['id'],
};
const response = await this.privateGetEntrustRate (this.extend (request, params));
//
// {
// "errno":0,
// "errmsg":"success",
// "result": {
// "toFee":"0.002","fromFee":"0.002"
// }
// }
//
const result = this.safeValue (response, 'result', {});
return {
'info': fees,
'maker': this.safeFloat (fees, 'makerFee'),
'taker': this.safeFloat (fees, 'takerFee'),
'withdraw': {},
'deposit': {},
'info': response,
'symbol': symbol,
'maker': this.safeFloat (result, 'fromFee'),
'taker': this.safeFloat (result, 'toFee'),
};
}

Expand Down

0 comments on commit a990465

Please sign in to comment.