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

Method safe_currency_code

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

Source from the content-addressed store, hash-verified

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

Callers 15

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

Calls 3

findMethod · 0.80
splitMethod · 0.80
safe_stringMethod · 0.80

Tested by

no test coverage detected