Skip to content

Commit af25552

Browse files
authored
Merge pull request #65 from persistenceOne/puneet/update-pstake
chore: update pstake protos
2 parents c514799 + 9604b39 commit af25552

File tree

32 files changed

+3439
-124
lines changed

32 files changed

+3439
-124
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Use with [cosmjs](https://github.com/cosmos/cosmjs)
2828
- do `npm run update-protos`
2929
- do `npm run build:telescope`
3030
- update package.json version
31+
- do `npm install`
3132
- commit and open PR
3233
- tag a release for publishing on npmjs
3334

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "persistenceonejs",
3-
"version": "2.4.0-rc0",
3+
"version": "2.4.0-rc1",
44
"description": "Client side JS libraries for persistenceSDK transaction generation, signing and broadcasting.",
55
"main": "main/index.js",
66
"module": "module/index.js",

proto/pstake/liquidstake/v1beta1/liquidstake.proto

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ package pstake.liquidstake.v1beta1;
44

55
import "gogoproto/gogo.proto";
66
import "cosmos_proto/cosmos.proto";
7-
import "cosmos/base/v1beta1/coin.proto";
8-
import "google/protobuf/timestamp.proto";
97

108
option go_package = "github.com/persistenceOne/pstake-native/v2/x/liquidstake/types";
119

@@ -42,10 +40,35 @@ message Params {
4240
(gogoproto.nullable) = false
4341
];
4442

45-
// cw_locked_pool_address defines the bech32-encoded address of
43+
// CwLockedPoolAddress defines the bech32-encoded address of
4644
// a CW smart-contract representing a time locked LP (e.g. Superfluid LP).
4745
string cw_locked_pool_address = 6
4846
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
47+
48+
// FeeAccountAddress defines the bech32-encoded address of
49+
// a an account responsible for accumulating protocol fees.
50+
string fee_account_address = 7
51+
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
52+
53+
// AutocompoundFeeRate specifies the fee rate for auto redelegating the stake
54+
// rewards. The fee is taken in favour of the fee account (see
55+
// FeeAccountAddress).
56+
string autocompound_fee_rate = 8 [
57+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
58+
(gogoproto.nullable) = false
59+
];
60+
61+
// WhitelistAdminAddress the bech32-encoded address of an admin authority
62+
// that is allowed to update whitelisted validators or pause liquidstaking
63+
// module entirely. The key is controlled by an offchain process that is
64+
// selecting validators based on a criteria. Pausing of the module can be
65+
// required during important migrations or failures.
66+
string whitelist_admin_address = 9
67+
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
68+
69+
// ModulePaused is a safety toggle that allows to stop main module functions
70+
// such as stake/unstake/stake-to-lp and the BeginBlocker logic.
71+
bool module_paused = 10;
4972
}
5073

