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
Addressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ButtonAck
-
The
ButtonAckprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - 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
Cancelprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EndSession
-
The
EndSessionprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumAccessListEntry
- EthereumAddress
-
The
EthereumAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - 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
EthereumGetAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumGetPublicKey
-
The
EthereumGetPublicKeyprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumMessageSignature
-
The
EthereumMessageSignatureprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumPublicKey
-
The
EthereumPublicKeyprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumSignMessage
-
The
EthereumSignMessageprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumSignTx
- Legacy (type 0) and EIP-2930-less transactions.
- EthereumSignTxEip1559
-
The
EthereumSignTxEip1559protobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumSignTypedHash
-
EIP-712 by hash. Models with a screen that can parse typed data also
support the structured
EthereumSignTypedDataflow; the hash variant works on all of them (Model One requires it). - EthereumTxAck
-
The
EthereumTxAckprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - EthereumTxRequest
- Either a request for the next dataLength bytes of calldata, or — once signatureR is present — the final signature.
- EthereumTypedDataSignature
-
The
EthereumTypedDataSignatureprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - Failure
-
The
Failureprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - Features
-
The subset of
Featuresa wallet needs. Field numbers followmessages-management.proto. - GetAddress
-
The
GetAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - GetFeatures
-
The
GetFeaturesprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - GetPublicKey
-
The
GetPublicKeyprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - HDNodeType
- Initialize
- Codec v1 session start/resume. Answered with Features.
- LockDevice
-
The
LockDeviceprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - MessageType
-
Wire type identifiers (
MessageType_*). - PassphraseAck
-
The
PassphraseAckprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - PassphraseRequest
-
The
PassphraseRequestprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - Ping
-
The
Pingprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - PinMatrixAck
-
The
PinMatrixAckprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - 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
PublicKeyprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - SolanaAddress
-
The
SolanaAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - SolanaGetAddress
-
The
SolanaGetAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - SolanaGetPublicKey
-
The
SolanaGetPublicKeyprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - SolanaPublicKey
-
The
SolanaPublicKeyprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - SolanaSignTx
-
The
SolanaSignTxprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - SolanaTxSignature
-
The
SolanaTxSignatureprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - Success
-
The
Successprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCodeEntryChallenge
-
The
ThpCodeEntryChallengeprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCodeEntryCommitment
-
The
ThpCodeEntryCommitmentprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCodeEntryCpaceHostTag
-
The
ThpCodeEntryCpaceHostTagprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCodeEntryCpaceTrezor
-
The
ThpCodeEntryCpaceTrezorprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCodeEntrySecret
-
The
ThpCodeEntrySecretprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCreateNewSession
-
Opens a seeded session on the session id it is sent on. Answered with
Successonce the seed (and passphrase wallet) has been derived. - ThpCredentialRequest
-
The
ThpCredentialRequestprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpCredentialResponse
-
The
ThpCredentialResponseprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - 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
ThpEndRequestprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpEndResponse
-
The
ThpEndResponseprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpHandshakeCompletionReqNoisePayload
-
The encrypted payload of
HandshakeCompletionRequest. Also not a wire message. - ThpPairingMethod
-
ThpPairingMethod. - ThpPairingPreparationsFinished
-
The
ThpPairingPreparationsFinishedprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpPairingRequest
-
The
ThpPairingRequestprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpPairingRequestApproved
-
The
ThpPairingRequestApprovedprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - ThpSelectMethod
-
The
ThpSelectMethodprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - 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
TronAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - TronContractMessage
-
Any other supported Tron contract (staking, voting, delegation,
withdrawals), carried as its already-encoded protobuf body. Built by
TrezorTron.tronSignRawTransactionfrom TronGridraw_data. - TronContractRequest
- The device is ready for the contract message.
- TronGetAddress
-
The
TronGetAddressprotobuf message; field numbers follow the Trezor firmware.protodefinitions. - 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