feat(ethereum): display format definitions
What changed, and why it matters
This commit adds support for a new Ethereum feature called ERC-7730, which lets a computer (like a wallet app) tell a Trezor device how to display and interpret smart-contract transaction data in a human-friendly way. It also changes the message format so apps can send multiple token definitions instead of just one. The change is large and touches many generated files, but it appears to be a feature addition rather than a fix for an existing security bug. Because it introduces new code that parses untrusted data from a host computer and uses it to format what the user sees on screen, it could create security risks if the parsing or formatting logic has flaws, but the diff itself does not show an obvious vulnerability.
Treat this as a feature commit that needs security review of the new parser/formatter code, especially edge cases in ABIValue.from_proto, FieldDefinition.from_proto, and DisplayFormat.from_encoded. Fuzz the host-supplied display-format definition against malformed, oversized, and context-mismatched inputs. Verify that the context and function-signature checks cannot be bypassed, and that parsing failures always abort display rather than falling back to unsafe defaults. No immediate patch or incident response is indicated by the diff alone.
Security signals we found
New attack surface: host-supplied protobuf definitions are decoded and used to parse transaction calldata and drive on-screen display
Parsing logic added for ABI tuples, arrays, atomic and dynamic types; malformed definitions could trigger exceptions or unexpected behavior
Context check (chain_id/address/func_sig) is performed before applying an external display format, which limits cross-contract replay
Legacy firmware ignores the new ERC-7730 field entirely (type:FT_IGNORE), so the feature is not active there
Token field changed from singular to repeated; legacy code only consumes encoded_tokens[0]
No explicit security claims, CVE references, or researcher attribution in the commit or supplied references
Evidence from the diff
The commit implements ERC-7730 display-format definitions for Ethereum signing. It extends the protobuf definitions with EthereumERC7730DisplayFormatInfo, EthereumABIValueInfo, EthereumABITupleInfo, EthereumERC7730Path, EthereumERC7730FieldInfo, and related enums. The core firmware learns to decode an externally supplied display-format blob and, when a built-in format is not found, use it to parse calldata and render labeled fields. The EthereumDefinitions message changes encoded_token (singular) to encoded_tokens (repeated), and legacy firmware is updated to read only the first token. The new parsing code in clear_signing.py maps wire-type enums to existing parsers, constructs ABIValue/FieldDefinition objects from protobuf, and validates the function signature and binding context before use.
Changed components
core/src/apps/ethereum/clear_signing.pycore/src/apps/ethereum/definitions.pycore/src/apps/ethereum/keychain.pycore/src/apps/common/definitions.pycommon/protob/messages-definitions.protocommon/protob/messages-ethereum.protolegacy/firmware/fsm_msg_ethereum.hlegacy/firmware/ethereum_definitions.hpython/src/trezorlib/cli/ethereum.pypython/src/trezorlib/messages.pycore/src/trezor/messages.pycore/src/trezor/enums/*rust/trezor-client/src/protos/generated/*Inspect captured patch +2490 / −90
diff --git a/common/protob/messages-definitions.proto b/common/protob/messages-definitions.proto
index ec181148..55c8f620 100644
--- a/common/protob/messages-definitions.proto
+++ b/common/protob/messages-definitions.proto
@@ -13,6 +13,7 @@ enum DefinitionType {
ETHEREUM_NETWORK = 0;
ETHEREUM_TOKEN = 1;
SOLANA_TOKEN = 2;
+ ETHEREUM_ERC7730_DISPLAY_FORMAT = 3;
}
// ****** CROSS-PARSEABILITY NOTE ******
@@ -23,9 +24,12 @@ enum DefinitionType {
//
// To achieve that, we vary the wire types of the fields in order:
//
-// * EthereumNetworkInfo: varint, length-delimited, ...
+// * EthereumNetworkInfo: varint, length-delimited, varint, ...
// * EthereumTokenInfo: length-delimited, varint, ...
// * SolanaTokenInfo: length-delimited, length-delimited, ...
+// * EthereumERC7730DisplayFormat: varint, length-delimited, length-delimited, ...
+
+// ****** ETHEREUM_NETWORK ******
/**
* Ethereum network definition.
@@ -38,6 +42,8 @@ message EthereumNetworkInfo {
required string name = 4;
}
+// ****** ETHEREUM_TOKEN ******
+
/**
* Ethereum token definition.
* @embed
@@ -50,6 +56,8 @@ message EthereumTokenInfo {
required string name = 5;
}
+// ****** SOLANA_TOKEN ******
+
/**
* Solana token definition.
* @embed
@@ -59,3 +67,121 @@ message SolanaTokenInfo {
required string symbol = 2;
required string name = 3;
}
+
+// ****** ETHEREUM_ERC7730_DISPLAY_FORMAT ******
+
+/**
+ * Solidity types.
+ * @embed
+ */
+enum EthereumABIType {
+ ABI_ADDRESS = 0;
+ ABI_UINT256 = 1;
+ ABI_UINT248 = 2;
+ ABI_UINT160 = 3;
+ ABI_UINT128 = 4;
+ ABI_UINT120 = 5;
+ ABI_UINT112 = 6;
+ ABI_UINT96 = 7;
+ ABI_UINT72 = 8;
+ ABI_UINT64 = 9;
+ ABI_UINT48 = 10;
+ ABI_UINT40 = 11;
+ ABI_UINT32 = 12;
+ ABI_UINT24 = 13;
+ ABI_UINT16 = 14;
+ ABI_UINT8 = 15;
+ ABI_BOOL = 16;
+ ABI_BYTES = 20;
+ ABI_STRING = 21;
+}
+
+/**
+ * Solidity struct / tuple.
+ * @embed
+ */
+message EthereumABITupleInfo {
+ repeated EthereumABIValueInfo fields = 1;
+ required bool is_dynamic = 2;
+}
+
+/**
+ * Ethereum ERC-20 function parameter.
+ * @embed
+ */
+message EthereumABIValueInfo {
+ // Exactly one of the following should be set:
+ optional EthereumABIType atomic = 1; // Atomic(parser)
+ optional EthereumABIType dynamic = 2; // Dynamic(parser)
+ optional EthereumABITupleInfo tuple = 3; // Tuple(fields, is_dynamic)
+ optional EthereumABIValueInfo array = 4; // Array(element_type)
+}
+
+/**
+ * All available ERC-7730 field formatters.
+ * @embed
+ */
+enum EthereumERC7730FieldFormatterType {
+ FORMATTER_ADDRESS_NAME = 0;
+ FORMATTER_AMOUNT = 1;
+ FORMATTER_TOKEN_AMOUNT = 2;
+ FORMATTER_UNIT = 3;
+}
+
+/**
+ * ERC-7730 container path (paths starting with @).
+ * Note: keep this in sync with `ContainerPath` from `clear_signing.py`
+ * @embed
+ */
+enum EthereumERC7730ContainerPath {
+ FROM = 1;
+ VALUE = 2;
+ TO = 3;
+ CHAIN_ID = 4;
+}
+
+/**
+ * Path used in ERC-7730 field definitions to access values.
+ * We currently support two kinds of paths:
+ * * paths that access function parameters
+ * * container paths (starting with `@`)
+ * `$` and `#` paths are not supported.
+ * @embed
+ */
+message EthereumERC7730Path {
+ // Exactly one of the following should be set:
+ repeated uint32 path = 1; // eg. (0,) is encoded as [0], (1, 2) is encoded as [1, 2], etc.
+ optional EthereumERC7730ContainerPath container_path = 2;
+}
+
+/**
+ * Definition of a single field according to ERC-7730.
+ * @embed
+ */
+message EthereumERC7730FieldInfo {
+ required EthereumERC7730Path path = 1;
+ required string label = 2;
+ required EthereumERC7730FieldFormatterType formatter = 3;
+
+ // TokenAmountFormatter params
+ optional EthereumERC7730Path token_path = 4;
+ optional bytes threshold = 5;
+
+ // UnitFormatter params
+ optional uint32 decimals = 6;
+ optional string base = 7;
+ optional bool prefix = 8;
+}
+
+/**
+ * Ethereum ERC-7730 display format - corresponding to `DisplayFormat` in `clear_signing.py`.
+ * @embed
+ */
+message EthereumERC7730DisplayFormatInfo {
+ required uint64 chain_id = 1;
+ required bytes address = 2;
+ required bytes func_sig = 3;
+ required string intent = 4;
+ repeated EthereumABIValueInfo parameter_definitions = 5;
+ repeated EthereumERC7730FieldInfo field_definitions = 6;
+}
diff --git a/common/protob/messages-ethereum.proto b/common/protob/messages-ethereum.proto
index 664a62f9..31c06c9e 100644
--- a/common/protob/messages-ethereum.proto
+++ b/common/protob/messages-ethereum.proto
@@ -112,7 +112,10 @@ message EthereumSignTxEIP1559 {
* @next EthereumTxAck
*/
message EthereumTxRequest {
+ // Request more information
optional uint32 data_length = 1; // Number of bytes being requested (<= 1024)
+
+ // Done. Return signature.
optional uint32 signature_v = 2; // Computed signature (recovery parameter, limited to 27 or 28)
optional bytes signature_r = 3; // Computed signature R component (256 bit)
optional bytes signature_s = 4; // Computed signature S component (256 bit)
@@ -123,7 +126,7 @@ message EthereumTxRequest {
* @next EthereumTxRequest
*/
message EthereumTxAck {
- required bytes data_chunk = 1; // Bytes from transaction payload (<= 1024 bytes)
+ required bytes data_chunk = 1; // requested number of bytes from transaction payload (<= 1024)
}
/**
@@ -184,10 +187,11 @@ message EthereumTypedDataSignature {
}
/**
- * Contains an encoded network and/or token definition. See external-definitions.md for details.
+ * Contains encoded network, tokens and ERC-7730 display format definitions. See external-definitions.md for details.
* @embed
*/
message EthereumDefinitions {
- optional bytes encoded_network = 1; // encoded ethereum network
- optional bytes encoded_token = 2; // encoded ethereum token
+ optional bytes encoded_network = 1; // encoded ethereum network
+ repeated bytes encoded_tokens = 2; // encoded ethereum tokens
+ optional bytes encoded_erc7730_display_format = 3; // encoded ERC-7730 display format
}
diff --git a/core/embed/upymod/qstrdefsport.h b/core/embed/upymod/qstrdefsport.h
index 978368ea..5d6f1c9f 100644
--- a/core/embed/upymod/qstrdefsport.h
+++ b/core/embed/upymod/qstrdefsport.h
@@ -488,7 +488,10 @@ Q(CardanoTxAuxiliaryDataSupplementType)
Q(CardanoTxOutputSerializationFormat)
Q(CardanoTxSigningMode)
Q(CardanoTxWitnessType)
+Q(EthereumABIType)
Q(EthereumDataType)
+Q(EthereumERC7730ContainerPath)
+Q(EthereumERC7730FieldFormatterType)
Q(MoneroNetworkType)
Q(NEMImportanceTransferMode)
Q(NEMModificationType)
@@ -801,7 +804,10 @@ Q(trezor.enums.CardanoTxAuxiliaryDataSupplementType)
Q(trezor.enums.CardanoTxOutputSerializationFormat)
Q(trezor.enums.CardanoTxSigningMode)
Q(trezor.enums.CardanoTxWitnessType)
+Q(trezor.enums.EthereumABIType)
Q(trezor.enums.EthereumDataType)
+Q(trezor.enums.EthereumERC7730ContainerPath)
+Q(trezor.enums.EthereumERC7730FieldFormatterType)
Q(trezor.enums.MoneroNetworkType)
Q(trezor.enums.NEMImportanceTransferMode)
Q(trezor.enums.NEMModificationType)
diff --git a/core/src/apps/common/definitions.py b/core/src/apps/common/definitions.py
index 2c8b777a..0876742c 100644
--- a/core/src/apps/common/definitions.py
+++ b/core/src/apps/common/definitions.py
@@ -1,6 +1,11 @@
from typing import TYPE_CHECKING
-from trezor.messages import EthereumNetworkInfo, EthereumTokenInfo, SolanaTokenInfo
+from trezor.messages import (
+ EthereumERC7730DisplayFormatInfo,
+ EthereumNetworkInfo,
+ EthereumTokenInfo,
+ SolanaTokenInfo,
+)
from trezor.wire import DataError
if TYPE_CHECKING:
@@ -9,7 +14,11 @@ if TYPE_CHECKING:
# NOTE: it's important all DefType variants can't be cross-parsed
DefType = TypeVar(
- "DefType", EthereumNetworkInfo, EthereumTokenInfo, SolanaTokenInfo
+ "DefType",
+ EthereumNetworkInfo,
+ EthereumTokenInfo,
+ SolanaTokenInfo,
+ EthereumERC7730DisplayFormatInfo,
)
@@ -33,6 +42,8 @@ def decode_definition(definition: AnyBytes, expected_type: type[DefType]) -> Def
expected_type_number = DefinitionType.ETHEREUM_TOKEN
if expected_type.MESSAGE_NAME == SolanaTokenInfo.MESSAGE_NAME:
expected_type_number = DefinitionType.SOLANA_TOKEN
+ if expected_type.MESSAGE_NAME == EthereumERC7730DisplayFormatInfo.MESSAGE_NAME:
+ expected_type_number = DefinitionType.ETHEREUM_ERC7730_DISPLAY_FORMAT
try:
# first check format version
diff --git a/core/src/apps/ethereum/clear_signing.py b/core/src/apps/ethereum/clear_signing.py
index 5dd01742..fa078508 100644
--- a/core/src/apps/ethereum/clear_signing.py
+++ b/core/src/apps/ethereum/clear_signing.py
@@ -3,18 +3,23 @@ from typing import TYPE_CHECKING
from trezor import TR
+from .definitions import Definitions
from .helpers import address_from_bytes, format_ethereum_amount, get_account_and_path
if TYPE_CHECKING:
from buffer_types import AnyBytes
from typing import Callable, Iterable
- from trezor.messages import EthereumTokenInfo
+ from trezor.messages import (
+ EthereumABIValueInfo,
+ EthereumERC7730FieldInfo,
+ EthereumTokenInfo,
+ )
from trezor.ui.layouts import StrPropertyType
+ from typing_extensions import Self
from apps.common.payment_request import PaymentRequestVerifier
- from .definitions import Definitions
from .keychain import MsgInSignTx
# Represents values that have been parsed from the calldata
@@ -150,6 +155,61 @@ def parse_uint256_array(raw_data: memoryview) -> list[Value]:
DYNAMIC_DATA_PARSERS = [parse_bytes, parse_string, parse_uint256_array]
+
+def _get_parser(t: int) -> Parser:
+ """Get a parser for a type we received over the wire protocol."""
+ from trezor.enums import EthereumABIType as T
+
+ if t == T.ABI_ADDRESS:
+ return parse_address
+ elif t == T.ABI_BYTES:
+ return parse_bytes
+ elif t == T.ABI_STRING:
+ return parse_string
+ elif t == T.ABI_UINT256:
+ return parse_uint256
+ elif t == T.ABI_UINT248:
+ return parse_uint248
+ elif t == T.ABI_UINT160:
+ return parse_uint160
+ elif t == T.ABI_UINT128:
+ return parse_uint128
+ elif t == T.ABI_UINT120:
+ return parse_uint120
+ elif t == T.ABI_UINT112:
+ return parse_uint112
+ elif t == T.ABI_UINT96:
+ return parse_uint96
+ elif t == T.ABI_UINT72:
+ return parse_uint72
+ elif t == T.ABI_UINT64:
+ return parse_uint64
+ elif t == T.ABI_UINT48:
+ return parse_uint48
+ elif t == T.ABI_UINT40:
+ return parse_uint40
+ elif t == T.ABI_UINT32:
+ return parse_uint32
+ elif t == T.ABI_UINT24:
+ return parse_uint24
+ elif t == T.ABI_UINT16:
+ return parse_uint16
+ elif t == T.ABI_UINT8:
+ return parse_uint8
+ elif t == T.ABI_BOOL:
+ return parse_bool
+ raise InvalidFormatDefinition
+
+
+def _get_leaf_parser(info: EthereumABIValueInfo) -> Parser:
+ """Get a parser for a leaf (atomic or dynamic) value. Raises for nested structures."""
+ if info.atomic is not None:
+ return _get_parser(info.atomic)
+ elif info.dynamic is not None:
+ return _get_parser(info.dynamic)
+ raise InvalidFormatDefinition
+
+
# Field formatters: https://eips.ethereum.org/EIPS/eip-7730#field-formats
@@ -245,11 +305,10 @@ class TokenAmountFormatter(FieldFormatter):
if self.native_currency_address is not None:
if token_address in self.native_currency_address:
is_native_currency = True
- token = (
- definitions.get_token(token_address)
- if not is_native_currency
- else None
- )
+ if is_native_currency:
+ token = None
+ else:
+ token = definitions.get_token(token_address)
return (
format_ethereum_amount(amount, token, definitions.network),
token,
@@ -326,6 +385,33 @@ class ABIValue:
def parse(self, raw_data: memoryview, offset: int) -> tuple[AnyValue, int]:
raise NotImplementedError
+ @staticmethod
+ def from_proto(info: EthereumABIValueInfo) -> "ABIValue":
+ if info.atomic is not None:
+ return Atomic(_get_parser(info.atomic))
+ elif info.dynamic is not None:
+ return Dynamic(_get_parser(info.dynamic))
+ elif info.tuple is not None:
+ return Tuple(
+ tuple(_get_leaf_parser(f) for f in info.tuple.fields),
+ info.tuple.is_dynamic,
+ )
+ elif info.array is not None:
+ element = info.array
+ if element.atomic is not None:
+ return Array(Atomic(_get_parser(element.atomic)))
+ elif element.dynamic is not None:
+ return Array(Dynamic(_get_parser(element.dynamic)))
+ elif element.tuple is not None:
+ return Array(
+ Tuple(
+ tuple(_get_leaf_parser(f) for f in element.tuple.fields),
+ is_dynamic=False, # Tuples inside Arrays are always parsed as static!
+ )
+ )
+ raise InvalidFormatDefinition # Array of arrays not supported
+ raise InvalidFormatDefinition
+
class Atomic(ABIValue):
"""Atomic values, such as integers or addresses, are always stored on 32 bytes."""
@@ -459,6 +545,7 @@ class Array(ABIValue):
# https://eips.ethereum.org/EIPS/eip-7730#evm-transaction-container
+# Note: Keep this in sync with `EthereumERC7730ContainerPath` from `messages-definitions.proto`.
class ContainerPath:
From = 1
Value = 2
@@ -477,6 +564,44 @@ class FieldDefinition:
self.label = label
self.formatter = formatter
+ @staticmethod
+ def from_proto(info: EthereumERC7730FieldInfo) -> "FieldDefinition":
+ from trezor.enums import EthereumERC7730FieldFormatterType as FT
+ from trezor.messages import EthereumERC7730Path
+
+ def decode_path(p: EthereumERC7730Path) -> Path:
+ if p.container_path is not None:
+ return p.container_path
+ return tuple(p.path)
+
+ path = decode_path(info.path)
+
+ fmt_type = info.formatter
+ if fmt_type == FT.FORMATTER_ADDRESS_NAME:
+ formatter = AddressNameFormatter
+ elif fmt_type == FT.FORMATTER_AMOUNT:
+ formatter = AmountFormatter
+ elif fmt_type == FT.FORMATTER_TOKEN_AMOUNT:
+ formatter_params = {}
+ if info.token_path is not None:
+ formatter_params["token_path"] = decode_path(info.token_path)
+ if info.threshold is not None:
+ formatter_params["threshold"] = int.from_bytes(info.threshold, "big")
+ formatter = TokenAmountFormatter(**formatter_params)
+ elif fmt_type == FT.FORMATTER_UNIT:
+ formatter_params = {}
+ if info.decimals is not None:
+ formatter_params["decimals"] = info.decimals
+ if info.base is not None:
+ formatter_params["base"] = info.base
+ if info.prefix is not None:
+ formatter_params["prefix"] = info.prefix
+ formatter = UnitFormatter(**formatter_params)
+ else:
+ raise InvalidFormatDefinition
+
+ return FieldDefinition(path=path, label=info.label, formatter=formatter)
+
def get_formatter(self) -> FieldFormatter:
# instantiate formatters only if needed
formatter = self.formatter
@@ -602,6 +727,26 @@ class DisplayFormat:
return parameters, fields
+ @classmethod
+ def from_encoded(cls, encoded: AnyBytes) -> Self:
+ from trezor.messages import EthereumERC7730DisplayFormatInfo
+
+ from apps.common.definitions import decode_definition
+
+ proto = decode_definition(encoded, EthereumERC7730DisplayFormatInfo)
+
+ return cls(
+ binding_context=BindingContext([(proto.chain_id, bytes(proto.address))]),
+ func_sig=bytes(proto.func_sig),
+ intent=proto.intent,
+ parameter_definitions=[
+ ABIValue.from_proto(p) for p in proto.parameter_definitions
+ ],
+ field_definitions=[
+ FieldDefinition.from_proto(f) for f in proto.field_definitions
+ ],
+ )
+
async def try_parse(
data: AnyBytes,
@@ -632,9 +777,16 @@ async def try_parse(
display_format = f
break
else:
- return False
+ if msg.definitions and msg.definitions.encoded_erc7730_display_format:
+ f = DisplayFormat.from_encoded(
+ msg.definitions.encoded_erc7730_display_format
+ )
+ if f.func_sig == func_sig:
+ display_format = f
- if not display_format.matches_context(msg.chain_id, address_bytes):
+ if display_format is None or not display_format.matches_context(
+ msg.chain_id, address_bytes
+ ):
return False
calldata = memoryview(data)[SC_FUNC_SIG_BYTES:]
diff --git a/core/src/apps/ethereum/definitions.py b/core/src/apps/ethereum/definitions.py
index d106470c..0fc92328 100644
--- a/core/src/apps/ethereum/definitions.py
+++ b/core/src/apps/ethereum/definitions.py
@@ -24,7 +24,7 @@ class Definitions:
def from_encoded(
cls,
encoded_network: AnyBytes | None,
- encoded_token: AnyBytes | None,
+ encoded_tokens: list[AnyBytes],
chain_id: int | None = None,
slip44: int | None = None,
) -> Self:
@@ -56,12 +56,10 @@ class Definitions:
if slip44 is not None and network.slip44 != slip44:
raise DataError("Network definition mismatch")
- # get token definition
- if encoded_token is not None:
+ # get token definitions
+ for encoded_token in encoded_tokens:
token = decode_definition(encoded_token, EthereumTokenInfo)
# Ignore token if it doesn't match the network instead of raising an error.
- # This might help us in the future if we allow multiple networks/tokens
- # in the same message.
if token.chain_id == network.chain_id:
tokens[bytes(token.address)] = token
diff --git a/core/src/apps/ethereum/keychain.py b/core/src/apps/ethereum/keychain.py
index c59cc157..0ad796a6 100644
--- a/core/src/apps/ethereum/keychain.py
+++ b/core/src/apps/ethereum/keychain.py
@@ -80,19 +80,19 @@ def _defs_from_message(
msg: Any, chain_id: int | None = None, slip44: int | None = None
) -> definitions.Definitions:
encoded_network = None
- encoded_token = None
+ encoded_tokens: list = []
# try to get both from msg.definitions
if hasattr(msg, "definitions"):
if msg.definitions is not None:
encoded_network = msg.definitions.encoded_network
- encoded_token = msg.definitions.encoded_token
+ encoded_tokens = list(msg.definitions.encoded_tokens)
elif hasattr(msg, "encoded_network"):
encoded_network = msg.encoded_network
return definitions.Definitions.from_encoded(
- encoded_network, encoded_token, chain_id, slip44
+ encoded_network, encoded_tokens, chain_id, slip44
)
diff --git a/core/src/trezor/enums/DefinitionType.py b/core/src/trezor/enums/DefinitionType.py
index 4b43d721..0e93c711 100644
--- a/core/src/trezor/enums/DefinitionType.py
+++ b/core/src/trezor/enums/DefinitionType.py
@@ -5,3 +5,4 @@
ETHEREUM_NETWORK = 0
ETHEREUM_TOKEN = 1
SOLANA_TOKEN = 2
+ETHEREUM_ERC7730_DISPLAY_FORMAT = 3
diff --git a/core/src/trezor/enums/EthereumABIType.py b/core/src/trezor/enums/EthereumABIType.py
new file mode 100644
index 00000000..b319b2f5
--- /dev/null
+++ b/core/src/trezor/enums/EthereumABIType.py
@@ -0,0 +1,23 @@
+# Automatically generated by pb2py
+# fmt: off
+# isort:skip_file
+
+ABI_ADDRESS = 0
+ABI_UINT256 = 1
+ABI_UINT248 = 2
+ABI_UINT160 = 3
+ABI_UINT128 = 4
+ABI_UINT120 = 5
+ABI_UINT112 = 6
+ABI_UINT96 = 7
+ABI_UINT72 = 8
+ABI_UINT64 = 9
+ABI_UINT48 = 10
+ABI_UINT40 = 11
+ABI_UINT32 = 12
+ABI_UINT24 = 13
+ABI_UINT16 = 14
+ABI_UINT8 = 15
+ABI_BOOL = 16
+ABI_BYTES = 20
+ABI_STRING = 21
diff --git a/core/src/trezor/enums/EthereumERC7730ContainerPath.py b/core/src/trezor/enums/EthereumERC7730ContainerPath.py
new file mode 100644
index 00000000..5bafd164
--- /dev/null
+++ b/core/src/trezor/enums/EthereumERC7730ContainerPath.py
@@ -0,0 +1,8 @@
+# Automatically generated by pb2py
+# fmt: off
+# isort:skip_file
+
+FROM = 1
+VALUE = 2
+TO = 3
+CHAIN_ID = 4
diff --git a/core/src/trezor/enums/EthereumERC7730FieldFormatterType.py b/core/src/trezor/enums/EthereumERC7730FieldFormatterType.py
new file mode 100644
index 00000000..355f8854
--- /dev/null
+++ b/core/src/trezor/enums/EthereumERC7730FieldFormatterType.py
@@ -0,0 +1,8 @@
+# Automatically generated by pb2py
+# fmt: off
+# isort:skip_file
+
+FORMATTER_ADDRESS_NAME = 0
+FORMATTER_AMOUNT = 1
+FORMATTER_TOKEN_AMOUNT = 2
+FORMATTER_UNIT = 3
diff --git a/core/src/trezor/enums/__init__.py b/core/src/trezor/enums/__init__.py
index a1793074..7db5742a 100644
--- a/core/src/trezor/enums/__init__.py
+++ b/core/src/trezor/enums/__init__.py
@@ -289,6 +289,40 @@ if TYPE_CHECKING:
ETHEREUM_NETWORK = 0
ETHEREUM_TOKEN = 1
SOLANA_TOKEN = 2
+ ETHEREUM_ERC7730_DISPLAY_FORMAT = 3
+
+ class EthereumABIType(IntEnum):
+ ABI_ADDRESS = 0
+ ABI_UINT256 = 1
+ ABI_UINT248 = 2
+ ABI_UINT160 = 3
+ ABI_UINT128 = 4
+ ABI_UINT120 = 5
+ ABI_UINT112 = 6
+ ABI_UINT96 = 7
+ ABI_UINT72 = 8
+ ABI_UINT64 = 9
+ ABI_UINT48 = 10
+ ABI_UINT40 = 11
+ ABI_UINT32 = 12
+ ABI_UINT24 = 13
+ ABI_UINT16 = 14
+ ABI_UINT8 = 15
+ ABI_BOOL = 16
+ ABI_BYTES = 20
+ ABI_STRING = 21
+
+ class EthereumERC7730FieldFormatterType(IntEnum):
+ FORMATTER_ADDRESS_NAME = 0
+ FORMATTER_AMOUNT = 1
+ FORMATTER_TOKEN_AMOUNT = 2
+ FORMATTER_UNIT = 3
+
+ class EthereumERC7730ContainerPath(IntEnum):
+ FROM = 1
+ VALUE = 2
+ TO = 3
+ CHAIN_ID = 4
class EthereumDataType(IntEnum):
UINT = 1
diff --git a/core/src/trezor/messages.py b/core/src/trezor/messages.py
index 87bb813a..e8a10800 100644
--- a/core/src/trezor/messages.py
+++ b/core/src/trezor/messages.py
@@ -44,7 +44,10 @@ if TYPE_CHECKING:
from trezor.enums import DecredStakingSpendType # noqa: F401
from trezor.enums import DefinitionType # noqa: F401
from trezor.enums import DisplayRotation # noqa: F401
+ from trezor.enums import EthereumABIType # noqa: F401
from trezor.enums import EthereumDataType # noqa: F401
+ from trezor.enums import EthereumERC7730ContainerPath # noqa: F401
+ from trezor.enums import EthereumERC7730FieldFormatterType # noqa: F401
from trezor.enums import FailureType # noqa: F401
from trezor.enums import HomescreenFormat # noqa: F401
from trezor.enums import InputScriptType # noqa: F401
@@ -3264,6 +3267,110 @@ if TYPE_CHECKING:
def is_type_of(cls, msg: Any) -> TypeGuard["SolanaTokenInfo"]:
return isinstance(msg, cls)
+ class EthereumABITupleInfo(protobuf.MessageType):
+ fields: "list[EthereumABIValueInfo]"
+ is_dynamic: "bool"
+
+ def __init__(
+ self,
+ *,
+ is_dynamic: "bool",
+ fields: "list[EthereumABIValueInfo] | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["EthereumABITupleInfo"]:
+ return isinstance(msg, cls)
+
+ class EthereumABIValueInfo(protobuf.MessageType):
+ atomic: "EthereumABIType | None"
+ dynamic: "EthereumABIType | None"
+ tuple: "EthereumABITupleInfo | None"
+ array: "EthereumABIValueInfo | None"
+
+ def __init__(
+ self,
+ *,
+ atomic: "EthereumABIType | None" = None,
+ dynamic: "EthereumABIType | None" = None,
+ tuple: "EthereumABITupleInfo | None" = None,
+ array: "EthereumABIValueInfo | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["EthereumABIValueInfo"]:
+ return isinstance(msg, cls)
+
+ class EthereumERC7730Path(protobuf.MessageType):
+ path: "list[int]"
+ container_path: "EthereumERC7730ContainerPath | None"
+
+ def __init__(
+ self,
+ *,
+ path: "list[int] | None" = None,
+ container_path: "EthereumERC7730ContainerPath | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["EthereumERC7730Path"]:
+ return isinstance(msg, cls)
+
+ class EthereumERC7730FieldInfo(protobuf.MessageType):
+ path: "EthereumERC7730Path"
+ label: "str"
+ formatter: "EthereumERC7730FieldFormatterType"
+ token_path: "EthereumERC7730Path | None"
+ threshold: "AnyBytes | None"
+ decimals: "int | None"
+ base: "str | None"
+ prefix: "bool | None"
+
+ def __init__(
+ self,
+ *,
+ path: "EthereumERC7730Path",
+ label: "str",
+ formatter: "EthereumERC7730FieldFormatterType",
+ token_path: "EthereumERC7730Path | None" = None,
+ threshold: "AnyBytes | None" = None,
+ decimals: "int | None" = None,
+ base: "str | None" = None,
+ prefix: "bool | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["EthereumERC7730FieldInfo"]:
+ return isinstance(msg, cls)
+
+ class EthereumERC7730DisplayFormatInfo(protobuf.MessageType):
+ chain_id: "int"
+ address: "AnyBytes"
+ func_sig: "AnyBytes"
+ intent: "str"
+ parameter_definitions: "list[EthereumABIValueInfo]"
+ field_definitions: "list[EthereumERC7730FieldInfo]"
+
+ def __init__(
+ self,
+ *,
+ chain_id: "int",
+ address: "AnyBytes",
+ func_sig: "AnyBytes",
+ intent: "str",
+ parameter_definitions: "list[EthereumABIValueInfo] | None" = None,
+ field_definitions: "list[EthereumERC7730FieldInfo] | None" = None,
+ ) -> None:
+ pass
+
+ @classmethod
+ def is_type_of(cls, msg: Any) -> TypeGuard["EthereumERC7730DisplayFormatInfo"]:
+ return isinstance(msg, cls)
+
class EosGetPublicKey(protobuf.MessageType):
address_n: "list[int]"
show_display: "bool | None"
@@ -4066,13 +4173,15 @@ if TYPE_CHECKING:
class EthereumDefinitions(protobuf.MessageType):
encoded_network: "AnyBytes | None"
- encoded_token: "AnyBytes | None"
+ encoded_tokens: "list[AnyBytes]"
+ encoded_erc7730_display_format: "AnyBytes | None"
def __init__(
self,
*,
+ encoded_tokens: "list[AnyBytes] | None" = None,
encoded_network: "AnyBytes | None" = None,
- encoded_token: "AnyBytes | None" = None,
+ encoded_erc7730_display_format: "AnyBytes | None" = None,
) -> None:
pass
diff --git a/core/tests/test_apps.ethereum.definitions.py b/core/tests/test_apps.ethereum.definitions.py
index 1f191cb9..a73d73bb 100644
--- a/core/tests/test_apps.ethereum.definitions.py
+++ b/core/tests/test_apps.ethereum.definitions.py
@@ -38,25 +38,25 @@ class TestEthereumDefinitions(unittest.TestCase):
def test_empty(self) -> None:
# no slip44 nor chain_id -- should short-circuit and always be unknown
- defs = Definitions.from_encoded(None, None)
+ defs = Definitions.from_encoded(None, [])
self.assertUnknown(defs.network)
self.assertFalse(defs._tokens)
self.assertUnknown(defs.get_token(TETHER_ADDRESS))
# chain_id provided, no definition
- defs = Definitions.from_encoded(None, None, chain_id=100_000)
+ defs = Definitions.from_encoded(None, [], chain_id=100_000)
self.assertUnknown(defs.network)
self.assertFalse(defs._tokens)
self.assertUnknown(defs.get_token(TETHER_ADDRESS))
def test_builtin(self) -> None:
- defs = Definitions.from_encoded(None, None, chain_id=1)
+ defs = Definitions.from_encoded(None, [], chain_id=1)
self.assertKnown(defs.network)
self.assertFalse(defs._tokens)
self.assertKnown(defs.get_token(TETHER_ADDRESS))
self.assertUnknown(defs.get_token(b"\x00" * 20))
- defs = Definitions.from_encoded(None, None, slip44=60)
+ defs = Definitions.from_encoded(None, [], slip44=60)
self.assertKnown(defs.network)
self.assertFalse(defs._tokens)
self.assertKnown(defs.get_token(TETHER_ADDRESS))
@@ -64,19 +64,19 @@ class TestEthereumDefinitions(unittest.TestCase):
def test_external(self) -> None:
network = make_eth_network(chain_id=42)
- defs = Definitions.from_encoded(encode_eth_network(network), None, chain_id=42)
+ defs = Definitions.from_encoded(encode_eth_network(network), [], chain_id=42)
self.assertEqual(defs.network, network)
self.assertUnknown(defs.get_token(b"\x00" * 20))
token = make_eth_token(chain_id=42, address=b"\x00" * 20)
defs = Definitions.from_encoded(
- encode_eth_network(network), encode_eth_token(token), chain_id=42
+ encode_eth_network(network), [encode_eth_token(token)], chain_id=42
)
self.assertEqual(defs.network, network)
self.assertEqual(defs.get_token(b"\x00" * 20), token)
token = make_eth_token(chain_id=1, address=b"\x00" * 20)
- defs = Definitions.from_encoded(None, encode_eth_token(token), chain_id=1)
+ defs = Definitions.from_encoded(None, [encode_eth_token(token)], chain_id=1)
self.assertKnown(defs.network)
self.assertEqual(defs.get_token(b"\x00" * 20), token)
@@ -84,7 +84,7 @@ class TestEthereumDefinitions(unittest.TestCase):
network = make_eth_network(chain_id=42)
token = make_eth_token(chain_id=43, address=b"\x00" * 20)
defs = Definitions.from_encoded(
- encode_eth_network(network), encode_eth_token(token)
+ encode_eth_network(network), [encode_eth_token(token)]
)
self.assertUnknown(defs.get_token(b"\x00" * 20))
@@ -92,50 +92,50 @@ class TestEthereumDefinitions(unittest.TestCase):
network = make_eth_network(chain_id=42)
token = make_eth_token(chain_id=42, address=b"\x00" * 20)
defs = Definitions.from_encoded(
- encode_eth_network(network), encode_eth_token(token), chain_id=42
+ encode_eth_network(network), [encode_eth_token(token)], chain_id=42
)
self.assertEqual(defs.network, network)
self.assertEqual(defs.get_token(b"\x00" * 20), token)
with self.assertRaises(wire.DataError):
Definitions.from_encoded(
- encode_eth_network(network), encode_eth_token(token), chain_id=333
+ encode_eth_network(network), [encode_eth_token(token)], chain_id=333
)
def test_external_slip44_mismatch(self) -> None:
network = make_eth_network(chain_id=42, slip44=1999)
token = make_eth_token(chain_id=42, address=b"\x00" * 20)
defs = Definitions.from_encoded(
- encode_eth_network(network), encode_eth_token(token), slip44=1999
+ encode_eth_network(network), [encode_eth_token(token)], slip44=1999
)
self.assertEqual(defs.network, network)
self.assertEqual(defs.get_token(b"\x00" * 20), token)
with self.assertRaises(wire.DataError):
Definitions.from_encoded(
- encode_eth_network(network), encode_eth_token(token), slip44=333
+ encode_eth_network(network), [encode_eth_token(token)], slip44=333
)
def test_ignore_encoded_network(self) -> None:
# when network is builtin, ignore the encoded one
network = encode_eth_network(chain_id=1, symbol="BAD")
- defs = Definitions.from_encoded(network, None, chain_id=1)
+ defs = Definitions.from_encoded(network, [], chain_id=1)
self.assertNotEqual(defs.network, network)
def test_ignore_encoded_token(self) -> None:
# when token is builtin, ignore the encoded one
token = encode_eth_token(chain_id=1, address=TETHER_ADDRESS, symbol="BAD")
- defs = Definitions.from_encoded(None, token, chain_id=1)
+ defs = Definitions.from_encoded(None, [token], chain_id=1)
self.assertNotEqual(defs.get_token(TETHER_ADDRESS), token)
def test_ignore_with_no_match(self) -> None:
network = encode_eth_network(chain_id=100_000, symbol="BAD")
# smoke test: definition is accepted
- defs = Definitions.from_encoded(network, None, chain_id=100_000)
+ defs = Definitions.from_encoded(network, [], chain_id=100_000)
self.assertKnown(defs.network)
# same definition but nothing to match it to
- defs = Definitions.from_encoded(network, None)
+ defs = Definitions.from_encoded(network, [])
self.assertUnknown(defs.network)
diff --git a/legacy/firmware/ethereum_definitions.h b/legacy/firmware/ethereum_definitions.h
index 7b92964a..f5aa6c78 100644
--- a/legacy/firmware/ethereum_definitions.h
+++ b/legacy/firmware/ethereum_definitions.h
@@ -24,7 +24,7 @@
#include "messages-ethereum.pb.h"
typedef EthereumDefinitions_encoded_network_t EncodedNetwork;
-typedef EthereumDefinitions_encoded_token_t EncodedToken;
+typedef EthereumDefinitions_encoded_tokens_t EncodedToken;
typedef struct {
const EthereumNetworkInfo *network;
diff --git a/legacy/firmware/fsm_msg_ethereum.h b/legacy/firmware/fsm_msg_ethereum.h
index bbb26a53..811f8666 100644
--- a/legacy/firmware/fsm_msg_ethereum.h
+++ b/legacy/firmware/fsm_msg_ethereum.h
@@ -41,8 +41,8 @@ static const EthereumDefinitionsDecoded *get_definitions(
if (definitions->has_encoded_network) {
encoded_network = &definitions->encoded_network;
}
- if (definitions->has_encoded_token) {
- encoded_token = &definitions->encoded_token;
+ if (definitions->encoded_tokens_count > 0) {
+ encoded_token = &definitions->encoded_tokens[0];
}
}
diff --git a/legacy/firmware/protob/Makefile b/legacy/firmware/protob/Makefile
index c84fd140..74e1530c 100644
--- a/legacy/firmware/protob/Makefile
+++ b/legacy/firmware/protob/Makefile
@@ -9,6 +9,7 @@ SKIPPED_MESSAGES := Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tez
DebugLinkN4W1Connected DebugLinkN4W1Read DebugLinkN4W1Write DebugLinkN4W1Response \
DebugLinkOptigaSetSecMax DebugLinkSetLogFilter \
GetNonce TxAckInput TxAckOutput TxAckPrev PaymentRequest \
+ EthereumABITupleInfo EthereumABIValueInfo EthereumERC7730FieldInfo EthereumERC7730DisplayFormatInfo EthereumERC7730Path \
EthereumSignTypedData EthereumTypedDataStructRequest EthereumTypedDataStructAck \
EthereumTypedDataValueRequest EthereumTypedDataValueAck ShowDeviceTutorial \
UnlockBootloader AuthenticateDevice AuthenticityProof \
diff --git a/legacy/firmware/protob/messages-ethereum.options b/legacy/firmware/protob/messages-ethereum.options
index cb4c68e6..3e3a8271 100644
--- a/legacy/firmware/protob/messages-ethereum.options
+++ b/legacy/firmware/protob/messages-ethereum.options
@@ -55,5 +55,6 @@ EthereumAddress.address max_size:43
EthereumAddress.mac type:FT_IGNORE
EthereumPublicKey.xpub max_size:113
-EthereumDefinitions.encoded_network max_size:1024
-EthereumDefinitions.encoded_token max_size:1024
+EthereumDefinitions.encoded_network max_size:1024
+EthereumDefinitions.encoded_tokens max_count:1 max_size:1024
+EthereumDefinitions.encoded_erc7730_display_format type:FT_IGNORE
diff --git a/python/src/trezorlib/cli/ethereum.py b/python/src/trezorlib/cli/ethereum.py
index 478d3a87..d8dbf21b 100644
--- a/python/src/trezorlib/cli/ethereum.py
+++ b/python/src/trezorlib/cli/ethereum.py
@@ -453,7 +453,7 @@ def sign_tx(
defs = EthereumDefinitions(
encoded_network=encoded_network,
- encoded_token=encoded_token,
+ encoded_tokens=[encoded_token] if encoded_token is not None else [],
)
if is_eip1559:
diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py
index e217af9b..6fc59135 100644
--- a/python/src/trezorlib/messages.py
+++ b/python/src/trezorlib/messages.py
@@ -329,6 +329,43 @@ class DefinitionType(IntEnum):
ETHEREUM_NETWORK = 0
ETHEREUM_TOKEN = 1
SOLANA_TOKEN = 2
+ ETHEREUM_ERC7730_DISPLAY_FORMAT = 3
+
+
+class EthereumABIType(IntEnum):
+ ABI_ADDRESS = 0
+ ABI_UINT256 = 1
+ ABI_UINT248 = 2
+ ABI_UINT160 = 3
+ ABI_UINT128 = 4
+ ABI_UINT120 = 5
+ ABI_UINT112 = 6
+ ABI_UINT96 = 7
+ ABI_UINT72 = 8
+ ABI_UINT64 = 9
+ ABI_UINT48 = 10
+ ABI_UINT40 = 11
+ ABI_UINT32 = 12
+ ABI_UINT24 = 13
+ ABI_UINT16 = 14
+ ABI_UINT8 = 15
+ ABI_BOOL = 16
+ ABI_BYTES = 20
+ ABI_STRING = 21
+
+
+class EthereumERC7730FieldFormatterType(IntEnum):
+ FORMATTER_ADDRESS_NAME = 0
+ FORMATTER_AMOUNT = 1
+ FORMATTER_TOKEN_AMOUNT = 2
+ FORMATTER_UNIT = 3
+
+
+class EthereumERC7730ContainerPath(IntEnum):
+ FROM = 1
+ VALUE = 2
+ TO = 3
+ CHAIN_ID = 4
class EthereumDataType(IntEnum):
@@ -4642,6 +4679,127 @@ class SolanaTokenInfo(protobuf.MessageType):
self.name = name
+class EthereumABITupleInfo(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("fields", "EthereumABIValueInfo", repeated=True, required=False, default=None),
+ 2: protobuf.Field("is_dynamic", "bool", repeated=False, required=True),
+ }
+
+ def __init__(
+ self,
+ *,
+ is_dynamic: "bool",
+ fields: Optional[Sequence["EthereumABIValueInfo"]] = None,
+ ) -> None:
+ self.fields: Sequence["EthereumABIValueInfo"] = fields if fields is not None else []
+ self.is_dynamic = is_dynamic
+
+
+class EthereumABIValueInfo(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("atomic", "EthereumABIType", repeated=False, required=False, default=None),
+ 2: protobuf.Field("dynamic", "EthereumABIType", repeated=False, required=False, default=None),
+ 3: protobuf.Field("tuple", "EthereumABITupleInfo", repeated=False, required=False, default=None),
+ 4: protobuf.Field("array", "EthereumABIValueInfo", repeated=False, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ atomic: Optional["EthereumABIType"] = None,
+ dynamic: Optional["EthereumABIType"] = None,
+ tuple: Optional["EthereumABITupleInfo"] = None,
+ array: Optional["EthereumABIValueInfo"] = None,
+ ) -> None:
+ self.atomic = atomic
+ self.dynamic = dynamic
+ self.tuple = tuple
+ self.array = array
+
+
+class EthereumERC7730Path(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("path", "uint32", repeated=True, required=False, default=None),
+ 2: protobuf.Field("container_path", "EthereumERC7730ContainerPath", repeated=False, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ path: Optional[Sequence["int"]] = None,
+ container_path: Optional["EthereumERC7730ContainerPath"] = None,
+ ) -> None:
+ self.path: Sequence["int"] = path if path is not None else []
+ self.container_path = container_path
+
+
+class EthereumERC7730FieldInfo(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("path", "EthereumERC7730Path", repeated=False, required=True),
+ 2: protobuf.Field("label", "string", repeated=False, required=True),
+ 3: protobuf.Field("formatter", "EthereumERC7730FieldFormatterType", repeated=False, required=True),
+ 4: protobuf.Field("token_path", "EthereumERC7730Path", repeated=False, required=False, default=None),
+ 5: protobuf.Field("threshold", "bytes", repeated=False, required=False, default=None),
+ 6: protobuf.Field("decimals", "uint32", repeated=False, required=False, default=None),
+ 7: protobuf.Field("base", "string", repeated=False, required=False, default=None),
+ 8: protobuf.Field("prefix", "bool", repeated=False, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ path: "EthereumERC7730Path",
+ label: "str",
+ formatter: "EthereumERC7730FieldFormatterType",
+ token_path: Optional["EthereumERC7730Path"] = None,
+ threshold: Optional["bytes"] = None,
+ decimals: Optional["int"] = None,
+ base: Optional["str"] = None,
+ prefix: Optional["bool"] = None,
+ ) -> None:
+ self.path = path
+ self.label = label
+ self.formatter = formatter
+ self.token_path = token_path
+ self.threshold = threshold
+ self.decimals = decimals
+ self.base = base
+ self.prefix = prefix
+
+
+class EthereumERC7730DisplayFormatInfo(protobuf.MessageType):
+ MESSAGE_WIRE_TYPE = None
+ FIELDS = {
+ 1: protobuf.Field("chain_id", "uint64", repeated=False, required=True),
+ 2: protobuf.Field("address", "bytes", repeated=False, required=True),
+ 3: protobuf.Field("func_sig", "bytes", repeated=False, required=True),
+ 4: protobuf.Field("intent", "string", repeated=False, required=True),
+ 5: protobuf.Field("parameter_definitions", "EthereumABIValueInfo", repeated=True, required=False, default=None),
+ 6: protobuf.Field("field_definitions", "EthereumERC7730FieldInfo", repeated=True, required=False, default=None),
+ }
+
+ def __init__(
+ self,
+ *,
+ chain_id: "int",
+ address: "bytes",
+ func_sig: "bytes",
+ intent: "str",
+ parameter_definitions: Optional[Sequence["EthereumABIValueInfo"]] = None,
+ field_definitions: Optional[Sequence["EthereumERC7730FieldInfo"]] = None,
+ ) -> None:
+ self.parameter_definitions: Sequence["EthereumABIValueInfo"] = parameter_definitions if parameter_definitions is not None else []
+ self.field_definitions: Sequence["EthereumERC7730FieldInfo"] = field_definitions if field_definitions is not None else []
+ self.chain_id = chain_id
+ self.address = address
+ self.func_sig = func_sig
+ self.intent = intent
+
+
class EosGetPublicKey(protobuf.MessageType):
MESSAGE_WIRE_TYPE = 600
FIELDS = {
@@ -5562,17 +5720,20 @@ class EthereumDefinitions(protobuf.MessageType):
MESSAGE_WIRE_TYPE = None
FIELDS = {
1: protobuf.Field("encoded_network", "bytes", repeated=False, required=False, default=None),
- 2: protobuf.Field("encoded_token", "bytes", repeated=False, required=False, default=None),
+ 2: protobuf.Field("encoded_tokens", "bytes", repeated=True, required=False, default=None),
+ 3: protobuf.Field("encoded_erc7730_display_format", "bytes", repeated=False, required=False, default=None),
}
def __init__(
self,
*,
+ encoded_tokens: Optional[Sequence["bytes"]] = None,
encoded_network: Optional["bytes"] = None,
- encoded_token: Optional["bytes"] = None,
+ encoded_erc7730_display_format: Optional["bytes"] = None,
) -> None:
+ self.encoded_tokens: Sequence["bytes"] = encoded_tokens if encoded_tokens is not None else []
self.encoded_network = encoded_network
- self.encoded_token = encoded_token
+ self.encoded_erc7730_display_format = encoded_erc7730_display_format
class EthereumAccessList(protobuf.MessageType):
diff --git a/rust/trezor-client/src/protos/generated/messages_definitions.rs b/rust/trezor-client/src/protos/generated/messages_definitions.rs
index bb145028..83208a36 100644
--- a/rust/trezor-client/src/protos/generated/messages_definitions.rs
+++ b/rust/trezor-client/src/protos/generated/messages_definitions.rs
@@ -952,6 +952,1371 @@ impl ::protobuf::reflect::ProtobufValue for SolanaTokenInfo {
type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}
+// @@protoc_insertion_point(message:hw.trezor.messages.definitions.EthereumABITupleInfo)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct EthereumABITupleInfo {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumABITupleInfo.fields)
+ pub fields: ::std::vec::Vec<EthereumABIValueInfo>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumABITupleInfo.is_dynamic)
+ pub is_dynamic: ::std::option::Option<bool>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.definitions.EthereumABITupleInfo.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a EthereumABITupleInfo {
+ fn default() -> &'a EthereumABITupleInfo {
+ <EthereumABITupleInfo as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl EthereumABITupleInfo {
+ pub fn new() -> EthereumABITupleInfo {
+ ::std::default::Default::default()
+ }
+
+ // required bool is_dynamic = 2;
+
+ pub fn is_dynamic(&self) -> bool {
+ self.is_dynamic.unwrap_or(false)
+ }
+
+ pub fn clear_is_dynamic(&mut self) {
+ self.is_dynamic = ::std::option::Option::None;
+ }
+
+ pub fn has_is_dynamic(&self) -> bool {
+ self.is_dynamic.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_is_dynamic(&mut self, v: bool) {
+ self.is_dynamic = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "fields",
+ |m: &EthereumABITupleInfo| { &m.fields },
+ |m: &mut EthereumABITupleInfo| { &mut m.fields },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "is_dynamic",
+ |m: &EthereumABITupleInfo| { &m.is_dynamic },
+ |m: &mut EthereumABITupleInfo| { &mut m.is_dynamic },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumABITupleInfo>(
+ "EthereumABITupleInfo",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for EthereumABITupleInfo {
+ const NAME: &'static str = "EthereumABITupleInfo";
+
+ fn is_initialized(&self) -> bool {
+ if self.is_dynamic.is_none() {
+ return false;
+ }
+ for v in &self.fields {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ self.fields.push(is.read_message()?);
+ },
+ 16 => {
+ self.is_dynamic = ::std::option::Option::Some(is.read_bool()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ for value in &self.fields {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ };
+ if let Some(v) = self.is_dynamic {
+ my_size += 1 + 1;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ for v in &self.fields {
+ ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
+ };
+ if let Some(v) = self.is_dynamic {
+ os.write_bool(2, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> EthereumABITupleInfo {
+ EthereumABITupleInfo::new()
+ }
+
+ fn clear(&mut self) {
+ self.fields.clear();
+ self.is_dynamic = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static EthereumABITupleInfo {
+ static instance: EthereumABITupleInfo = EthereumABITupleInfo {
+ fields: ::std::vec::Vec::new(),
+ is_dynamic: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for EthereumABITupleInfo {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumABITupleInfo").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for EthereumABITupleInfo {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for EthereumABITupleInfo {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.definitions.EthereumABIValueInfo)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct EthereumABIValueInfo {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumABIValueInfo.atomic)
+ pub atomic: ::std::option::Option<::protobuf::EnumOrUnknown<EthereumABIType>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumABIValueInfo.dynamic)
+ pub dynamic: ::std::option::Option<::protobuf::EnumOrUnknown<EthereumABIType>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumABIValueInfo.tuple)
+ pub tuple: ::protobuf::MessageField<EthereumABITupleInfo>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumABIValueInfo.array)
+ pub array: ::protobuf::MessageField<EthereumABIValueInfo>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.definitions.EthereumABIValueInfo.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a EthereumABIValueInfo {
+ fn default() -> &'a EthereumABIValueInfo {
+ <EthereumABIValueInfo as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl EthereumABIValueInfo {
+ pub fn new() -> EthereumABIValueInfo {
+ ::std::default::Default::default()
+ }
+
+ // optional .hw.trezor.messages.definitions.EthereumABIType atomic = 1;
+
+ pub fn atomic(&self) -> EthereumABIType {
+ match self.atomic {
+ Some(e) => e.enum_value_or(EthereumABIType::ABI_ADDRESS),
+ None => EthereumABIType::ABI_ADDRESS,
+ }
+ }
+
+ pub fn clear_atomic(&mut self) {
+ self.atomic = ::std::option::Option::None;
+ }
+
+ pub fn has_atomic(&self) -> bool {
+ self.atomic.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_atomic(&mut self, v: EthereumABIType) {
+ self.atomic = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
+ }
+
+ // optional .hw.trezor.messages.definitions.EthereumABIType dynamic = 2;
+
+ pub fn dynamic(&self) -> EthereumABIType {
+ match self.dynamic {
+ Some(e) => e.enum_value_or(EthereumABIType::ABI_ADDRESS),
+ None => EthereumABIType::ABI_ADDRESS,
+ }
+ }
+
+ pub fn clear_dynamic(&mut self) {
+ self.dynamic = ::std::option::Option::None;
+ }
+
+ pub fn has_dynamic(&self) -> bool {
+ self.dynamic.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_dynamic(&mut self, v: EthereumABIType) {
+ self.dynamic = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(4);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "atomic",
+ |m: &EthereumABIValueInfo| { &m.atomic },
+ |m: &mut EthereumABIValueInfo| { &mut m.atomic },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "dynamic",
+ |m: &EthereumABIValueInfo| { &m.dynamic },
+ |m: &mut EthereumABIValueInfo| { &mut m.dynamic },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EthereumABITupleInfo>(
+ "tuple",
+ |m: &EthereumABIValueInfo| { &m.tuple },
+ |m: &mut EthereumABIValueInfo| { &mut m.tuple },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EthereumABIValueInfo>(
+ "array",
+ |m: &EthereumABIValueInfo| { &m.array },
+ |m: &mut EthereumABIValueInfo| { &mut m.array },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumABIValueInfo>(
+ "EthereumABIValueInfo",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for EthereumABIValueInfo {
+ const NAME: &'static str = "EthereumABIValueInfo";
+
+ fn is_initialized(&self) -> bool {
+ for v in &self.tuple {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ for v in &self.array {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.atomic = ::std::option::Option::Some(is.read_enum_or_unknown()?);
+ },
+ 16 => {
+ self.dynamic = ::std::option::Option::Some(is.read_enum_or_unknown()?);
+ },
+ 26 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.tuple)?;
+ },
+ 34 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.array)?;
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.atomic {
+ my_size += ::protobuf::rt::int32_size(1, v.value());
+ }
+ if let Some(v) = self.dynamic {
+ my_size += ::protobuf::rt::int32_size(2, v.value());
+ }
+ if let Some(v) = self.tuple.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ if let Some(v) = self.array.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.atomic {
+ os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
+ }
+ if let Some(v) = self.dynamic {
+ os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?;
+ }
+ if let Some(v) = self.tuple.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
+ }
+ if let Some(v) = self.array.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> EthereumABIValueInfo {
+ EthereumABIValueInfo::new()
+ }
+
+ fn clear(&mut self) {
+ self.atomic = ::std::option::Option::None;
+ self.dynamic = ::std::option::Option::None;
+ self.tuple.clear();
+ self.array.clear();
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static EthereumABIValueInfo {
+ static instance: EthereumABIValueInfo = EthereumABIValueInfo {
+ atomic: ::std::option::Option::None,
+ dynamic: ::std::option::Option::None,
+ tuple: ::protobuf::MessageField::none(),
+ array: ::protobuf::MessageField::none(),
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for EthereumABIValueInfo {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumABIValueInfo").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for EthereumABIValueInfo {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for EthereumABIValueInfo {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.definitions.EthereumERC7730Path)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct EthereumERC7730Path {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730Path.path)
+ pub path: ::std::vec::Vec<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730Path.container_path)
+ pub container_path: ::std::option::Option<::protobuf::EnumOrUnknown<EthereumERC7730ContainerPath>>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.definitions.EthereumERC7730Path.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a EthereumERC7730Path {
+ fn default() -> &'a EthereumERC7730Path {
+ <EthereumERC7730Path as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl EthereumERC7730Path {
+ pub fn new() -> EthereumERC7730Path {
+ ::std::default::Default::default()
+ }
+
+ // optional .hw.trezor.messages.definitions.EthereumERC7730ContainerPath container_path = 2;
+
+ pub fn container_path(&self) -> EthereumERC7730ContainerPath {
+ match self.container_path {
+ Some(e) => e.enum_value_or(EthereumERC7730ContainerPath::FROM),
+ None => EthereumERC7730ContainerPath::FROM,
+ }
+ }
+
+ pub fn clear_container_path(&mut self) {
+ self.container_path = ::std::option::Option::None;
+ }
+
+ pub fn has_container_path(&self) -> bool {
+ self.container_path.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_container_path(&mut self, v: EthereumERC7730ContainerPath) {
+ self.container_path = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "path",
+ |m: &EthereumERC7730Path| { &m.path },
+ |m: &mut EthereumERC7730Path| { &mut m.path },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "container_path",
+ |m: &EthereumERC7730Path| { &m.container_path },
+ |m: &mut EthereumERC7730Path| { &mut m.container_path },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumERC7730Path>(
+ "EthereumERC7730Path",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for EthereumERC7730Path {
+ const NAME: &'static str = "EthereumERC7730Path";
+
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ is.read_repeated_packed_uint32_into(&mut self.path)?;
+ },
+ 8 => {
+ self.path.push(is.read_uint32()?);
+ },
+ 16 => {
+ self.container_path = ::std::option::Option::Some(is.read_enum_or_unknown()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ for value in &self.path {
+ my_size += ::protobuf::rt::uint32_size(1, *value);
+ };
+ if let Some(v) = self.container_path {
+ my_size += ::protobuf::rt::int32_size(2, v.value());
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ for v in &self.path {
+ os.write_uint32(1, *v)?;
+ };
+ if let Some(v) = self.container_path {
+ os.write_enum(2, ::protobuf::EnumOrUnknown::value(&v))?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> EthereumERC7730Path {
+ EthereumERC7730Path::new()
+ }
+
+ fn clear(&mut self) {
+ self.path.clear();
+ self.container_path = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static EthereumERC7730Path {
+ static instance: EthereumERC7730Path = EthereumERC7730Path {
+ path: ::std::vec::Vec::new(),
+ container_path: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for EthereumERC7730Path {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumERC7730Path").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for EthereumERC7730Path {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for EthereumERC7730Path {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.definitions.EthereumERC7730FieldInfo)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct EthereumERC7730FieldInfo {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.path)
+ pub path: ::protobuf::MessageField<EthereumERC7730Path>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.label)
+ pub label: ::std::option::Option<::std::string::String>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.formatter)
+ pub formatter: ::std::option::Option<::protobuf::EnumOrUnknown<EthereumERC7730FieldFormatterType>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.token_path)
+ pub token_path: ::protobuf::MessageField<EthereumERC7730Path>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.threshold)
+ pub threshold: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.decimals)
+ pub decimals: ::std::option::Option<u32>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.base)
+ pub base: ::std::option::Option<::std::string::String>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.prefix)
+ pub prefix: ::std::option::Option<bool>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.definitions.EthereumERC7730FieldInfo.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a EthereumERC7730FieldInfo {
+ fn default() -> &'a EthereumERC7730FieldInfo {
+ <EthereumERC7730FieldInfo as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl EthereumERC7730FieldInfo {
+ pub fn new() -> EthereumERC7730FieldInfo {
+ ::std::default::Default::default()
+ }
+
+ // required string label = 2;
+
+ pub fn label(&self) -> &str {
+ match self.label.as_ref() {
+ Some(v) => v,
+ None => "",
+ }
+ }
+
+ pub fn clear_label(&mut self) {
+ self.label = ::std::option::Option::None;
+ }
+
+ pub fn has_label(&self) -> bool {
+ self.label.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_label(&mut self, v: ::std::string::String) {
+ self.label = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_label(&mut self) -> &mut ::std::string::String {
+ if self.label.is_none() {
+ self.label = ::std::option::Option::Some(::std::string::String::new());
+ }
+ self.label.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_label(&mut self) -> ::std::string::String {
+ self.label.take().unwrap_or_else(|| ::std::string::String::new())
+ }
+
+ // required .hw.trezor.messages.definitions.EthereumERC7730FieldFormatterType formatter = 3;
+
+ pub fn formatter(&self) -> EthereumERC7730FieldFormatterType {
+ match self.formatter {
+ Some(e) => e.enum_value_or(EthereumERC7730FieldFormatterType::FORMATTER_ADDRESS_NAME),
+ None => EthereumERC7730FieldFormatterType::FORMATTER_ADDRESS_NAME,
+ }
+ }
+
+ pub fn clear_formatter(&mut self) {
+ self.formatter = ::std::option::Option::None;
+ }
+
+ pub fn has_formatter(&self) -> bool {
+ self.formatter.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_formatter(&mut self, v: EthereumERC7730FieldFormatterType) {
+ self.formatter = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
+ }
+
+ // optional bytes threshold = 5;
+
+ pub fn threshold(&self) -> &[u8] {
+ match self.threshold.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_threshold(&mut self) {
+ self.threshold = ::std::option::Option::None;
+ }
+
+ pub fn has_threshold(&self) -> bool {
+ self.threshold.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_threshold(&mut self, v: ::std::vec::Vec<u8>) {
+ self.threshold = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_threshold(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.threshold.is_none() {
+ self.threshold = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.threshold.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_threshold(&mut self) -> ::std::vec::Vec<u8> {
+ self.threshold.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // optional uint32 decimals = 6;
+
+ pub fn decimals(&self) -> u32 {
+ self.decimals.unwrap_or(0)
+ }
+
+ pub fn clear_decimals(&mut self) {
+ self.decimals = ::std::option::Option::None;
+ }
+
+ pub fn has_decimals(&self) -> bool {
+ self.decimals.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_decimals(&mut self, v: u32) {
+ self.decimals = ::std::option::Option::Some(v);
+ }
+
+ // optional string base = 7;
+
+ pub fn base(&self) -> &str {
+ match self.base.as_ref() {
+ Some(v) => v,
+ None => "",
+ }
+ }
+
+ pub fn clear_base(&mut self) {
+ self.base = ::std::option::Option::None;
+ }
+
+ pub fn has_base(&self) -> bool {
+ self.base.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_base(&mut self, v: ::std::string::String) {
+ self.base = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_base(&mut self) -> &mut ::std::string::String {
+ if self.base.is_none() {
+ self.base = ::std::option::Option::Some(::std::string::String::new());
+ }
+ self.base.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_base(&mut self) -> ::std::string::String {
+ self.base.take().unwrap_or_else(|| ::std::string::String::new())
+ }
+
+ // optional bool prefix = 8;
+
+ pub fn prefix(&self) -> bool {
+ self.prefix.unwrap_or(false)
+ }
+
+ pub fn clear_prefix(&mut self) {
+ self.prefix = ::std::option::Option::None;
+ }
+
+ pub fn has_prefix(&self) -> bool {
+ self.prefix.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_prefix(&mut self, v: bool) {
+ self.prefix = ::std::option::Option::Some(v);
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(8);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EthereumERC7730Path>(
+ "path",
+ |m: &EthereumERC7730FieldInfo| { &m.path },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.path },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "label",
+ |m: &EthereumERC7730FieldInfo| { &m.label },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.label },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "formatter",
+ |m: &EthereumERC7730FieldInfo| { &m.formatter },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.formatter },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_message_field_accessor::<_, EthereumERC7730Path>(
+ "token_path",
+ |m: &EthereumERC7730FieldInfo| { &m.token_path },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.token_path },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "threshold",
+ |m: &EthereumERC7730FieldInfo| { &m.threshold },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.threshold },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "decimals",
+ |m: &EthereumERC7730FieldInfo| { &m.decimals },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.decimals },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "base",
+ |m: &EthereumERC7730FieldInfo| { &m.base },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.base },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "prefix",
+ |m: &EthereumERC7730FieldInfo| { &m.prefix },
+ |m: &mut EthereumERC7730FieldInfo| { &mut m.prefix },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumERC7730FieldInfo>(
+ "EthereumERC7730FieldInfo",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for EthereumERC7730FieldInfo {
+ const NAME: &'static str = "EthereumERC7730FieldInfo";
+
+ fn is_initialized(&self) -> bool {
+ if self.path.is_none() {
+ return false;
+ }
+ if self.label.is_none() {
+ return false;
+ }
+ if self.formatter.is_none() {
+ return false;
+ }
+ for v in &self.path {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ for v in &self.token_path {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 10 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.path)?;
+ },
+ 18 => {
+ self.label = ::std::option::Option::Some(is.read_string()?);
+ },
+ 24 => {
+ self.formatter = ::std::option::Option::Some(is.read_enum_or_unknown()?);
+ },
+ 34 => {
+ ::protobuf::rt::read_singular_message_into_field(is, &mut self.token_path)?;
+ },
+ 42 => {
+ self.threshold = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 48 => {
+ self.decimals = ::std::option::Option::Some(is.read_uint32()?);
+ },
+ 58 => {
+ self.base = ::std::option::Option::Some(is.read_string()?);
+ },
+ 64 => {
+ self.prefix = ::std::option::Option::Some(is.read_bool()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.path.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ if let Some(v) = self.label.as_ref() {
+ my_size += ::protobuf::rt::string_size(2, &v);
+ }
+ if let Some(v) = self.formatter {
+ my_size += ::protobuf::rt::int32_size(3, v.value());
+ }
+ if let Some(v) = self.token_path.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ }
+ if let Some(v) = self.threshold.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(5, &v);
+ }
+ if let Some(v) = self.decimals {
+ my_size += ::protobuf::rt::uint32_size(6, v);
+ }
+ if let Some(v) = self.base.as_ref() {
+ my_size += ::protobuf::rt::string_size(7, &v);
+ }
+ if let Some(v) = self.prefix {
+ my_size += 1 + 1;
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.path.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
+ }
+ if let Some(v) = self.label.as_ref() {
+ os.write_string(2, v)?;
+ }
+ if let Some(v) = self.formatter {
+ os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?;
+ }
+ if let Some(v) = self.token_path.as_ref() {
+ ::protobuf::rt::write_message_field_with_cached_size(4, v, os)?;
+ }
+ if let Some(v) = self.threshold.as_ref() {
+ os.write_bytes(5, v)?;
+ }
+ if let Some(v) = self.decimals {
+ os.write_uint32(6, v)?;
+ }
+ if let Some(v) = self.base.as_ref() {
+ os.write_string(7, v)?;
+ }
+ if let Some(v) = self.prefix {
+ os.write_bool(8, v)?;
+ }
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> EthereumERC7730FieldInfo {
+ EthereumERC7730FieldInfo::new()
+ }
+
+ fn clear(&mut self) {
+ self.path.clear();
+ self.label = ::std::option::Option::None;
+ self.formatter = ::std::option::Option::None;
+ self.token_path.clear();
+ self.threshold = ::std::option::Option::None;
+ self.decimals = ::std::option::Option::None;
+ self.base = ::std::option::Option::None;
+ self.prefix = ::std::option::Option::None;
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static EthereumERC7730FieldInfo {
+ static instance: EthereumERC7730FieldInfo = EthereumERC7730FieldInfo {
+ path: ::protobuf::MessageField::none(),
+ label: ::std::option::Option::None,
+ formatter: ::std::option::Option::None,
+ token_path: ::protobuf::MessageField::none(),
+ threshold: ::std::option::Option::None,
+ decimals: ::std::option::Option::None,
+ base: ::std::option::Option::None,
+ prefix: ::std::option::Option::None,
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for EthereumERC7730FieldInfo {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumERC7730FieldInfo").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for EthereumERC7730FieldInfo {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for EthereumERC7730FieldInfo {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
+// @@protoc_insertion_point(message:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo)
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct EthereumERC7730DisplayFormatInfo {
+ // message fields
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.chain_id)
+ pub chain_id: ::std::option::Option<u64>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.address)
+ pub address: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.func_sig)
+ pub func_sig: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.intent)
+ pub intent: ::std::option::Option<::std::string::String>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.parameter_definitions)
+ pub parameter_definitions: ::std::vec::Vec<EthereumABIValueInfo>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.field_definitions)
+ pub field_definitions: ::std::vec::Vec<EthereumERC7730FieldInfo>,
+ // special fields
+ // @@protoc_insertion_point(special_field:hw.trezor.messages.definitions.EthereumERC7730DisplayFormatInfo.special_fields)
+ pub special_fields: ::protobuf::SpecialFields,
+}
+
+impl<'a> ::std::default::Default for &'a EthereumERC7730DisplayFormatInfo {
+ fn default() -> &'a EthereumERC7730DisplayFormatInfo {
+ <EthereumERC7730DisplayFormatInfo as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl EthereumERC7730DisplayFormatInfo {
+ pub fn new() -> EthereumERC7730DisplayFormatInfo {
+ ::std::default::Default::default()
+ }
+
+ // required uint64 chain_id = 1;
+
+ pub fn chain_id(&self) -> u64 {
+ self.chain_id.unwrap_or(0)
+ }
+
+ pub fn clear_chain_id(&mut self) {
+ self.chain_id = ::std::option::Option::None;
+ }
+
+ pub fn has_chain_id(&self) -> bool {
+ self.chain_id.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_chain_id(&mut self, v: u64) {
+ self.chain_id = ::std::option::Option::Some(v);
+ }
+
+ // required bytes address = 2;
+
+ pub fn address(&self) -> &[u8] {
+ match self.address.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_address(&mut self) {
+ self.address = ::std::option::Option::None;
+ }
+
+ pub fn has_address(&self) -> bool {
+ self.address.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_address(&mut self, v: ::std::vec::Vec<u8>) {
+ self.address = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_address(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.address.is_none() {
+ self.address = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.address.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_address(&mut self) -> ::std::vec::Vec<u8> {
+ self.address.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // required bytes func_sig = 3;
+
+ pub fn func_sig(&self) -> &[u8] {
+ match self.func_sig.as_ref() {
+ Some(v) => v,
+ None => &[],
+ }
+ }
+
+ pub fn clear_func_sig(&mut self) {
+ self.func_sig = ::std::option::Option::None;
+ }
+
+ pub fn has_func_sig(&self) -> bool {
+ self.func_sig.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_func_sig(&mut self, v: ::std::vec::Vec<u8>) {
+ self.func_sig = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_func_sig(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.func_sig.is_none() {
+ self.func_sig = ::std::option::Option::Some(::std::vec::Vec::new());
+ }
+ self.func_sig.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_func_sig(&mut self) -> ::std::vec::Vec<u8> {
+ self.func_sig.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // required string intent = 4;
+
+ pub fn intent(&self) -> &str {
+ match self.intent.as_ref() {
+ Some(v) => v,
+ None => "",
+ }
+ }
+
+ pub fn clear_intent(&mut self) {
+ self.intent = ::std::option::Option::None;
+ }
+
+ pub fn has_intent(&self) -> bool {
+ self.intent.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_intent(&mut self, v: ::std::string::String) {
+ self.intent = ::std::option::Option::Some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_intent(&mut self) -> &mut ::std::string::String {
+ if self.intent.is_none() {
+ self.intent = ::std::option::Option::Some(::std::string::String::new());
+ }
+ self.intent.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_intent(&mut self) -> ::std::string::String {
+ self.intent.take().unwrap_or_else(|| ::std::string::String::new())
+ }
+
+ fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
+ let mut fields = ::std::vec::Vec::with_capacity(6);
+ let mut oneofs = ::std::vec::Vec::with_capacity(0);
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "chain_id",
+ |m: &EthereumERC7730DisplayFormatInfo| { &m.chain_id },
+ |m: &mut EthereumERC7730DisplayFormatInfo| { &mut m.chain_id },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "address",
+ |m: &EthereumERC7730DisplayFormatInfo| { &m.address },
+ |m: &mut EthereumERC7730DisplayFormatInfo| { &mut m.address },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "func_sig",
+ |m: &EthereumERC7730DisplayFormatInfo| { &m.func_sig },
+ |m: &mut EthereumERC7730DisplayFormatInfo| { &mut m.func_sig },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
+ "intent",
+ |m: &EthereumERC7730DisplayFormatInfo| { &m.intent },
+ |m: &mut EthereumERC7730DisplayFormatInfo| { &mut m.intent },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "parameter_definitions",
+ |m: &EthereumERC7730DisplayFormatInfo| { &m.parameter_definitions },
+ |m: &mut EthereumERC7730DisplayFormatInfo| { &mut m.parameter_definitions },
+ ));
+ fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "field_definitions",
+ |m: &EthereumERC7730DisplayFormatInfo| { &m.field_definitions },
+ |m: &mut EthereumERC7730DisplayFormatInfo| { &mut m.field_definitions },
+ ));
+ ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumERC7730DisplayFormatInfo>(
+ "EthereumERC7730DisplayFormatInfo",
+ fields,
+ oneofs,
+ )
+ }
+}
+
+impl ::protobuf::Message for EthereumERC7730DisplayFormatInfo {
+ const NAME: &'static str = "EthereumERC7730DisplayFormatInfo";
+
+ fn is_initialized(&self) -> bool {
+ if self.chain_id.is_none() {
+ return false;
+ }
+ if self.address.is_none() {
+ return false;
+ }
+ if self.func_sig.is_none() {
+ return false;
+ }
+ if self.intent.is_none() {
+ return false;
+ }
+ for v in &self.parameter_definitions {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ for v in &self.field_definitions {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
+ while let Some(tag) = is.read_raw_tag_or_eof()? {
+ match tag {
+ 8 => {
+ self.chain_id = ::std::option::Option::Some(is.read_uint64()?);
+ },
+ 18 => {
+ self.address = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 26 => {
+ self.func_sig = ::std::option::Option::Some(is.read_bytes()?);
+ },
+ 34 => {
+ self.intent = ::std::option::Option::Some(is.read_string()?);
+ },
+ 42 => {
+ self.parameter_definitions.push(is.read_message()?);
+ },
+ 50 => {
+ self.field_definitions.push(is.read_message()?);
+ },
+ tag => {
+ ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u64 {
+ let mut my_size = 0;
+ if let Some(v) = self.chain_id {
+ my_size += ::protobuf::rt::uint64_size(1, v);
+ }
+ if let Some(v) = self.address.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ if let Some(v) = self.func_sig.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
+ }
+ if let Some(v) = self.intent.as_ref() {
+ my_size += ::protobuf::rt::string_size(4, &v);
+ }
+ for value in &self.parameter_definitions {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ };
+ for value in &self.field_definitions {
+ let len = value.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
+ };
+ my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
+ self.special_fields.cached_size().set(my_size as u32);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
+ if let Some(v) = self.chain_id {
+ os.write_uint64(1, v)?;
+ }
+ if let Some(v) = self.address.as_ref() {
+ os.write_bytes(2, v)?;
+ }
+ if let Some(v) = self.func_sig.as_ref() {
+ os.write_bytes(3, v)?;
+ }
+ if let Some(v) = self.intent.as_ref() {
+ os.write_string(4, v)?;
+ }
+ for v in &self.parameter_definitions {
+ ::protobuf::rt::write_message_field_with_cached_size(5, v, os)?;
+ };
+ for v in &self.field_definitions {
+ ::protobuf::rt::write_message_field_with_cached_size(6, v, os)?;
+ };
+ os.write_unknown_fields(self.special_fields.unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn special_fields(&self) -> &::protobuf::SpecialFields {
+ &self.special_fields
+ }
+
+ fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
+ &mut self.special_fields
+ }
+
+ fn new() -> EthereumERC7730DisplayFormatInfo {
+ EthereumERC7730DisplayFormatInfo::new()
+ }
+
+ fn clear(&mut self) {
+ self.chain_id = ::std::option::Option::None;
+ self.address = ::std::option::Option::None;
+ self.func_sig = ::std::option::Option::None;
+ self.intent = ::std::option::Option::None;
+ self.parameter_definitions.clear();
+ self.field_definitions.clear();
+ self.special_fields.clear();
+ }
+
+ fn default_instance() -> &'static EthereumERC7730DisplayFormatInfo {
+ static instance: EthereumERC7730DisplayFormatInfo = EthereumERC7730DisplayFormatInfo {
+ chain_id: ::std::option::Option::None,
+ address: ::std::option::Option::None,
+ func_sig: ::std::option::Option::None,
+ intent: ::std::option::Option::None,
+ parameter_definitions: ::std::vec::Vec::new(),
+ field_definitions: ::std::vec::Vec::new(),
+ special_fields: ::protobuf::SpecialFields::new(),
+ };
+ &instance
+ }
+}
+
+impl ::protobuf::MessageFull for EthereumERC7730DisplayFormatInfo {
+ fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().message_by_package_relative_name("EthereumERC7730DisplayFormatInfo").unwrap()).clone()
+ }
+}
+
+impl ::std::fmt::Display for EthereumERC7730DisplayFormatInfo {
+ fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
+ ::protobuf::text_format::fmt(self, f)
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for EthereumERC7730DisplayFormatInfo {
+ type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
+}
+
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
// @@protoc_insertion_point(enum:hw.trezor.messages.definitions.DefinitionType)
pub enum DefinitionType {
@@ -961,6 +2326,8 @@ pub enum DefinitionType {
ETHEREUM_TOKEN = 1,
// @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.DefinitionType.SOLANA_TOKEN)
SOLANA_TOKEN = 2,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.DefinitionType.ETHEREUM_ERC7730_DISPLAY_FORMAT)
+ ETHEREUM_ERC7730_DISPLAY_FORMAT = 3,
}
impl ::protobuf::Enum for DefinitionType {
@@ -975,6 +2342,7 @@ impl ::protobuf::Enum for DefinitionType {
0 => ::std::option::Option::Some(DefinitionType::ETHEREUM_NETWORK),
1 => ::std::option::Option::Some(DefinitionType::ETHEREUM_TOKEN),
2 => ::std::option::Option::Some(DefinitionType::SOLANA_TOKEN),
+ 3 => ::std::option::Option::Some(DefinitionType::ETHEREUM_ERC7730_DISPLAY_FORMAT),
_ => ::std::option::Option::None
}
}
@@ -984,6 +2352,7 @@ impl ::protobuf::Enum for DefinitionType {
"ETHEREUM_NETWORK" => ::std::option::Option::Some(DefinitionType::ETHEREUM_NETWORK),
"ETHEREUM_TOKEN" => ::std::option::Option::Some(DefinitionType::ETHEREUM_TOKEN),
"SOLANA_TOKEN" => ::std::option::Option::Some(DefinitionType::SOLANA_TOKEN),
+ "ETHEREUM_ERC7730_DISPLAY_FORMAT" => ::std::option::Option::Some(DefinitionType::ETHEREUM_ERC7730_DISPLAY_FORMAT),
_ => ::std::option::Option::None
}
}
@@ -992,6 +2361,7 @@ impl ::protobuf::Enum for DefinitionType {
DefinitionType::ETHEREUM_NETWORK,
DefinitionType::ETHEREUM_TOKEN,
DefinitionType::SOLANA_TOKEN,
+ DefinitionType::ETHEREUM_ERC7730_DISPLAY_FORMAT,
];
}
@@ -1019,6 +2389,323 @@ impl DefinitionType {
}
}
+#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
+// @@protoc_insertion_point(enum:hw.trezor.messages.definitions.EthereumABIType)
+pub enum EthereumABIType {
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_ADDRESS)
+ ABI_ADDRESS = 0,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT256)
+ ABI_UINT256 = 1,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT248)
+ ABI_UINT248 = 2,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT160)
+ ABI_UINT160 = 3,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT128)
+ ABI_UINT128 = 4,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT120)
+ ABI_UINT120 = 5,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT112)
+ ABI_UINT112 = 6,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT96)
+ ABI_UINT96 = 7,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT72)
+ ABI_UINT72 = 8,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT64)
+ ABI_UINT64 = 9,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT48)
+ ABI_UINT48 = 10,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT40)
+ ABI_UINT40 = 11,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT32)
+ ABI_UINT32 = 12,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT24)
+ ABI_UINT24 = 13,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT16)
+ ABI_UINT16 = 14,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_UINT8)
+ ABI_UINT8 = 15,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BOOL)
+ ABI_BOOL = 16,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_BYTES)
+ ABI_BYTES = 20,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumABIType.ABI_STRING)
+ ABI_STRING = 21,
+}
+
+impl ::protobuf::Enum for EthereumABIType {
+ const NAME: &'static str = "EthereumABIType";
+
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option<EthereumABIType> {
+ match value {
+ 0 => ::std::option::Option::Some(EthereumABIType::ABI_ADDRESS),
+ 1 => ::std::option::Option::Some(EthereumABIType::ABI_UINT256),
+ 2 => ::std::option::Option::Some(EthereumABIType::ABI_UINT248),
+ 3 => ::std::option::Option::Some(EthereumABIType::ABI_UINT160),
+ 4 => ::std::option::Option::Some(EthereumABIType::ABI_UINT128),
+ 5 => ::std::option::Option::Some(EthereumABIType::ABI_UINT120),
+ 6 => ::std::option::Option::Some(EthereumABIType::ABI_UINT112),
+ 7 => ::std::option::Option::Some(EthereumABIType::ABI_UINT96),
+ 8 => ::std::option::Option::Some(EthereumABIType::ABI_UINT72),
+ 9 => ::std::option::Option::Some(EthereumABIType::ABI_UINT64),
+ 10 => ::std::option::Option::Some(EthereumABIType::ABI_UINT48),
+ 11 => ::std::option::Option::Some(EthereumABIType::ABI_UINT40),
+ 12 => ::std::option::Option::Some(EthereumABIType::ABI_UINT32),
+ 13 => ::std::option::Option::Some(EthereumABIType::ABI_UINT24),
+ 14 => ::std::option::Option::Some(EthereumABIType::ABI_UINT16),
+ 15 => ::std::option::Option::Some(EthereumABIType::ABI_UINT8),
+ 16 => ::std::option::Option::Some(EthereumABIType::ABI_BOOL),
+ 20 => ::std::option::Option::Some(EthereumABIType::ABI_BYTES),
+ 21 => ::std::option::Option::Some(EthereumABIType::ABI_STRING),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn from_str(str: &str) -> ::std::option::Option<EthereumABIType> {
+ match str {
+ "ABI_ADDRESS" => ::std::option::Option::Some(EthereumABIType::ABI_ADDRESS),
+ "ABI_UINT256" => ::std::option::Option::Some(EthereumABIType::ABI_UINT256),
+ "ABI_UINT248" => ::std::option::Option::Some(EthereumABIType::ABI_UINT248),
+ "ABI_UINT160" => ::std::option::Option::Some(EthereumABIType::ABI_UINT160),
+ "ABI_UINT128" => ::std::option::Option::Some(EthereumABIType::ABI_UINT128),
+ "ABI_UINT120" => ::std::option::Option::Some(EthereumABIType::ABI_UINT120),
+ "ABI_UINT112" => ::std::option::Option::Some(EthereumABIType::ABI_UINT112),
+ "ABI_UINT96" => ::std::option::Option::Some(EthereumABIType::ABI_UINT96),
+ "ABI_UINT72" => ::std::option::Option::Some(EthereumABIType::ABI_UINT72),
+ "ABI_UINT64" => ::std::option::Option::Some(EthereumABIType::ABI_UINT64),
+ "ABI_UINT48" => ::std::option::Option::Some(EthereumABIType::ABI_UINT48),
+ "ABI_UINT40" => ::std::option::Option::Some(EthereumABIType::ABI_UINT40),
+ "ABI_UINT32" => ::std::option::Option::Some(EthereumABIType::ABI_UINT32),
+ "ABI_UINT24" => ::std::option::Option::Some(EthereumABIType::ABI_UINT24),
+ "ABI_UINT16" => ::std::option::Option::Some(EthereumABIType::ABI_UINT16),
+ "ABI_UINT8" => ::std::option::Option::Some(EthereumABIType::ABI_UINT8),
+ "ABI_BOOL" => ::std::option::Option::Some(EthereumABIType::ABI_BOOL),
+ "ABI_BYTES" => ::std::option::Option::Some(EthereumABIType::ABI_BYTES),
+ "ABI_STRING" => ::std::option::Option::Some(EthereumABIType::ABI_STRING),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ const VALUES: &'static [EthereumABIType] = &[
+ EthereumABIType::ABI_ADDRESS,
+ EthereumABIType::ABI_UINT256,
+ EthereumABIType::ABI_UINT248,
+ EthereumABIType::ABI_UINT160,
+ EthereumABIType::ABI_UINT128,
+ EthereumABIType::ABI_UINT120,
+ EthereumABIType::ABI_UINT112,
+ EthereumABIType::ABI_UINT96,
+ EthereumABIType::ABI_UINT72,
+ EthereumABIType::ABI_UINT64,
+ EthereumABIType::ABI_UINT48,
+ EthereumABIType::ABI_UINT40,
+ EthereumABIType::ABI_UINT32,
+ EthereumABIType::ABI_UINT24,
+ EthereumABIType::ABI_UINT16,
+ EthereumABIType::ABI_UINT8,
+ EthereumABIType::ABI_BOOL,
+ EthereumABIType::ABI_BYTES,
+ EthereumABIType::ABI_STRING,
+ ];
+}
+
+impl ::protobuf::EnumFull for EthereumABIType {
+ fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().enum_by_package_relative_name("EthereumABIType").unwrap()).clone()
+ }
+
+ fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
+ let index = match self {
+ EthereumABIType::ABI_ADDRESS => 0,
+ EthereumABIType::ABI_UINT256 => 1,
+ EthereumABIType::ABI_UINT248 => 2,
+ EthereumABIType::ABI_UINT160 => 3,
+ EthereumABIType::ABI_UINT128 => 4,
+ EthereumABIType::ABI_UINT120 => 5,
+ EthereumABIType::ABI_UINT112 => 6,
+ EthereumABIType::ABI_UINT96 => 7,
+ EthereumABIType::ABI_UINT72 => 8,
+ EthereumABIType::ABI_UINT64 => 9,
+ EthereumABIType::ABI_UINT48 => 10,
+ EthereumABIType::ABI_UINT40 => 11,
+ EthereumABIType::ABI_UINT32 => 12,
+ EthereumABIType::ABI_UINT24 => 13,
+ EthereumABIType::ABI_UINT16 => 14,
+ EthereumABIType::ABI_UINT8 => 15,
+ EthereumABIType::ABI_BOOL => 16,
+ EthereumABIType::ABI_BYTES => 17,
+ EthereumABIType::ABI_STRING => 18,
+ };
+ Self::enum_descriptor().value_by_index(index)
+ }
+}
+
+impl ::std::default::Default for EthereumABIType {
+ fn default() -> Self {
+ EthereumABIType::ABI_ADDRESS
+ }
+}
+
+impl EthereumABIType {
+ fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
+ ::protobuf::reflect::GeneratedEnumDescriptorData::new::<EthereumABIType>("EthereumABIType")
+ }
+}
+
+#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
+// @@protoc_insertion_point(enum:hw.trezor.messages.definitions.EthereumERC7730FieldFormatterType)
+pub enum EthereumERC7730FieldFormatterType {
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730FieldFormatterType.FORMATTER_ADDRESS_NAME)
+ FORMATTER_ADDRESS_NAME = 0,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730FieldFormatterType.FORMATTER_AMOUNT)
+ FORMATTER_AMOUNT = 1,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730FieldFormatterType.FORMATTER_TOKEN_AMOUNT)
+ FORMATTER_TOKEN_AMOUNT = 2,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730FieldFormatterType.FORMATTER_UNIT)
+ FORMATTER_UNIT = 3,
+}
+
+impl ::protobuf::Enum for EthereumERC7730FieldFormatterType {
+ const NAME: &'static str = "EthereumERC7730FieldFormatterType";
+
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option<EthereumERC7730FieldFormatterType> {
+ match value {
+ 0 => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_ADDRESS_NAME),
+ 1 => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_AMOUNT),
+ 2 => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_TOKEN_AMOUNT),
+ 3 => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_UNIT),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn from_str(str: &str) -> ::std::option::Option<EthereumERC7730FieldFormatterType> {
+ match str {
+ "FORMATTER_ADDRESS_NAME" => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_ADDRESS_NAME),
+ "FORMATTER_AMOUNT" => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_AMOUNT),
+ "FORMATTER_TOKEN_AMOUNT" => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_TOKEN_AMOUNT),
+ "FORMATTER_UNIT" => ::std::option::Option::Some(EthereumERC7730FieldFormatterType::FORMATTER_UNIT),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ const VALUES: &'static [EthereumERC7730FieldFormatterType] = &[
+ EthereumERC7730FieldFormatterType::FORMATTER_ADDRESS_NAME,
+ EthereumERC7730FieldFormatterType::FORMATTER_AMOUNT,
+ EthereumERC7730FieldFormatterType::FORMATTER_TOKEN_AMOUNT,
+ EthereumERC7730FieldFormatterType::FORMATTER_UNIT,
+ ];
+}
+
+impl ::protobuf::EnumFull for EthereumERC7730FieldFormatterType {
+ fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().enum_by_package_relative_name("EthereumERC7730FieldFormatterType").unwrap()).clone()
+ }
+
+ fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
+ let index = *self as usize;
+ Self::enum_descriptor().value_by_index(index)
+ }
+}
+
+impl ::std::default::Default for EthereumERC7730FieldFormatterType {
+ fn default() -> Self {
+ EthereumERC7730FieldFormatterType::FORMATTER_ADDRESS_NAME
+ }
+}
+
+impl EthereumERC7730FieldFormatterType {
+ fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
+ ::protobuf::reflect::GeneratedEnumDescriptorData::new::<EthereumERC7730FieldFormatterType>("EthereumERC7730FieldFormatterType")
+ }
+}
+
+#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
+// @@protoc_insertion_point(enum:hw.trezor.messages.definitions.EthereumERC7730ContainerPath)
+pub enum EthereumERC7730ContainerPath {
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730ContainerPath.FROM)
+ FROM = 1,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730ContainerPath.VALUE)
+ VALUE = 2,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730ContainerPath.TO)
+ TO = 3,
+ // @@protoc_insertion_point(enum_value:hw.trezor.messages.definitions.EthereumERC7730ContainerPath.CHAIN_ID)
+ CHAIN_ID = 4,
+}
+
+impl ::protobuf::Enum for EthereumERC7730ContainerPath {
+ const NAME: &'static str = "EthereumERC7730ContainerPath";
+
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option<EthereumERC7730ContainerPath> {
+ match value {
+ 1 => ::std::option::Option::Some(EthereumERC7730ContainerPath::FROM),
+ 2 => ::std::option::Option::Some(EthereumERC7730ContainerPath::VALUE),
+ 3 => ::std::option::Option::Some(EthereumERC7730ContainerPath::TO),
+ 4 => ::std::option::Option::Some(EthereumERC7730ContainerPath::CHAIN_ID),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn from_str(str: &str) -> ::std::option::Option<EthereumERC7730ContainerPath> {
+ match str {
+ "FROM" => ::std::option::Option::Some(EthereumERC7730ContainerPath::FROM),
+ "VALUE" => ::std::option::Option::Some(EthereumERC7730ContainerPath::VALUE),
+ "TO" => ::std::option::Option::Some(EthereumERC7730ContainerPath::TO),
+ "CHAIN_ID" => ::std::option::Option::Some(EthereumERC7730ContainerPath::CHAIN_ID),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ const VALUES: &'static [EthereumERC7730ContainerPath] = &[
+ EthereumERC7730ContainerPath::FROM,
+ EthereumERC7730ContainerPath::VALUE,
+ EthereumERC7730ContainerPath::TO,
+ EthereumERC7730ContainerPath::CHAIN_ID,
+ ];
+}
+
+impl ::protobuf::EnumFull for EthereumERC7730ContainerPath {
+ fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
+ static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
+ descriptor.get(|| file_descriptor().enum_by_package_relative_name("EthereumERC7730ContainerPath").unwrap()).clone()
+ }
+
+ fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
+ let index = match self {
+ EthereumERC7730ContainerPath::FROM => 0,
+ EthereumERC7730ContainerPath::VALUE => 1,
+ EthereumERC7730ContainerPath::TO => 2,
+ EthereumERC7730ContainerPath::CHAIN_ID => 3,
+ };
+ Self::enum_descriptor().value_by_index(index)
+ }
+}
+
+// Note, `Default` is implemented although default value is not 0
+impl ::std::default::Default for EthereumERC7730ContainerPath {
+ fn default() -> Self {
+ EthereumERC7730ContainerPath::FROM
+ }
+}
+
+impl EthereumERC7730ContainerPath {
+ fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
+ ::protobuf::reflect::GeneratedEnumDescriptorData::new::<EthereumERC7730ContainerPath>("EthereumERC7730ContainerPath")
+ }
+}
+
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x1amessages-definitions.proto\x12\x1ehw.trezor.messages.definitions\"\
t\n\x13EthereumNetworkInfo\x12\x19\n\x08chain_id\x18\x01\x20\x02(\x04R\
@@ -1030,10 +2717,52 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x1a\n\x08decimals\x18\x04\x20\x02(\rR\x08decimals\x12\x12\n\x04name\x18\
\x05\x20\x02(\tR\x04name\"Q\n\x0fSolanaTokenInfo\x12\x12\n\x04mint\x18\
\x01\x20\x02(\x0cR\x04mint\x12\x16\n\x06symbol\x18\x02\x20\x02(\tR\x06sy\
- mbol\x12\x12\n\x04name\x18\x03\x20\x02(\tR\x04name*L\n\x0eDefinitionType\
- \x12\x14\n\x10ETHEREUM_NETWORK\x10\0\x12\x12\n\x0eETHEREUM_TOKEN\x10\x01\
- \x12\x10\n\x0cSOLANA_TOKEN\x10\x02B?\n#com.satoshilabs.trezor.lib.protob\
- ufB\x18TrezorMessageDefinitions\
+ mbol\x12\x12\n\x04name\x18\x03\x20\x02(\tR\x04name\"\x83\x01\n\x14Ethere\
+ umABITupleInfo\x12L\n\x06fields\x18\x01\x20\x03(\x0b24.hw.trezor.message\
+ s.definitions.EthereumABIValueInfoR\x06fields\x12\x1d\n\nis_dynamic\x18\
+ \x02\x20\x02(\x08R\tisDynamic\"\xc2\x02\n\x14EthereumABIValueInfo\x12G\n\
+ \x06atomic\x18\x01\x20\x01(\x0e2/.hw.trezor.messages.definitions.Ethereu\
+ mABITypeR\x06atomic\x12I\n\x07dynamic\x18\x02\x20\x01(\x0e2/.hw.trezor.m\
+ essages.definitions.EthereumABITypeR\x07dynamic\x12J\n\x05tuple\x18\x03\
+ \x20\x01(\x0b24.hw.trezor.messages.definitions.EthereumABITupleInfoR\x05\
+ tuple\x12J\n\x05array\x18\x04\x20\x01(\x0b24.hw.trezor.messages.definiti\
+ ons.EthereumABIValueInfoR\x05array\"\x8e\x01\n\x13EthereumERC7730Path\
+ \x12\x12\n\x04path\x18\x01\x20\x03(\rR\x04path\x12c\n\x0econtainer_path\
+ \x18\x02\x20\x01(\x0e2<.hw.trezor.messages.definitions.EthereumERC7730Co\
+ ntainerPathR\rcontainerPath\"\x94\x03\n\x18EthereumERC7730FieldInfo\x12G\
+ \n\x04path\x18\x01\x20\x02(\x0b23.hw.trezor.messages.definitions.Ethereu\
+ mERC7730PathR\x04path\x12\x14\n\x05label\x18\x02\x20\x02(\tR\x05label\
+ \x12_\n\tformatter\x18\x03\x20\x02(\x0e2A.hw.trezor.messages.definitions\
+ .EthereumERC7730FieldFormatterTypeR\tformatter\x12R\n\ntoken_path\x18\
+ \x04\x20\x01(\x0b23.hw.trezor.messages.definitions.EthereumERC7730PathR\
+ \ttokenPath\x12\x1c\n\tthreshold\x18\x05\x20\x01(\x0cR\tthreshold\x12\
+ \x1a\n\x08decimals\x18\x06\x20\x01(\rR\x08decimals\x12\x12\n\x04base\x18\
+ \x07\x20\x01(\tR\x04base\x12\x16\n\x06prefix\x18\x08\x20\x01(\x08R\x06pr\
+ efix\"\xdc\x02\n\x20EthereumERC7730DisplayFormatInfo\x12\x19\n\x08chain_\
+ id\x18\x01\x20\x02(\x04R\x07chainId\x12\x18\n\x07address\x18\x02\x20\x02\
+ (\x0cR\x07address\x12\x19\n\x08func_sig\x18\x03\x20\x02(\x0cR\x07funcSig\
+ \x12\x16\n\x06intent\x18\x04\x20\x02(\tR\x06intent\x12i\n\x15parameter_d\
+ efinitions\x18\x05\x20\x03(\x0b24.hw.trezor.messages.definitions.Ethereu\
+ mABIValueInfoR\x14parameterDefinitions\x12e\n\x11field_definitions\x18\
+ \x06\x20\x03(\x0b28.hw.trezor.messages.definitions.EthereumERC7730FieldI\
+ nfoR\x10fieldDefinitions*q\n\x0eDefinitionType\x12\x14\n\x10ETHEREUM_NET\
+ WORK\x10\0\x12\x12\n\x0eETHEREUM_TOKEN\x10\x01\x12\x10\n\x0cSOLANA_TOKEN\
+ \x10\x02\x12#\n\x1fETHEREUM_ERC7730_DISPLAY_FORMAT\x10\x03*\xc4\x02\n\
+ \x0fEthereumABIType\x12\x0f\n\x0bABI_ADDRESS\x10\0\x12\x0f\n\x0bABI_UINT\
+ 256\x10\x01\x12\x0f\n\x0bABI_UINT248\x10\x02\x12\x0f\n\x0bABI_UINT160\
+ \x10\x03\x12\x0f\n\x0bABI_UINT128\x10\x04\x12\x0f\n\x0bABI_UINT120\x10\
+ \x05\x12\x0f\n\x0bABI_UINT112\x10\x06\x12\x0e\n\nABI_UINT96\x10\x07\x12\
+ \x0e\n\nABI_UINT72\x10\x08\x12\x0e\n\nABI_UINT64\x10\t\x12\x0e\n\nABI_UI\
+ NT48\x10\n\x12\x0e\n\nABI_UINT40\x10\x0b\x12\x0e\n\nABI_UINT32\x10\x0c\
+ \x12\x0e\n\nABI_UINT24\x10\r\x12\x0e\n\nABI_UINT16\x10\x0e\x12\r\n\tABI_\
+ UINT8\x10\x0f\x12\x0c\n\x08ABI_BOOL\x10\x10\x12\r\n\tABI_BYTES\x10\x14\
+ \x12\x0e\n\nABI_STRING\x10\x15*\x85\x01\n!EthereumERC7730FieldFormatterT\
+ ype\x12\x1a\n\x16FORMATTER_ADDRESS_NAME\x10\0\x12\x14\n\x10FORMATTER_AMO\
+ UNT\x10\x01\x12\x1a\n\x16FORMATTER_TOKEN_AMOUNT\x10\x02\x12\x12\n\x0eFOR\
+ MATTER_UNIT\x10\x03*I\n\x1cEthereumERC7730ContainerPath\x12\x08\n\x04FRO\
+ M\x10\x01\x12\t\n\x05VALUE\x10\x02\x12\x06\n\x02TO\x10\x03\x12\x0c\n\x08\
+ CHAIN_ID\x10\x04B?\n#com.satoshilabs.trezor.lib.protobufB\x18TrezorMessa\
+ geDefinitions\
";
/// `FileDescriptorProto` object which was a source for this generated file
@@ -1051,12 +2780,20 @@ pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
file_descriptor.get(|| {
let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
let mut deps = ::std::vec::Vec::with_capacity(0);
- let mut messages = ::std::vec::Vec::with_capacity(3);
+ let mut messages = ::std::vec::Vec::with_capacity(8);
messages.push(EthereumNetworkInfo::generated_message_descriptor_data());
messages.push(EthereumTokenInfo::generated_message_descriptor_data());
messages.push(SolanaTokenInfo::generated_message_descriptor_data());
- let mut enums = ::std::vec::Vec::with_capacity(1);
+ messages.push(EthereumABITupleInfo::generated_message_descriptor_data());
+ messages.push(EthereumABIValueInfo::generated_message_descriptor_data());
+ messages.push(EthereumERC7730Path::generated_message_descriptor_data());
+ messages.push(EthereumERC7730FieldInfo::generated_message_descriptor_data());
+ messages.push(EthereumERC7730DisplayFormatInfo::generated_message_descriptor_data());
+ let mut enums = ::std::vec::Vec::with_capacity(4);
enums.push(DefinitionType::generated_enum_descriptor_data());
+ enums.push(EthereumABIType::generated_enum_descriptor_data());
+ enums.push(EthereumERC7730FieldFormatterType::generated_enum_descriptor_data());
+ enums.push(EthereumERC7730ContainerPath::generated_enum_descriptor_data());
::protobuf::reflect::GeneratedFileDescriptor::new_generated(
file_descriptor_proto(),
deps,
diff --git a/rust/trezor-client/src/protos/generated/messages_ethereum.rs b/rust/trezor-client/src/protos/generated/messages_ethereum.rs
index c965323b..21e98976 100644
--- a/rust/trezor-client/src/protos/generated/messages_ethereum.rs
+++ b/rust/trezor-client/src/protos/generated/messages_ethereum.rs
@@ -4200,8 +4200,10 @@ pub struct EthereumDefinitions {
// message fields
// @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumDefinitions.encoded_network)
pub encoded_network: ::std::option::Option<::std::vec::Vec<u8>>,
- // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumDefinitions.encoded_token)
- pub encoded_token: ::std::option::Option<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumDefinitions.encoded_tokens)
+ pub encoded_tokens: ::std::vec::Vec<::std::vec::Vec<u8>>,
+ // @@protoc_insertion_point(field:hw.trezor.messages.ethereum.EthereumDefinitions.encoded_erc7730_display_format)
+ pub encoded_erc7730_display_format: ::std::option::Option<::std::vec::Vec<u8>>,
// special fields
// @@protoc_insertion_point(special_field:hw.trezor.messages.ethereum.EthereumDefinitions.special_fields)
pub special_fields: ::protobuf::SpecialFields,
@@ -4254,54 +4256,59 @@ impl EthereumDefinitions {
self.encoded_network.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
- // optional bytes encoded_token = 2;
+ // optional bytes encoded_erc7730_display_format = 3;
- pub fn encoded_token(&self) -> &[u8] {
- match self.encoded_token.as_ref() {
+ pub fn encoded_erc7730_display_format(&self) -> &[u8] {
+ match self.encoded_erc7730_display_format.as_ref() {
Some(v) => v,
None => &[],
}
}
- pub fn clear_encoded_token(&mut self) {
- self.encoded_token = ::std::option::Option::None;
+ pub fn clear_encoded_erc7730_display_format(&mut self) {
+ self.encoded_erc7730_display_format = ::std::option::Option::None;
}
- pub fn has_encoded_token(&self) -> bool {
- self.encoded_token.is_some()
+ pub fn has_encoded_erc7730_display_format(&self) -> bool {
+ self.encoded_erc7730_display_format.is_some()
}
// Param is passed by value, moved
- pub fn set_encoded_token(&mut self, v: ::std::vec::Vec<u8>) {
- self.encoded_token = ::std::option::Option::Some(v);
+ pub fn set_encoded_erc7730_display_format(&mut self, v: ::std::vec::Vec<u8>) {
+ self.encoded_erc7730_display_format = ::std::option::Option::Some(v);
}
// Mutable pointer to the field.
// If field is not initialized, it is initialized with default value first.
- pub fn mut_encoded_token(&mut self) -> &mut ::std::vec::Vec<u8> {
- if self.encoded_token.is_none() {
- self.encoded_token = ::std::option::Option::Some(::std::vec::Vec::new());
+ pub fn mut_encoded_erc7730_display_format(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.encoded_erc7730_display_format.is_none() {
+ self.encoded_erc7730_display_format = ::std::option::Option::Some(::std::vec::Vec::new());
}
- self.encoded_token.as_mut().unwrap()
+ self.encoded_erc7730_display_format.as_mut().unwrap()
}
// Take field
- pub fn take_encoded_token(&mut self) -> ::std::vec::Vec<u8> {
- self.encoded_token.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ pub fn take_encoded_erc7730_display_format(&mut self) -> ::std::vec::Vec<u8> {
+ self.encoded_erc7730_display_format.take().unwrap_or_else(|| ::std::vec::Vec::new())
}
fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
- let mut fields = ::std::vec::Vec::with_capacity(2);
+ let mut fields = ::std::vec::Vec::with_capacity(3);
let mut oneofs = ::std::vec::Vec::with_capacity(0);
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
"encoded_network",
|m: &EthereumDefinitions| { &m.encoded_network },
|m: &mut EthereumDefinitions| { &mut m.encoded_network },
));
+ fields.push(::protobuf::reflect::rt::v2::make_vec_simpler_accessor::<_, _>(
+ "encoded_tokens",
+ |m: &EthereumDefinitions| { &m.encoded_tokens },
+ |m: &mut EthereumDefinitions| { &mut m.encoded_tokens },
+ ));
fields.push(::protobuf::reflect::rt::v2::make_option_accessor::<_, _>(
- "encoded_token",
- |m: &EthereumDefinitions| { &m.encoded_token },
- |m: &mut EthereumDefinitions| { &mut m.encoded_token },
+ "encoded_erc7730_display_format",
+ |m: &EthereumDefinitions| { &m.encoded_erc7730_display_format },
+ |m: &mut EthereumDefinitions| { &mut m.encoded_erc7730_display_format },
));
::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<EthereumDefinitions>(
"EthereumDefinitions",
@@ -4325,7 +4332,10 @@ impl ::protobuf::Message for EthereumDefinitions {
self.encoded_network = ::std::option::Option::Some(is.read_bytes()?);
},
18 => {
- self.encoded_token = ::std::option::Option::Some(is.read_bytes()?);
+ self.encoded_tokens.push(is.read_bytes()?);
+ },
+ 26 => {
+ self.encoded_erc7730_display_format = ::std::option::Option::Some(is.read_bytes()?);
},
tag => {
::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
@@ -4342,8 +4352,11 @@ impl ::protobuf::Message for EthereumDefinitions {
if let Some(v) = self.encoded_network.as_ref() {
my_size += ::protobuf::rt::bytes_size(1, &v);
}
- if let Some(v) = self.encoded_token.as_ref() {
- my_size += ::protobuf::rt::bytes_size(2, &v);
+ for value in &self.encoded_tokens {
+ my_size += ::protobuf::rt::bytes_size(2, &value);
+ };
+ if let Some(v) = self.encoded_erc7730_display_format.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
}
my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
self.special_fields.cached_size().set(my_size as u32);
@@ -4354,8 +4367,11 @@ impl ::protobuf::Message for EthereumDefinitions {
if let Some(v) = self.encoded_network.as_ref() {
os.write_bytes(1, v)?;
}
- if let Some(v) = self.encoded_token.as_ref() {
- os.write_bytes(2, v)?;
+ for v in &self.encoded_tokens {
+ os.write_bytes(2, &v)?;
+ };
+ if let Some(v) = self.encoded_erc7730_display_format.as_ref() {
+ os.write_bytes(3, v)?;
}
os.write_unknown_fields(self.special_fields.unknown_fields())?;
::std::result::Result::Ok(())
@@ -4375,14 +4391,16 @@ impl ::protobuf::Message for EthereumDefinitions {
fn clear(&mut self) {
self.encoded_network = ::std::option::Option::None;
- self.encoded_token = ::std::option::Option::None;
+ self.encoded_tokens.clear();
+ self.encoded_erc7730_display_format = ::std::option::Option::None;
self.special_fields.clear();
}
fn default_instance() -> &'static EthereumDefinitions {
static instance: EthereumDefinitions = EthereumDefinitions {
encoded_network: ::std::option::Option::None,
- encoded_token: ::std::option::Option::None,
+ encoded_tokens: ::std::vec::Vec::new(),
+ encoded_erc7730_display_format: ::std::option::Option::None,
special_fields: ::protobuf::SpecialFields::new(),
};
&instance
@@ -4466,10 +4484,12 @@ static file_descriptor_proto_data: &'static [u8] = b"\
\x12!\n\x0cmessage_hash\x18\x03\x20\x01(\x0cR\x0bmessageHash\x12'\n\x0fe\
ncoded_network\x18\x04\x20\x01(\x0cR\x0eencodedNetwork\"T\n\x1aEthereumT\
ypedDataSignature\x12\x1c\n\tsignature\x18\x01\x20\x02(\x0cR\tsignature\
- \x12\x18\n\x07address\x18\x02\x20\x02(\tR\x07address\"c\n\x13EthereumDef\
- initions\x12'\n\x0fencoded_network\x18\x01\x20\x01(\x0cR\x0eencodedNetwo\
- rk\x12#\n\rencoded_token\x18\x02\x20\x01(\x0cR\x0cencodedTokenB<\n#com.s\
- atoshilabs.trezor.lib.protobufB\x15TrezorMessageEthereum\
+ \x12\x18\n\x07address\x18\x02\x20\x02(\tR\x07address\"\xaa\x01\n\x13Ethe\
+ reumDefinitions\x12'\n\x0fencoded_network\x18\x01\x20\x01(\x0cR\x0eencod\
+ edNetwork\x12%\n\x0eencoded_tokens\x18\x02\x20\x03(\x0cR\rencodedTokens\
+ \x12C\n\x1eencoded_erc7730_display_format\x18\x03\x20\x01(\x0cR\x1bencod\
+ edErc7730DisplayFormatB<\n#com.satoshilabs.trezor.lib.protobufB\x15Trezo\
+ rMessageEthereum\
";
/// `FileDescriptorProto` object which was a source for this generated file
diff --git a/tests/definitions.py b/tests/definitions.py
index 1af2bae9..2a52df43 100644
--- a/tests/definitions.py
+++ b/tests/definitions.py
@@ -128,7 +128,7 @@ def make_eth_defs(
) -> messages.EthereumDefinitions:
return messages.EthereumDefinitions(
encoded_network=network,
- encoded_token=token,
+ encoded_tokens=[token] if token is not None else [],
)
Why this scored 38/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.