Files
ccxt_with_mt5/ccxt/static_dependencies/starknet/common.py
lz_db 0fab423a18 add
2025-11-16 12:31:03 +08:00

16 lines
457 B
Python

from typing import Literal, Union
def int_from_hex(number: Union[str, int]) -> int:
return number if isinstance(number, int) else int(number, 16)
def int_from_bytes(
value: bytes,
byte_order: Literal["big", "little"] = "big",
signed: bool = False,
) -> int:
"""
Converts the given bytes object (parsed according to the given byte order) to an integer.
"""
return int.from_bytes(value, byteorder=byte_order, signed=signed)