Michelson types

Base class

class pytezos.michelson.types.base.MichelsonType[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable') MichelsonType[source]
args: List[Type[MichelsonType] | Any] = []
classmethod as_micheline_expr() dict[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod create_type(args: List[Type[Micheline]], annots: list | None = None, **kwargs) Type[MichelsonType][source]
classmethod dummy(context: AbstractContext) MichelsonType[source]
duplicate()[source]
field_name: str | None = None
find(predicate: Callable[[MichelsonType], bool]) MichelsonType | None[source]
forge(mode='readable') bytes[source]
classmethod from_literal(literal: Type[Micheline]) MichelsonType[source]
classmethod from_micheline_value(val_expr) MichelsonType[source]
classmethod from_python_object(py_obj) MichelsonType[source]
classmethod generate_pydoc(definitions: List[Tuple[str, str]], inferred_name=None, comparable=False) str[source]
classmethod get_anon_type() Type[MichelsonType][source]
classmethod is_big_map_friendly()[source]
classmethod is_comparable()[source]
classmethod is_duplicable()[source]
classmethod is_packable()[source]
classmethod is_passable()[source]
classmethod is_pushable()[source]
classmethod is_storable()[source]
static match(expr) Type[MichelsonType][source]
merge_lazy_diff(lazy_diff: List[dict]) MichelsonType[source]
pack(legacy=False) bytes[source]
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff: bool | None = False)[source]
to_python_object(try_unpack=False, lazy_diff: bool | None = False, comparable=False)[source]
type_name: str | None = None
classmethod unpack(data: bytes) MichelsonType[source]
pytezos.michelson.types.base.generate_pydoc(ty: Type[MichelsonType], title=None)[source]
pytezos.michelson.types.base.parse_name(annots: List[str] | None, prefix: str) str | None[source]
class pytezos.michelson.types.base.undefined[source]

Core types

class pytezos.michelson.types.core.BoolType(value: bool)[source]
classmethod dummy(context: AbstractContext) BoolType[source]
classmethod from_micheline_value(val_expr) BoolType[source]
classmethod from_python_object(py_obj) BoolType[source]
classmethod from_value(value: bool)[source]
prim: str | None = 'bool'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.core.BytesType(value: bytes = b'')[source]
classmethod dummy(context: AbstractContext) BytesType[source]
classmethod from_micheline_value(val_expr) BytesType[source]
classmethod from_python_object(py_obj) BytesType[source]
classmethod from_value(value: bytes)[source]
prim: str | None = 'bytes'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.core.FalseLiteral[source]
prim: str | None = 'False'
class pytezos.michelson.types.core.IntType(value: int = 0)[source]
classmethod dummy(context: AbstractContext) IntType[source]
classmethod from_micheline_value(val_expr) IntType[source]
classmethod from_python_object(py_obj) IntType[source]
classmethod from_value(value: int) IntType[source]
prim: str | None = 'int'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.core.NatType(value: int = 0)[source]
classmethod from_micheline_value(val_expr) NatType[source]
classmethod from_python_object(py_obj) NatType[source]
classmethod from_value(value: int) NatType[source]
prim: str | None = 'nat'
class pytezos.michelson.types.core.NeverType[source]
prim: str | None = 'never'
class pytezos.michelson.types.core.StringType(value: str = '')[source]
classmethod dummy(context: AbstractContext) StringType[source]
classmethod from_micheline_value(val_expr) StringType[source]
classmethod from_python_object(py_obj) StringType[source]
classmethod from_value(value: str) StringType[source]
prim: str | None = 'string'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.core.TrueLiteral[source]
prim: str | None = 'True'
class pytezos.michelson.types.core.UnitLiteral[source]
prim: str | None = 'Unit'
class pytezos.michelson.types.core.UnitType[source]
classmethod dummy(context: AbstractContext) UnitType[source]
classmethod from_micheline_value(val_expr) UnitType[source]
classmethod from_python_object(py_obj) UnitType[source]
prim: str | None = 'unit'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.core.unit[source]

Domain types

class pytezos.michelson.types.domain.AddressType(value: str = '')[source]
classmethod dummy(context: AbstractContext) AddressType[source]
classmethod from_micheline_value(val_expr) AddressType[source]
classmethod from_python_object(py_obj) AddressType[source]
classmethod from_value(value: str) AddressType[source]
prim: str | None = 'address'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.ChainIdType(value: str = '')[source]
classmethod dummy(context: AbstractContext) ChainIdType[source]
classmethod from_micheline_value(val_expr) ChainIdType[source]
classmethod from_python_object(py_obj) ChainIdType[source]
classmethod from_value(value: str) ChainIdType[source]
prim: str | None = 'chain_id'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.ContractType(value: str = '')[source]
classmethod from_python_object(py_obj) ContractType[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
get_address() str[source]
get_entrypoint() str[source]
prim: str | None = 'contract'
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.KeyHashType(value: str = '')[source]
classmethod dummy(context: AbstractContext) KeyHashType[source]
classmethod from_micheline_value(val_expr) KeyHashType[source]
classmethod from_value(value: str) KeyHashType[source]
classmethod parse_python_object(py_obj)[source]
prim: str | None = 'key_hash'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.KeyType(value: str = '')[source]
classmethod dummy(context: AbstractContext) KeyType[source]
classmethod from_micheline_value(val_expr) KeyType[source]
classmethod from_value(value: str) KeyType[source]
classmethod parse_python_object(py_obj) KeyType[source]
property prefix: str
prim: str | None = 'key'
property raw: bytes
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.LambdaType(value: Type[Micheline])[source]
classmethod dummy(context: AbstractContext) LambdaType[source]
classmethod from_micheline_value(val_expr) LambdaType[source]
classmethod from_python_object(py_obj) LambdaType[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
prim: str | None = 'lambda'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.MutezType(value: int = 0)[source]
classmethod from_python_object(py_obj) MutezType[source]
classmethod from_value(value: int) MutezType[source]
prim: str | None = 'mutez'
class pytezos.michelson.types.domain.SignatureType(value: str = '')[source]
classmethod dummy(context: AbstractContext) SignatureType[source]
classmethod from_micheline_value(val_expr) SignatureType[source]
classmethod from_python_object(py_obj) SignatureType[source]
classmethod from_value(value: str) SignatureType[source]
prim: str | None = 'signature'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.TXRAddress(value: str = '')[source]
classmethod dummy(context: AbstractContext) TXRAddress[source]
classmethod from_micheline_value(val_expr) TXRAddress[source]
classmethod from_python_object(py_obj) TXRAddress[source]
classmethod from_value(value: str) TXRAddress[source]
prim: str | None = 'tx_rollup_l2_address'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.domain.TimestampType(value: int = 0)[source]
classmethod from_micheline_value(val_expr) TimestampType[source]
classmethod from_python_object(py_obj) TimestampType[source]
classmethod from_value(value: int) TimestampType[source]
prim: str | None = 'timestamp'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]

Big map type

class pytezos.michelson.types.big_map.BigMapType(items: List[Tuple[MichelsonType, MichelsonType]], ptr: int | None = None, removed_keys: List[MichelsonType] | None = None)[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable') BigMapType[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod dummy(context: AbstractContext) BigMapType[source]
duplicate()[source]
static empty(key_type: Type[MichelsonType], val_type: Type[MichelsonType]) BigMapType[source]
find(predicate: Callable[[MichelsonType], bool]) MichelsonType | None[source]
static from_items(items: List[Tuple[MichelsonType, MichelsonType]])[source]
classmethod from_micheline_value(val_expr) BigMapType[source]
classmethod from_python_object(py_obj: int | dict) BigMapType[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
get(key: MichelsonType, dup=True) MichelsonType | None[source]
get_key_hash(key_obj)[source]
merge_lazy_diff(lazy_diff: List[dict]) BigMapType[source]
prim: str | None = 'big_map'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff: bool | None = False)[source]
to_python_object(try_unpack=False, lazy_diff: bool | None = False, comparable=False)[source]
update(key: MichelsonType, val: MichelsonType | None) Tuple[MichelsonType | None, MichelsonType][source]

BLS types

class pytezos.michelson.types.bls.BLS12_381_FrType(value: int)[source]
static bytes_to_int(value: bytes) int[source]
classmethod from_micheline_value(val_expr) IntType[source]
classmethod from_python_object(py_obj) BLS12_381_FrType[source]
classmethod from_value(value: int) BLS12_381_FrType[source]
modulus = 52435875175126190479447740508185965837690552500527637822603658699938581184513
prim: str | None = 'bls12_381_fr'
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.bls.BLS12_381_G1Type(value: bytes = b'')[source]
classmethod from_point(point: Tuple[optimized_bls12_381_FQ, optimized_bls12_381_FQ, optimized_bls12_381_FQ]) BLS12_381_G1Type[source]
classmethod from_value(value: bytes)[source]
prim: str | None = 'bls12_381_g1'
to_point() Tuple[optimized_bls12_381_FQ, optimized_bls12_381_FQ, optimized_bls12_381_FQ][source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.bls.BLS12_381_G2Type(value: bytes = b'')[source]
classmethod from_point(point: Tuple[optimized_bls12_381_FQ2, optimized_bls12_381_FQ2, optimized_bls12_381_FQ2]) BLS12_381_G2Type[source]
classmethod from_value(value: bytes)[source]
prim: str | None = 'bls12_381_g2'
to_point() Tuple[optimized_bls12_381_FQ2, optimized_bls12_381_FQ2, optimized_bls12_381_FQ2][source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]

List type

class pytezos.michelson.types.list.ListType(items: List[MichelsonType])[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable')[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod dummy(context: AbstractContext) ListType[source]
static empty(item_type: Type[MichelsonType])[source]
static from_items(items: List[MichelsonType])[source]
classmethod from_micheline_value(val_expr: list) ListType[source]
classmethod from_python_object(py_obj) ListType[source]
classmethod generate_pydoc(definitions: List[Tuple[str, str]], inferred_name=None, comparable=False)[source]
merge_lazy_diff(lazy_diff: List[dict]) MichelsonType[source]
prepend(item: MichelsonType) ListType[source]
prim: str | None = 'list'
split_head() Tuple[MichelsonType, ListType][source]
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]

Map type

class pytezos.michelson.types.map.EltLiteral[source]
prim: str | None = 'Elt'
class pytezos.michelson.types.map.MapType(items: List[Tuple[MichelsonType, MichelsonType]])[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable')[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod check_constraints(items: List[Tuple[MichelsonType, MichelsonType]])[source]
contains(key: MichelsonType)[source]
classmethod dummy(context: AbstractContext) MapType[source]
static empty(key_type: Type[MichelsonType], val_type: Type[MichelsonType]) MapType[source]
find(predicate: Callable[[MichelsonType], bool]) MichelsonType | None[source]
static from_items(items: List[Tuple[MichelsonType, MichelsonType]]) MapType[source]
classmethod from_micheline_value(val_expr) MapType[source]
classmethod from_python_object(py_obj) MapType[source]
classmethod generate_pydoc(definitions: List[Tuple[str, str]], inferred_name=None, comparable=False)[source]
get(key: MichelsonType, dup=True) MichelsonType | None[source]
merge_lazy_diff(lazy_diff: List[dict]) MapType[source]
classmethod parse_micheline_value(val_expr) List[Tuple[MichelsonType, MichelsonType]][source]
classmethod parse_python_object(py_obj) List[Tuple[MichelsonType, MichelsonType]][source]
prim: str | None = 'map'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False) dict[source]
update(key: MichelsonType, val: MichelsonType | None) Tuple[MichelsonType | None, MichelsonType][source]

Operation type

class pytezos.michelson.types.operation.OperationType(content: dict, ty: Type[MichelsonType] | None = None)[source]
classmethod delegation(source: str, delegate: str | None = None) OperationType[source]
classmethod event(source: str, event_type: Type[MichelsonType], payload: Any, tag: str) OperationType[source]
classmethod origination(source: str, script: Type[MichelineSequence], storage: MichelsonType, balance: int = 0, delegate: str | None = None) OperationType[source]
prim: str | None = 'operation'
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
classmethod transaction(source: str, destination: str, amount: int, entrypoint: str, value: Any, param_type: Type[MichelsonType]) OperationType[source]

Option type

class pytezos.michelson.types.option.NoneLiteral[source]
prim: str | None = 'None'
class pytezos.michelson.types.option.OptionType(item: MichelsonType | None)[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable') MichelsonType[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod dummy(context: AbstractContext) OptionType[source]
find(predicate: Callable[[MichelsonType], bool]) MichelsonType | None[source]
classmethod from_micheline_value(val_expr)[source]
classmethod from_python_object(py_obj)[source]
static from_some(item: MichelsonType) OptionType[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
get_some() MichelsonType[source]
is_none() bool[source]
merge_lazy_diff(lazy_diff: List[dict]) MichelsonType[source]
static none(some_type: Type[MichelsonType]) OptionType[source]
prim: str | None = 'option'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.option.SomeLiteral[source]
prim: str | None = 'Some'

Pair type

class pytezos.michelson.types.pair.PairLiteral[source]
prim: str | None = 'Pair'
class pytezos.michelson.types.pair.PairType(items: Tuple[MichelsonType, ...])[source]
access_comb(idx: int) MichelsonType[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable')[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod create_type(args: List[Type[Micheline]], annots: list | None = None, **kwargs) Type[PairType][source]
classmethod dummy(context: AbstractContext) PairType[source]
static from_comb(items: List[MichelsonType]) PairType[source]
classmethod from_micheline_value(val_expr) PairType[source]
classmethod from_python_object(py_obj) PairType[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
classmethod init(items: List[MichelsonType]) PairType[source]
iter_comb(include_nodes=False) Generator[MichelsonType, None, None][source]
classmethod iter_type_args(entrypoints=False, path='') Generator[Tuple[str, Type[MichelsonType]], None, None][source]
iter_values(path='') Generator[Tuple[str, MichelsonType], None, None][source]
merge_lazy_diff(lazy_diff: List[dict]) PairType[source]
prim: str | None = 'pair'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False) dict | tuple[source]
unpairn_comb(count) Generator[MichelsonType, None, None][source]
update_comb(idx: int, element: MichelsonType) PairType[source]

Sapling type

class pytezos.michelson.types.sapling.SaplingStateType(ptr: int | None = None)[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable') MichelsonType[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
static empty(memo_size: int)[source]
classmethod from_micheline_value(val_expr) SaplingStateType[source]
merge_lazy_diff(lazy_diff: List[dict]) MichelsonType[source]
prim: str | None = 'sapling_state'
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]
class pytezos.michelson.types.sapling.SaplingTransactionDeprecatedType[source]
prim: str | None = 'sapling_transaction_deprecated'
class pytezos.michelson.types.sapling.SaplingTransactionType[source]
prim: str | None = 'sapling_transaction'

Set type

class pytezos.michelson.types.set.SetType(items: List[MichelsonType])[source]
add(item: MichelsonType) SetType[source]
classmethod check_constraints(items: List[MichelsonType])[source]
contains(item: MichelsonType) bool[source]
classmethod dummy(context: AbstractContext)[source]
static empty(item_type: Type[MichelsonType]) SetType[source]
static from_items(items: List[MichelsonType]) SetType[source]
classmethod from_micheline_value(val_expr) SetType[source]
classmethod from_python_object(py_obj) SetType[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
prim: str | None = 'set'
remove(item: MichelsonType) SetType[source]
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]

Or type

class pytezos.michelson.types.sum.LeftLiteral[source]
prim: str | None = 'Left'
class pytezos.michelson.types.sum.OrType(items: Tuple[undefined | MichelsonType, ...])[source]
aggregate_lazy_diff(lazy_diff: List[dict], mode='readable')[source]
attach_context(context: AbstractContext, big_map_copy=False)[source]
classmethod create_type(args: List[Type[Micheline]], annots: list | None = None, **kwargs) Type[OrType][source]
classmethod dummy(context: AbstractContext)[source]
static from_left(left: MichelsonType, right_type: Type[MichelsonType])[source]
classmethod from_micheline_value(val_expr) OrType[source]
classmethod from_python_object(py_obj) OrType[source]
static from_right(right: MichelsonType, left_type: Type[MichelsonType])[source]
classmethod generate_pydoc(definitions: list, inferred_name=None, comparable=False)[source]
is_enum: bool
is_left() bool[source]
is_right() bool[source]
classmethod iter_type_args(entrypoints=False, path='') Generator[Tuple[str, Type[MichelsonType]], None, None][source]
iter_values(path='') Generator[Tuple[str, MichelsonType], None, None][source]
merge_lazy_diff(lazy_diff: List[dict]) OrType[source]
prim: str | None = 'or'
resolve() MichelsonType[source]
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False) tuple | dict[source]
class pytezos.michelson.types.sum.RightLiteral[source]
prim: str | None = 'Right'

Ticket type

class pytezos.michelson.types.ticket.TicketType(ticketer: str, item: MichelsonType, amount: int)[source]
static create(ticketer: str, item: MichelsonType, amount: int) TicketType[source]
classmethod dummy(context: AbstractContext)[source]
classmethod from_comb(comb: PairType) TicketType[source]
classmethod from_micheline_value(val_expr) TicketType[source]
classmethod from_python_object(py_obj) MichelsonType[source]
classmethod generate_pydoc(definitions: List[Tuple[str, str]], inferred_name=None, comparable=False) str[source]
static join(left: TicketType, right: TicketType) TicketType | None[source]
merge_lazy_diff(lazy_diff: List[dict]) MichelsonType[source]
prim: str | None = 'ticket'
split(amount_left: int, amount_right: int) Tuple[TicketType, TicketType] | None[source]
to_comb() PairType[source]
to_literal() Type[Micheline][source]
to_micheline_value(mode='readable', lazy_diff=False)[source]
to_python_object(try_unpack=False, lazy_diff=False, comparable=False)[source]