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

Method safe_currency_code

python/ccxt/kraken.py:907–916  ·  view source on GitHub ↗
(self, currencyId: Str, currency: Currency = None)

Source from the content-addressed store, hash-verified

905 })
906
907 def safe_currency_code(self, currencyId: Str, currency: Currency = None) -> Str:
908 if currencyId is None:
909 return currencyId
910 if currencyId.find('.') > 0:
911 # if ID contains .M, .S or .F, then it can't contain X or Z prefix. in such case, ID equals to ALTNAME
912 parts = currencyId.split('.')
913 firstPart = self.safe_string(parts, 0)
914 secondPart = self.safe_string(parts, 1)
915 return super(kraken, self).safe_currency_code(firstPart, currency) + '.' + secondPart
916 return super(kraken, self).safe_currency_code(currencyId, currency)
917
918 def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
919 """

Callers 15

fetch_marketsMethod · 0.95
parse_currencyMethod · 0.95
parse_ledger_entryMethod · 0.95
parse_balanceMethod · 0.95
parse_transactionMethod · 0.95
parse_currencyMethod · 0.45
fetch_spot_marketsMethod · 0.45
parse_balanceMethod · 0.45
parse_margin_balanceMethod · 0.45
parse_swap_balanceMethod · 0.45

Calls 3

findMethod · 0.80
splitMethod · 0.80
safe_stringMethod · 0.80

Tested by

no test coverage detected