miniproto.mtproto.state.MTProtoState
miniproto.mtproto.state.MTProtoState
Section titled “miniproto.mtproto.state.MTProtoState”MTProtoState(auth_key: bytes, server_salt: int = 0, session_id: int = (lambda: secrets.randbits(64))(), time_offset: float = 0.0, duplicate_window: int = 8192, _last_msg_id: int = 0, _content_related_count: int = 0, _seen_msg_ids: OrderedDict[int, None] = OrderedDict(), _pending_acks: OrderedDict[int, float] = OrderedDict(), _time_trusted: bool = False) -> NoneTrack one authorization key’s MTProto session, timing, and acknowledgement state.
Attributes:
- auth_key (
bytes) – Required 256-byte MTProto authorization key. - server_salt (
int) – Current masked 64-bit server salt, defaulting to0. - session_id (
int) – Current random 64-bit session ID. - time_offset (
float) – Server-time offset applied while allocating message IDs. - duplicate_window (
int) – Maximum retained incoming IDs, defaulting to8192. - _last_msg_id (
int) – Last locally allocated message ID used to preserve monotonicity. - _content_related_count (
int) – Count used to allocate content-related sequence numbers. - _seen_msg_ids (
OrderedDict[int, None]) – Retained incoming IDs used for duplicate and replay checks. - _pending_acks (
OrderedDict[int, float]) – Incoming content-related IDs awaiting acknowledgement. - _time_trusted (
bool) – Whether an accepted incoming ID has established server time.