MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetch_trading_fees

Method fetch_trading_fees

python/ccxt/bit2c.py:469–515  ·  view source on GitHub ↗

fetch the trading fees for multiple markets https://bit2c.co.il/home/api#balance :param dict [params]: extra parameters specific to the exchange API endpoint :returns dict: a dictionary of `fee structures ` indexed by market

(self, params={})

Source from the content-addressed store, hash-verified

467 return self.parse_trades(response, market, since, limit)
468
469 def fetch_trading_fees(self, params={}) -> TradingFees:
470 """
471 fetch the trading fees for multiple markets
472
473 https://bit2c.co.il/home/api#balance
474
475 :param dict [params]: extra parameters specific to the exchange API endpoint
476 :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/?id=fee-structure>` indexed by market symbols
477 """
478 self.load_markets()
479 response = self.privateGetAccountBalance(params)
480 #
481 # {
482 # "AVAILABLE_NIS": 0.0,
483 # "NIS": 0.0,
484 # "LOCKED_NIS": 0.0,
485 # "AVAILABLE_BTC": 0.0,
486 # "BTC": 0.0,
487 # "LOCKED_BTC": 0.0,
488 # ...
489 # "Fees": {
490 # "BtcNis": {"FeeMaker": 1.0, "FeeTaker": 1.0},
491 # "EthNis": {"FeeMaker": 1.0, "FeeTaker": 1.0},
492 # ...
493 # }
494 # }
495 #
496 fees = self.safe_value(response, 'Fees', {})
497 keys = list(fees.keys())
498 result = {}
499 for i in range(0, len(keys)):
500 marketId = keys[i]
501 symbol = self.safe_symbol(marketId)
502 fee = self.safe_value(fees, marketId)
503 makerString = self.safe_string(fee, 'FeeMaker')
504 takerString = self.safe_string(fee, 'FeeTaker')
505 maker = self.parse_number(Precise.string_div(makerString, '100'))
506 taker = self.parse_number(Precise.string_div(takerString, '100'))
507 result[symbol] = {
508 'info': fee,
509 'symbol': symbol,
510 'taker': taker,
511 'maker': maker,
512 'percentage': True,
513 'tierBased': True,
514 }
515 return result
516
517 def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
518 """

Callers

nothing calls this directly

Calls 8

safe_valueMethod · 0.80
safe_symbolMethod · 0.80
safe_stringMethod · 0.80
parse_numberMethod · 0.80
string_divMethod · 0.80
rangeFunction · 0.50
load_marketsMethod · 0.45

Tested by

no test coverage detected