add
This commit is contained in:
15
ccxt/static_dependencies/starknet/common.py
Normal file
15
ccxt/static_dependencies/starknet/common.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user