-
-
Notifications
You must be signed in to change notification settings - Fork 663
/
messages-ethereum-definitions.proto
60 lines (54 loc) · 1.83 KB
/
messages-ethereum-definitions.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
syntax = "proto2";
package hw.trezor.messages.ethereum_definitions;
// Sugar for easier handling in Java
option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageEthereumDefinitions";
/**
* Ethereum definitions type enum.
* Used to check the encoded EthereumNetworkInfo or EthereumTokenInfo message.
*/
enum EthereumDefinitionType {
NETWORK = 0;
TOKEN = 1;
}
/**
* Ethereum network definition. Used to (de)serialize the definition.
*
* Definition types should not be cross-parseable, i.e., it should not be possible to
* incorrectly parse network info as token info or vice versa.
* To achieve that, the first field is wire type varint while the second field is wire type
* length-delimited. Both are a mismatch for the token definition.
*
* @embed
*/
message EthereumNetworkInfo {
required uint64 chain_id = 1;
required string symbol = 2;
required uint32 slip44 = 3;
required string name = 4;
}
/**
* Ethereum token definition. Used to (de)serialize the definition.
*
* Definition types should not be cross-parseable, i.e., it should not be possible to
* incorrectly parse network info as token info or vice versa.
* To achieve that, the first field is wire type length-delimited while the second field
* is wire type varint. Both are a mismatch for the network definition.
*
* @embed
*/
message EthereumTokenInfo {
required bytes address = 1;
required uint64 chain_id = 2;
required string symbol = 3;
required uint32 decimals = 4;
required string name = 5;
}
/**
* Contains an encoded Ethereum network and/or token definition. See ethereum-definitions.md for details.
* @embed
*/
message EthereumDefinitions {
optional bytes encoded_network = 1; // encoded Ethereum network
optional bytes encoded_token = 2; // encoded Ethereum token
}