/
Cosmos.proto
90 lines (77 loc) · 1.98 KB
/
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
syntax = "proto3";
package TW.Cosmos.Proto;
option java_package = "wallet.core.jni.proto";
// Amount
message Amount {
string denom = 1;
int64 amount = 2;
}
// Fee
message Fee {
repeated Amount amounts = 1;
uint64 gas = 2;
}
// Message for sending coins.
message SendCoinsMessage {
string from_address = 1;
string to_address = 2;
repeated Amount amounts = 3;
// default is cosmos-sdk/MsgSend
string type_prefix = 4;
}
// Message for staking.
message StakeMessage {
string delegator_address = 1;
string validator_address = 2;
Amount amount = 3;
// cosmos-sdk/MsgDelegate to stake and cosmos-sdk/MsgUndelegate to unstake
string type_prefix = 4;
}
// Message for staking.
message WithdrawStakeRewardMessage {
string delegator_address = 1;
string validator_address = 2;
// default is cosmos-sdk/MsgWithdrawDelegationReward
string type_prefix = 3;
}
// Signature
message Signature {
bytes public_key = 1;
bytes signature = 2;
}
// Transaction
message Transaction {
Fee fee = 1;
string memo = 2;
Signature signature = 3;
oneof message_oneof {
SendCoinsMessage send_coins_message = 4;
StakeMessage stake_message = 5;
StakeMessage unstake_message = 6;
WithdrawStakeRewardMessage withdraw_stake_reward_message = 7;
}
}
// Input data necessary to create a signed order.
message SigningInput {
uint64 account_number = 1;
string chain_id = 2;
Fee fee = 3;
string memo = 4;
uint64 sequence = 5;
bytes private_key = 6;
oneof message_oneof {
SendCoinsMessage send_coins_message = 7;
StakeMessage stake_message = 8;
StakeMessage unstake_message = 9;
WithdrawStakeRewardMessage withdraw_stake_reward_message = 10;
}
// default is cosmos-sdk/MsgSend
string type_prefix = 11;
}
// Transaction signing output.
message SigningOutput {
// Signature
bytes signature = 1;
// Signed transaction in JSON.
string json = 2;
}