from typing import Final

ERROR_BUF_SIZE: Final = 256

STRUCTURE_VERSION_0: Final = 0x0000
STRUCTURE_VERSION_1: Final = 0x0001
STRUCTURE_VERSION_2: Final = 0x0002
STRUCTURE_VERSION_3: Final = 0x0003
STRUCTURE_VERSION_4: Final = 0x0004
STRUCTURE_VERSION_5: Final = 0x0005
STRUCTURE_VERSION_MASK: Final = 0x00FF
STRUCTURE_OPTIONS_MASK: Final = 0xFF00
STRUCTURE_LOCALIZATION: Final = 0x0100

WINDOWS_1251: Final = 'windows-1251'

# MTE API Error codes
MTE_OK: Final = 0
MTE_TSMR: Final = -8
MTE_UNKNOWN: Final = -16
MTE_PARAM: Final = -17
MTE_REJECTED: Final = -18
MTE_NOT_IMPLEMENTED = -34

# Well known tables
SECURITIES_TABLE: Final = "SECURITIES"
ASSETS_TABLE: Final = "ASSETS"

# Well known fields
BOARD_FIELD_NAMES: Final = {'BOARDID', 'SECBOARD', 'INDEXBOARD'}
MARKET_FIELD_NAMES: Final = {'MARKETID', 'MARKETCODE'}
SCALE_FIELD_NAME: Final = {'DECIMALS'}
