erc7730.convert.calldata.v1.tlv module

Encoding of calldata descriptor instructions to TLV format.

See https://github.com/LedgerHQ/generic_parser for specifications of these payloads.

class erc7730.convert.calldata.v1.tlv.CalldataDescriptorEnumValueTag(*values)[source]View on GitHub

Bases: IntEnum

CHAIN_ID = 1
CONTRACT_ADDR = 2
ID = 4
NAME = 6
SELECTOR = 3
VALUE = 5
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorFieldTag(*values)[source]View on GitHub

Bases: IntEnum

NAME = 1
PARAM = 3
PARAM_TYPE = 2
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamAmountTag(*values)[source]View on GitHub

Bases: IntEnum

VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamDateTimeTag(*values)[source]View on GitHub

Bases: IntEnum

TYPE = 2
VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamDurationTag(*values)[source]View on GitHub

Bases: IntEnum

VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamEnumTag(*values)[source]View on GitHub

Bases: IntEnum

ID = 1
VALUE = 2
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamNFTTag(*values)[source]View on GitHub

Bases: IntEnum

COLLECTION = 2
VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamRawTag(*values)[source]View on GitHub

Bases: IntEnum

VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamTokenAmountTag(*values)[source]View on GitHub

Bases: IntEnum

ABOVE_THRESHOLD_MSG = 5
NATIVE_CURRENCY = 3
THRESHOLD = 4
TOKEN = 2
VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamTrustedNameTag(*values)[source]View on GitHub

Bases: IntEnum

SOURCES = 3
TYPES = 2
VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorParamUnitTag(*values)[source]View on GitHub

Bases: IntEnum

BASE = 2
DECIMALS = 3
PREFIX = 4
VALUE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorPathArrayElementTag(*values)[source]View on GitHub

Bases: IntEnum

END = 3
START = 2
WEIGHT = 1
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorPathElementTag(*values)[source]View on GitHub

Bases: IntEnum

ARRAY = 2
LEAF = 4
REF = 3
SLICE = 5
TUPLE = 1
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorPathSliceElementTag(*values)[source]View on GitHub

Bases: IntEnum

END = 2
START = 1
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorTransactionInfoTag(*values)[source]View on GitHub

Bases: IntEnum

CHAIN_ID = 1
CONTRACT_ADDR = 2
CONTRACT_NAME = 9
CREATOR_NAME = 6
CREATOR_URL = 8
DEPLOY_DATE = 10
FIELDS_HASH = 4
OPERATION_TYPE = 5
SELECTOR = 3
SIGNATURE = 255
VERSION = 0
class erc7730.convert.calldata.v1.tlv.CalldataDescriptorValueTag(*values)[source]View on GitHub

Bases: IntEnum

CONSTANT = 5
CONTAINER_PATH = 4
DATA_PATH = 3
TYPE_FAMILY = 1
TYPE_SIZE = 2
VERSION = 0
erc7730.convert.calldata.v1.tlv.tlv_data_path_element(obj: Annotated[CalldataDescriptorPathElementTupleV1 | CalldataDescriptorPathElementArrayV1 | CalldataDescriptorPathElementRefV1 | CalldataDescriptorPathElementLeafV1 | CalldataDescriptorPathElementSliceV1, FieldInfo(annotation=NoneType, required=True, title='Path element', description='Data path element to reach the target value in the serialized transaction', discriminator='type')]) bytes[source]View on GitHub

Encode a struct of type PATH_ELEMENT.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_enum_value(obj: CalldataDescriptorInstructionEnumValueV1) bytes[source]View on GitHub

Encode a struct of type ENUM_VALUE.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_field(obj: CalldataDescriptorInstructionFieldV1) bytes[source]View on GitHub

Encode a struct of type FIELD.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_amount(obj: CalldataDescriptorParamAmountV1) bytes[source]View on GitHub

Encode a struct of type PARAM_AMOUNT.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_datetime(obj: CalldataDescriptorParamDatetimeV1) bytes[source]View on GitHub

Encode a struct of type PARAM_DATETIME.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_duration(obj: CalldataDescriptorParamDurationV1) bytes[source]View on GitHub

Encode a struct of type PARAM_DURATION.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_enum(obj: CalldataDescriptorParamEnumV1) bytes[source]View on GitHub

Encode a struct of type PARAM_ENUM.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_nft(obj: CalldataDescriptorParamNFTV1) bytes[source]View on GitHub

Encode a struct of type PARAM_NFT.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_raw(obj: CalldataDescriptorParamRawV1) bytes[source]View on GitHub

Encode a struct of type PARAM_RAW.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_token_amount(obj: CalldataDescriptorParamTokenAmountV1) bytes[source]View on GitHub

Encode a struct of type PARAM_TOKEN_AMOUNT.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_trusted_name(obj: CalldataDescriptorParamTrustedNameV1) bytes[source]View on GitHub

Encode a struct of type PARAM_TRUSTED_NAME.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_param_unit(obj: CalldataDescriptorParamUnitV1) bytes[source]View on GitHub

Encode a struct of type PARAM_UNIT.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_transaction_info(obj: CalldataDescriptorInstructionTransactionInfoV1) bytes[source]View on GitHub

Encode a struct of type TRANSACTION_INFO.

@param obj: object representation of struct @return: encoded struct TLV

erc7730.convert.calldata.v1.tlv.tlv_value(obj: Annotated[CalldataDescriptorValuePathV1 | CalldataDescriptorValueConstantV1, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)]) bytes[source]View on GitHub

Encode a struct of type VALUE.

@param obj: object representation of struct @return: encoded struct TLV