5174
// ValidatorStatus enumerates the status of a liquid validator.
@@ -65,8 +88,7 @@ enum ValidatorStatus {
6588

6689
// WhitelistedValidator consists of the validator operator address and the
6790
// target weight, which is a value for calculating the real weight to be derived
68-
// according to the active status. In the case of inactive, it is calculated as
69-
// zero.
91+
// according to the active status.
7092
message WhitelistedValidator {
7193
option (gogoproto.goproto_getters) = false;
7294

@@ -96,7 +118,6 @@ message LiquidValidator {
96118
// encoded in JSON.
97119
string operator_address = 1
98120
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
99-
100121
}
101122

102123
// LiquidValidatorState is type LiquidValidator with state added to return to
@@ -110,7 +131,6 @@ message LiquidValidatorState {
110131
string operator_address = 1
111132
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
112133

113-
114134
// weight specifies the weight for liquid staking, unstaking amount
115135
string weight = 2 [
116136
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",

proto/pstake/liquidstake/v1beta1/tx.proto

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ service Msg {
2626

2727
// UpdateParams defines a method to update the module params.
2828
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
29+
30+
// UpdateWhitelistedValidators defines a method to update the whitelisted
31+
// validators list.
32+
rpc UpdateWhitelistedValidators(MsgUpdateWhitelistedValidators)
33+
returns (MsgUpdateWhitelistedValidatorsResponse);
34+
35+
// SetModulePaused defines a method to update the module's pause status,
36+
// setting value of the safety flag in params.
37+
rpc SetModulePaused(MsgSetModulePaused) returns (MsgSetModulePausedResponse);
2938
}
3039

3140
// MsgLiquidStake defines a SDK message for performing a liquid stake of coins
@@ -54,7 +63,6 @@ message MsgStakeToLP {
5463
string delegator_address = 1
5564
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
5665

57-
5866
string validator_address = 2
5967
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];
6068

@@ -95,9 +103,46 @@ message MsgUpdateParams {
95103

96104
// params defines the parameters to update.
97105
//
98-
// NOTE: All parameters must be supplied.
106+
// NOTE: denom and whitelisted validators are not updated.
107+
//
99108
Params params = 2 [ (gogoproto.nullable) = false ];
100109
}
101110

102111
// MsgUpdateParamsResponse defines the response structure for executing a
103112
message MsgUpdateParamsResponse {}
113+
114+
message MsgUpdateWhitelistedValidators {
115+
option (gogoproto.equal) = false;
116+
option (gogoproto.goproto_getters) = false;
117+
option (cosmos.msg.v1.signer) = "authority";
118+
119+
// Authority is the address that is allowed to update whitelisted validators,
120+
// defined as admin address in params (WhitelistAdminAddress).
121+
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
122+
123+
// WhitelistedValidators specifies the validators elected to become Active
124+
// Liquid Validators.
125+
repeated WhitelistedValidator whitelisted_validators = 2
126+
[ (gogoproto.nullable) = false ];
127+
}
128+
129+
// MsgUpdateWhitelistedValidatorsResponse defines the response structure for
130+
// executing a
131+
message MsgUpdateWhitelistedValidatorsResponse {}
132+
133+
message MsgSetModulePaused {
134+
option (gogoproto.equal) = false;
135+
option (gogoproto.goproto_getters) = false;
136+
option (cosmos.msg.v1.signer) = "authority";
137+
138+
// Authority is the address that is allowed to update module's paused state,
139+
// defined as admin address in params (WhitelistAdminAddress).
140+
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
141+
142+
// IsPaused represents the target state of the paused flag.
143+
bool is_paused = 2;
144+
}
145+
146+
// MsgSetModulePausedResponse defines the response structure for
147+
// executing a
148+
message MsgSetModulePausedResponse {}

proto/pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,19 @@ message HostChain {
6060
];
6161
// host chain flags
6262
HostChainFlags flags = 16;
63+
// non-compoundable chain reward params
64+
RewardParams reward_params = 17;
6365
}
6466

6567
message HostChainFlags { bool lsm = 1; }
6668

69+
message RewardParams {
70+
// rewards denom on the host chain
71+
string denom = 1;
72+
// entity which will convert rewards to the host denom
73+
string destination = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
74+
}
75+
6776
message HostChainLSParams {
6877
string deposit_fee = 1 [
6978
(cosmos_proto.scalar) = "cosmos.Dec",
@@ -107,6 +116,17 @@ message HostChainLSParams {
107116
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
108117
(gogoproto.nullable) = false
109118
];
119+
string upper_c_value_limit = 10 [
120+
(cosmos_proto.scalar) = "cosmos.Dec",
121+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
122+
(gogoproto.nullable) = false
123+
]; // upper limit for the c value of the host chain
124+
125+
string lower_c_value_limit = 11 [
126+
(cosmos_proto.scalar) = "cosmos.Dec",
127+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
128+
(gogoproto.nullable) = false
129+
]; // lower limit for the c value of the host chain
110130
}
111131

112132
message ICAAccount {

proto/pstake/liquidstakeibc/v1beta1/params.proto

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,8 @@ message Params {
1818
string fee_address = 2 [ (cosmos_proto.scalar) =
1919
"cosmos.AddressString" ]; // protocol fee address
2020

21-
string upper_c_value_limit = 3 [
22-
(cosmos_proto.scalar) = "cosmos.Dec",
23-
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
24-
(gogoproto.nullable) = false
25-
]; // upper limit for the c value of a host chain
26-
27-
string lower_c_value_limit = 4 [
28-
(cosmos_proto.scalar) = "cosmos.Dec",
29-
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
30-
(gogoproto.nullable) = false
31-
]; // lower limit for the c value of a host chain
21+
// fields 3 and 4 were migrated to on-chain params.
22+
// check https://github.com/persistenceOne/pstake-native/pull/732.
23+
reserved 3; // upper_c_value_limit
24+
reserved 4; // lower_c_value_limit
3225
}

proto/pstake/liquidstakeibc/v1beta1/query.proto

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ service Query {
6363
"/pstake/liquidstakeibc/v1beta1/user_unbondings/{address}";
6464
}
6565

66+
// Queries all unbondings for a host chain.
67+
rpc HostChainUserUnbondings(QueryHostChainUserUnbondingsRequest)
68+
returns (QueryHostChainUserUnbondingsResponse) {
69+
option (google.api.http).get =
70+
"/pstake/liquidstakeibc/v1beta1/user_unbondings/{chain_id}";
71+
}
72+
6673
// Queries all validator unbondings for a host chain.
6774
rpc ValidatorUnbondings(QueryValidatorUnbondingRequest)
6875
returns (QueryValidatorUnbondingResponse) {
@@ -84,6 +91,21 @@ service Query {
8491
option (google.api.http).get =
8592
"/pstake/liquidstakeibc/v1beta1/exchange_rate/{chain_id}";
8693
}
94+
95+
// Queries for a host chain redelegation entries on the host token delegation
96+
// acct.
97+
rpc Redelegations(QueryRedelegationsRequest)
98+
returns (QueryRedelegationsResponse) {
99+
option (google.api.http).get =
100+
"/pstake/liquidstakeibc/v1beta1/redelegations/{chain_id}";
101+
}
102+
103+
// Queries for a host chain redelegation-txs for the host token.
104+
rpc RedelegationTx(QueryRedelegationTxRequest)
105+
returns (QueryRedelegationTxResponse) {
106+
option (google.api.http).get =
107+
"/pstake/liquidstakeibc/v1beta1/redelegation_tx/{chain_id}";
108+
}
87109
}
88110

89111
message QueryParamsRequest {}
@@ -127,6 +149,16 @@ message QueryUserUnbondingsResponse {
127149
repeated UserUnbonding user_unbondings = 1;
128150
}
129151

152+
message QueryHostChainUserUnbondingsRequest {
153+
string chain_id = 1;
154+
cosmos.base.query.v1beta1.PageRequest pagination = 2;
155+
}
156+
157+
message QueryHostChainUserUnbondingsResponse {
158+
repeated UserUnbonding user_unbondings = 1;
159+
cosmos.base.query.v1beta1.PageResponse pagination = 2;
160+
}
161+
130162
message QueryValidatorUnbondingRequest { string chain_id = 1; }
131163

132164
message QueryValidatorUnbondingResponse {
@@ -148,3 +180,15 @@ message QueryExchangeRateResponse {
148180
(cosmos_proto.scalar) = "cosmos.Dec"
149181
];
150182
}
183+
184+
message QueryRedelegationsRequest { string chain_id = 1; }
185+
186+
message QueryRedelegationsResponse {
187+
liquidstakeibc.v1beta1.Redelegations redelegations = 1;
188+
}
189+
190+
message QueryRedelegationTxRequest { string chain_id = 1; }
191+
192+
message QueryRedelegationTxResponse {
193+
repeated liquidstakeibc.v1beta1.RedelegateTx redelegation_tx = 1;
194+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
syntax = "proto3";
2+
package pstake.ratesync.v1beta1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "cosmos_proto/cosmos.proto";
6+
import "google/protobuf/timestamp.proto";
7+
8+
option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types";
9+
10+
// msg blob for instantiate contract.
11+
message InstantiateLiquidStakeRateContract {
12+
string admin = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
13+
string transfer_channel_i_d = 2;
14+
string transfer_port_i_d = 3;
15+
}
16+
17+
// wrapper for liquidstakerate as wasm msg should be marshalled as encodedMsg =
18+
// { wasmMsg: { wasm MsgDetails } }
19+
message ExecuteLiquidStakeRate {
20+
LiquidStakeRate liquid_stake_rate = 1 [ (gogoproto.nullable) = false ];
21+
}
22+
23+
// msg blob for execute contract.
24+
message LiquidStakeRate {
25+
string default_bond_denom = 1;
26+
string stk_denom = 2;
27+
// cvalue = default_bond_denom_price/stk_denom_price
28+
// cvalue = stk_denom_supply/default_bond_denom_supply
29+
string c_value = 3 [
30+
(gogoproto.nullable) = false,
31+
(cosmos_proto.scalar) = "cosmos.Dec",
32+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"
33+
];
34+
int64 controller_chain_time = 4;
35+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
syntax = "proto3";
2+
package pstake.ratesync.v1beta1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "pstake/ratesync/v1beta1/params.proto";
6+
import "pstake/ratesync/v1beta1/ratesync.proto";
7+
8+
option go_package = "github.com/persistenceOne/pstake-native/v2/x/ratesync/types";
9+
10+
// GenesisState defines the ratesync module's genesis state.
11+
message GenesisState {
12+
Params params = 1 [ (gogoproto.nullable) = false ];
13+
repeated HostChain host_chains = 2 [ (gogoproto.nullable) = false ];
14+
}

0 commit comments

Comments
 (0)