feat: add tokenTicker and chainId calldata formatters - #319
Merged
Conversation
…ersion Map the ERC-7730 v2 tokenTicker field format to the PARAM_TOKEN TLV struct. tokenTicker parameters (chainId/chainIdPath) are optional per schema and are not encodable in PARAM_TOKEN, so they are ignored with a warning.
…sion Map the ERC-7730 v2 chainId field format to the PARAM_NETWORK TLV struct (ParamType 0x0b). The field value references the chain ID; the device resolves the network name and falls back to the raw chain ID if unknown.
ckorchane-ledger
approved these changes
Aug 6, 2026
fsamier
enabled auto-merge (squash)
August 6, 2026 11:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements two new ERC-7730 v2 field formatters in the calldata (TLV) conversion path, mapping them to the corresponding app-ethereum generic parser structs:
tokenTicker→PARAM_TOKEN(ParamType0x0a): the field value is the token address; the device resolves the ticker.chainId→PARAM_NETWORK(ParamType0x0b): the field value references the chain ID; the device resolves the network name and falls back to the raw chain ID if unknown.Both were previously unsupported and fell through to an "Unsupported format" error.
Details
tokenTicker/PARAM_TOKENCalldataDescriptorParamTokenV1model (TOKEN = 0x0A) withnative_currencieskept for TLV fidelity to the struct'sNATIVE_CURRENCYtag (not populated bytokenTicker).tlv_param_tokenencoder and tag enum (VERSION / ADDRESS / NATIVE_CURRENCY).tokenTickerparameters (chainId/chainIdPath) are optional per schema and have no equivalent tag inPARAM_TOKEN, so they are ignored with a warning.tokenTickerparams as optional (previously errored on a bare field).chainId/PARAM_NETWORKCalldataDescriptorParamNetworkV1model (NETWORK = 0x0B).tlv_param_networkencoder and tag enum (VERSION / VALUE).CHAIN_IDcase to the v2 → calldata converter.Testing
PARAM_TYPEtag (0x0a/0x0b) in the TLV output.Reference
Structs follow the app-ethereum TLV spec:
doc/tlv_structs.md.