configs#

AssetConfig#

class pragma_sdk.common.configs.asset_config.AssetConfig[source]#

Bases: BaseModel

abstract: bool | None#
coingecko_id: str | None#
decimals: int#
ethereum_address: str | None#
classmethod from_ticker(ticker: str) AssetConfig[source]#

Return a AssetConfig from a ticker. Raise UnsupportedAssetError if the ticker is not supported.

Parameters:

ticker – Ticker

Returns:

AssetConfig

classmethod from_yaml(path: Path) List[Self][source]#
static get_coingecko_id_from_ticker(ticker: str) str[source]#

Return the coingecko id from a ticker. Raise UnsupportedAssetError if the ticker is not supported.

Parameters:

ticker – Ticker

Returns:

Coingecko id

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'abstract': FieldInfo(annotation=Union[bool, NoneType], required=False, default=False), 'coingecko_id': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'decimals': FieldInfo(annotation=int, required=True), 'ethereum_address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'name': FieldInfo(annotation=str, required=True), 'starknet_address': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'ticker': FieldInfo(annotation=str, required=True)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str#
starknet_address: str | None#
ticker: str#