messages library

Protobuf message classes, for sending requests the chain helpers in package:trezor_flutter/trezor_flutter.dart do not cover:

import 'package:trezor_flutter/messages.dart' as msg;

final pong = await trezor.callExpect<msg.Success>(msg.Ping(message: 'hi'));

Kept out of the main library because several names (EthereumAddress, PublicKey, Address, …) are generic enough to clash with other packages; import this one with a prefix.

Classes

Address
The Address protobuf message; field numbers follow the Trezor firmware .proto definitions.
ButtonAck
The ButtonAck protobuf message; field numbers follow the Trezor firmware .proto definitions.
ButtonRequest
The device is waiting for the user to act on its screen. The host answers with ButtonAck straight away; the user's decision arrives as the next message.
ButtonRequestType
ButtonRequest.ButtonRequestType.
Cancel
The Cancel protobuf message; field numbers follow the Trezor firmware .proto definitions.
EndSession
The EndSession protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumAccessListEntry
EthereumAddress
The EthereumAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumDefinitions
Signed network/token definitions from data.trezor.io, needed for the device to name chains and tokens it does not have built in.
EthereumGetAddress
The EthereumGetAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumGetPublicKey
The EthereumGetPublicKey protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumMessageSignature
The EthereumMessageSignature protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumPublicKey
The EthereumPublicKey protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumSignMessage
The EthereumSignMessage protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumSignTx
Legacy (type 0) and EIP-2930-less transactions.
EthereumSignTxEip1559
The EthereumSignTxEip1559 protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumSignTypedHash
EIP-712 by hash. Models with a screen that can parse typed data also support the structured EthereumSignTypedData flow; the hash variant works on all of them (Model One requires it).
EthereumTxAck
The EthereumTxAck protobuf message; field numbers follow the Trezor firmware .proto definitions.
EthereumTxRequest
Either a request for the next dataLength bytes of calldata, or — once signatureR is present — the final signature.
EthereumTypedDataSignature
The EthereumTypedDataSignature protobuf message; field numbers follow the Trezor firmware .proto definitions.
Failure
The Failure protobuf message; field numbers follow the Trezor firmware .proto definitions.
Features
The subset of Features a wallet needs. Field numbers follow messages-management.proto.
GetAddress
The GetAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
GetFeatures
The GetFeatures protobuf message; field numbers follow the Trezor firmware .proto definitions.
GetPublicKey
The GetPublicKey protobuf message; field numbers follow the Trezor firmware .proto definitions.
HDNodeType
Initialize
Codec v1 session start/resume. Answered with Features.
LockDevice
The LockDevice protobuf message; field numbers follow the Trezor firmware .proto definitions.
MessageType
Wire type identifiers (MessageType_*).
PassphraseAck
The PassphraseAck protobuf message; field numbers follow the Trezor firmware .proto definitions.
PassphraseRequest
The PassphraseRequest protobuf message; field numbers follow the Trezor firmware .proto definitions.
Ping
The Ping protobuf message; field numbers follow the Trezor firmware .proto definitions.
PinMatrixAck
The PinMatrixAck protobuf message; field numbers follow the Trezor firmware .proto definitions.
PinMatrixRequest
Trezor Model One only: the device shows a scrambled 3×3 grid and the host sends back grid positions, never the PIN digits themselves. Touchscreen models take the PIN on the device and never send this.
PinMatrixRequestType
PinMatrixRequest.PinMatrixRequestType.
PublicKey
The PublicKey protobuf message; field numbers follow the Trezor firmware .proto definitions.
SolanaAddress
The SolanaAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
SolanaGetAddress
The SolanaGetAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
SolanaGetPublicKey
The SolanaGetPublicKey protobuf message; field numbers follow the Trezor firmware .proto definitions.
SolanaPublicKey
The SolanaPublicKey protobuf message; field numbers follow the Trezor firmware .proto definitions.
SolanaSignTx
The SolanaSignTx protobuf message; field numbers follow the Trezor firmware .proto definitions.
SolanaTxSignature
The SolanaTxSignature protobuf message; field numbers follow the Trezor firmware .proto definitions.
Success
The Success protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCodeEntryChallenge
The ThpCodeEntryChallenge protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCodeEntryCommitment
The ThpCodeEntryCommitment protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCodeEntryCpaceHostTag
The ThpCodeEntryCpaceHostTag protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCodeEntryCpaceTrezor
The ThpCodeEntryCpaceTrezor protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCodeEntrySecret
The ThpCodeEntrySecret protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCreateNewSession
Opens a seeded session on the session id it is sent on. Answered with Success once the seed (and passphrase wallet) has been derived.
ThpCredentialRequest
The ThpCredentialRequest protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpCredentialResponse
The ThpCredentialResponse protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpDeviceProperties
Sent by the device in ChannelAllocationResponse. Not a wire message: it has no type id and is carried raw after the nonce and channel id. The raw bytes are also the Noise prologue, so they are kept alongside.
ThpEndRequest
The ThpEndRequest protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpEndResponse
The ThpEndResponse protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpHandshakeCompletionReqNoisePayload
The encrypted payload of HandshakeCompletionRequest. Also not a wire message.
ThpPairingMethod
ThpPairingMethod.
ThpPairingPreparationsFinished
The ThpPairingPreparationsFinished protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpPairingRequest
The ThpPairingRequest protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpPairingRequestApproved
The ThpPairingRequestApproved protobuf message; field numbers follow the Trezor firmware .proto definitions.
ThpSelectMethod
The ThpSelectMethod protobuf message; field numbers follow the Trezor firmware .proto definitions.
TrezorCapability
Features.Capability.
TrezorMessage
A protobuf message that travels on the wire, tagged with its numeric type from messages.proto / messages-thp.proto.
TronAddress
The TronAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
TronContractMessage
Any other supported Tron contract (staking, voting, delegation, withdrawals), carried as its already-encoded protobuf body. Built by TrezorTron.tronSignRawTransaction from TronGrid raw_data.
TronContractRequest
The device is ready for the contract message.
TronGetAddress
The TronGetAddress protobuf message; field numbers follow the Trezor firmware .proto definitions.
TronSignature
65 bytes: r ‖ s ‖ v, with v = 27 or 28.
TronSignTx
Starts Tron signing with the contract-agnostic transaction fields. The device answers with TronContractRequest, then takes one contract message (e.g. TronTransferContract) and returns TronSignature.
TronTransferContract
Native TRX transfer. Addresses are 21 raw bytes (0x41 + 20).
TronTriggerSmartContract
Smart-contract call, e.g. a TRC-20 transfer. TRC-10 is not supported.
UnknownMessage
A response whose type this package does not model. Callers that need it can decode payload themselves with ProtoFields.decode.

Enums

BitcoinScriptType
InputScriptType: which address/xpub flavour to derive.

Functions

decodeTrezorMessage(int type, Uint8List payload) → TrezorMessage