diff --git a/docs/api/data_types.rst b/docs/api/data_types.rst index fe198cd1b..9ae57300f 100644 --- a/docs/api/data_types.rst +++ b/docs/api/data_types.rst @@ -11,6 +11,9 @@ Module containing representations of Cairo types. Mostly used to generate proper .. autoclass:: FeltType :exclude-members: __init__, __new__ +.. autoclass:: BoolType + :exclude-members: __init__, __new__ + .. autoclass:: TupleType :exclude-members: __init__, __new__ :members: types @@ -25,4 +28,27 @@ Module containing representations of Cairo types. Mostly used to generate proper .. autoclass:: StructType :exclude-members: __init__, __new__ - :members: types + :members: name, types + +.. autoclass:: EnumType + :exclude-members: __init__, __new__ + :members: name, variants + +.. autoclass:: OptionType + :exclude-members: __init__, __new__ + :members: type + +.. autoclass:: UintType + :exclude-members: __init__, __new__ + :members: bits + +.. autoclass:: UnitType + :exclude-members: __init__, __new__ + +.. autoclass:: EventType + :exclude-members: __init__, __new__ + :members: name, types, keys + +.. autoclass:: NonZeroType + :exclude-members: __init__, __new__ + :members: type \ No newline at end of file diff --git a/starknet_py/cairo/data_types.py b/starknet_py/cairo/data_types.py index 4d6ab72e5..d13555a35 100644 --- a/starknet_py/cairo/data_types.py +++ b/starknet_py/cairo/data_types.py @@ -32,7 +32,7 @@ class TupleType(CairoType): Type representation of Cairo tuples without named fields. """ - types: List[CairoType] #: types of every tuple element. + types: List[CairoType] #: Types of every tuple element. @dataclass @@ -41,7 +41,7 @@ class NamedTupleType(CairoType): Type representation of Cairo tuples with named fields. """ - types: OrderedDict[str, CairoType] #: types of every tuple member. + types: OrderedDict[str, CairoType] #: Types of every tuple member. @dataclass @@ -50,7 +50,7 @@ class ArrayType(CairoType): Type representation of Cairo arrays. """ - inner_type: CairoType #: type of element inside array. + inner_type: CairoType #: Type of element inside array. @dataclass @@ -70,8 +70,8 @@ class EnumType(CairoType): Type representation of Cairo enums. """ - name: str - variants: OrderedDict[str, CairoType] + name: str #: Enum name. + variants: OrderedDict[str, CairoType] #: Enum variants. @dataclass @@ -80,7 +80,7 @@ class OptionType(CairoType): Type representation of Cairo options. """ - type: CairoType + type: CairoType #: Typed of element wrapped in the Option. @dataclass @@ -89,7 +89,7 @@ class UintType(CairoType): Type representation of Cairo unsigned integers. """ - bits: int + bits: int #: Number of bits in the integer. def check_range(self, value: int): """ @@ -103,7 +103,7 @@ class TypeIdentifier(CairoType): Type representation of Cairo identifiers. """ - name: str + name: str #: Identifier name. @dataclass @@ -119,9 +119,9 @@ class EventType(CairoType): Type representation of Cairo Event. """ - name: str - types: OrderedDict[str, CairoType] - keys: List[str] + name: str #: Event name. + types: OrderedDict[str, CairoType] #: Types of every event member. + keys: List[str] #: Keys of every event member. @dataclass @@ -130,4 +130,4 @@ class NonZeroType(CairoType): Type representation of Cairo NonZero. """ - type: CairoType + type: CairoType #: Type of element wrapped in NonZero.