pragma_sdk.common#

Utils#

pragma_sdk.common.utils.add_sync_methods(original_class: T) T[source]#

Decorator for adding a synchronous version of a class. :param original_class: Input class :return: Input class with .sync property that contains synchronous version of this class

pragma_sdk.common.utils.currency_pair_to_pair_id(base: str, quote: str) str[source]#

Return a pair id from base and quote currencies. e.g currency_pair_to_pair_id(“btc”, “usd”) -> “BTC/USD”

Parameters:
  • base – Base currency

  • quote – Quote currency

Returns:

Pair id

pragma_sdk.common.utils.felt_to_str(felt: int) str[source]#

Convert a felt to a string.

pragma_sdk.common.utils.get_cur_from_pair(asset: str) List[str][source]#

Get the currency from a pair. e.g get_cur_from_pair(“BTC/USD”) -> [“BTC”, “USD”]

Parameters:

asset – Asset pair

Returns:

List of currencies

pragma_sdk.common.utils.make_sync(fn: F) Callable[[...], Any][source]#
pragma_sdk.common.utils.str_to_felt(text: str) int[source]#

Convert a string to a felt. WARNING : text is converting to uppercase