-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathmessages-cosmos.proto
114 lines (99 loc) · 3.07 KB
/
messages-cosmos.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
syntax = "proto2";
/**
* WARNING: Make sure Cosmos messages align with the tendermint messages
*/
// Sugar for easier handling in Java
option java_package = "com.keepkey.deviceprotocol";
option java_outer_classname = "KeepKeyMessageCosmos";
import "types.proto";
/**
* Request: Address at the specified index
* @start
* @next CosmosAddress
*/
message CosmosGetAddress {
repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other
// wallets, must be m/44'/148'/index'
optional bool show_display =
2; // optionally show on display before sending the result
}
/**
* Response: Address for the given index
* @end
*/
message CosmosAddress {
optional string address = 1; // Address Bech32 encoded with 'cosmos' prefix
}
/**
* Request: ask device to sign Cosmos transaction
* @start
* @next CosmosSignedTx
*/
message CosmosSignTx {
repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other
// wallets, must be m/44'/118'/index'/0/0
optional uint64 account_number = 2 [ jstype = JS_STRING ];
optional string chain_id = 3;
optional uint32 fee_amount = 4;
optional uint32 gas = 5;
optional string memo = 6;
optional uint64 sequence = 7 [ jstype = JS_STRING ];
optional uint32 msg_count = 8;
}
message CosmosMsgRequest {}
message CosmosMsgAck {
optional CosmosMsgSend send = 1;
optional CosmosMsgDelegate delegate = 2;
optional CosmosMsgUndelegate undelegate = 3;
optional CosmosMsgRedelegate redelegate = 4;
optional CosmosMsgRewards rewards = 5;
optional CosmosMsgIBCTransfer ibc_transfer = 6;
}
message CosmosMsgSend {
optional string from_address = 6;
optional string to_address = 7;
optional uint64 amount = 8 [jstype = JS_STRING];
optional OutputAddressType address_type = 9;
reserved 10;
}
message CosmosMsgDelegate {
optional string delegator_address = 1;
optional string validator_address = 2;
optional uint64 amount = 3 [ jstype = JS_STRING ];
}
message CosmosMsgUndelegate {
optional string delegator_address = 1;
optional string validator_address = 2;
optional uint64 amount = 3 [ jstype = JS_STRING ];
}
message CosmosMsgRedelegate {
optional string delegator_address = 1;
optional string validator_src_address = 2;
optional string validator_dst_address = 3;
optional uint64 amount = 4 [ jstype = JS_STRING ];
}
message CosmosMsgRewards {
optional string delegator_address = 1;
optional string validator_address = 2;
optional uint64 amount = 3 [ jstype = JS_STRING ];
}
message CosmosMsgIBCTransfer {
optional string receiver = 1;
optional string sender = 2;
optional string source_channel = 3;
optional string source_port = 4;
optional string revision_height = 5;
optional string revision_number = 6;
optional string denom = 7;
optional uint64 amount = 8;
}
/**
* Response: signature for transaction
* @end
*/
message CosmosSignedTx {
optional bytes public_key =
1; // public key for the private key used to sign data
optional bytes signature =
2; // signature suitable for sending to the Cosmos network
}