@@ -8,49 +8,51 @@ import "amino/amino.proto";
8
8
import "cosmos_proto/cosmos.proto" ;
9
9
import "cosmos/base/v1beta1/coin.proto" ;
10
10
11
- // Key message represents a key definition .
11
+ // Key message is used for tracking the status and rewards of the keys .
12
12
message Key {
13
13
option (gogoproto.equal ) = true ;
14
14
15
15
// Name is the name of the key.
16
16
string name = 1 ;
17
17
18
- // Address is the address that holds rewards for this key.
19
- string address = 2 [(cosmos_proto.scalar ) = "cosmos.AddressString" ];
18
+ // PoolAddress is the address that holds rewards for this key.
19
+ string pool_address = 2 [(cosmos_proto.scalar ) = "cosmos.AddressString" ];
20
20
21
21
// IsActive is the status of the key
22
22
bool is_active = 3 ;
23
23
24
- // RewardPerShares is a list of reward_per_share of rewards.
25
- repeated cosmos.base.v1beta1.DecCoin reward_per_shares = 4 [
24
+ // RewardPerPowers is a list of reward_per_power.
25
+ // new_reward_per_power = current_reward_per_power + (rewards / total_power)
26
+ repeated cosmos.base.v1beta1.DecCoin reward_per_powers = 4 [
26
27
(gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.DecCoins" ,
27
28
(gogoproto.nullable ) = false ,
28
29
(amino.dont_omitempty ) = true
29
30
];
30
31
31
- // TotalLock is the total locked power of the key.
32
- string total_lock = 5 [
32
+ // TotalPower is the total locked power of the key.
33
+ string total_power = 5 [
33
34
(cosmos_proto.scalar ) = "cosmos.Int" ,
34
35
(gogoproto.customtype ) = "github.com/cosmos/cosmos-sdk/types.Int" ,
35
36
(gogoproto.nullable ) = false
36
37
];
37
38
38
39
// Remainders is a list of the remainder amounts in the key.
40
+ // this field is used to track remainder amount from claimings in the key pool.
39
41
repeated cosmos.base.v1beta1.DecCoin remainders = 6 [
40
42
(gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.DecCoins" ,
41
43
(gogoproto.nullable ) = false ,
42
44
(amino.dont_omitempty ) = true
43
45
];
44
46
}
45
47
46
- // Stake message represents a stake detail .
47
- message Stake {
48
+ // Lock message is used to store lock information of each user on each key along with their reward information .
49
+ message Lock {
48
50
option (gogoproto.equal ) = true ;
49
51
50
- // Address is the owner's address of the stake .
51
- string address = 1 [(cosmos_proto.scalar ) = "cosmos.AddressString" ];
52
+ // LockerAddress is the owner's address of the locker .
53
+ string locker_address = 1 [(cosmos_proto.scalar ) = "cosmos.AddressString" ];
52
54
53
- // Key is the key that this stake is locked to.
55
+ // Key is the key that this lock is locked to.
54
56
string key = 2 ;
55
57
56
58
// Amount is the locked power amount.
@@ -62,37 +64,38 @@ message Stake {
62
64
63
65
// PosRewardDebts is a list of reward debt for each reward (only the positive side).
64
66
// Note: Coin and DecCoin can't have negative amounts. so, we split it into two numbers.
65
- repeated cosmos.base.v1beta1.Coin pos_reward_debts = 4 [
66
- (gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.Coins " ,
67
+ repeated cosmos.base.v1beta1.DecCoin pos_reward_debts = 4 [
68
+ (gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.DecCoins " ,
67
69
(gogoproto.nullable ) = false ,
68
70
(amino.dont_omitempty ) = true
69
71
];
70
72
71
73
// NegRewardDebts is a list of reward debt for each reward (only negative side).
72
- repeated cosmos.base.v1beta1.Coin neg_reward_debts = 5 [
73
- (gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.Coins " ,
74
+ repeated cosmos.base.v1beta1.DecCoin neg_reward_debts = 5 [
75
+ (gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.DecCoins " ,
74
76
(gogoproto.nullable ) = false ,
75
77
(amino.dont_omitempty ) = true
76
78
];
77
79
}
78
80
79
- // Reward message represents a reward detail .
81
+ // Reward message is used as response of the query to show final rewards of the key for the user .
80
82
message Reward {
81
83
option (gogoproto.equal ) = true ;
82
84
83
85
// Key is the key that this reward belongs to.
84
86
string key = 1 ;
85
87
86
- // Rewards is a list of rewards .
88
+ // Rewards is a list of reward .
87
89
repeated cosmos.base.v1beta1.DecCoin rewards = 2 [
88
90
(gogoproto.castrepeated ) = "github.com/cosmos/cosmos-sdk/types.DecCoins" ,
89
91
(gogoproto.nullable ) = false ,
90
92
(amino.dont_omitempty ) = true
91
93
];
92
94
}
93
95
94
- // Lock message represents a lock definition.
95
- message Lock {
96
+ // LockResponse message is used as response of the query to show the power amount
97
+ // that is locked by the key for the user.
98
+ message LockResponse {
96
99
option (gogoproto.equal ) = true ;
97
100
98
101
// Key is the key that this lock belongs to.
0 commit comments