Skip to content

Commit

Permalink
update pstake protos
Browse files Browse the repository at this point in the history
  • Loading branch information
puneet2019 committed Feb 9, 2024
1 parent f5d2222 commit e94e4d9
Show file tree
Hide file tree
Showing 18 changed files with 1,152 additions and 124 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Use with [cosmjs](https://github.com/cosmos/cosmjs)
- do `npm run update-protos`
- do `npm run build:telescope`
- update package.json version
- do `npm install`
- commit and open PR
- tag a release for publishing on npmjs

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "persistenceonejs",
"version": "2.4.0-rc0",
"version": "2.4.0-rc1",
"description": "Client side JS libraries for persistenceSDK transaction generation, signing and broadcasting.",
"main": "main/index.js",
"module": "module/index.js",
Expand Down
34 changes: 27 additions & 7 deletions proto/pstake/liquidstake/v1beta1/liquidstake.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package pstake.liquidstake.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "google/protobuf/timestamp.proto";

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

Expand Down Expand Up @@ -42,10 +40,35 @@ message Params {
(gogoproto.nullable) = false
];

// cw_locked_pool_address defines the bech32-encoded address of
// CwLockedPoolAddress defines the bech32-encoded address of
// a CW smart-contract representing a time locked LP (e.g. Superfluid LP).
string cw_locked_pool_address = 6
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// FeeAccountAddress defines the bech32-encoded address of
// a an account responsible for accumulating protocol fees.
string fee_account_address = 7
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// AutocompoundFeeRate specifies the fee rate for auto redelegating the stake
// rewards. The fee is taken in favour of the fee account (see
// FeeAccountAddress).
string autocompound_fee_rate = 8 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];

// WhitelistAdminAddress the bech32-encoded address of an admin authority
// that is allowed to update whitelisted validators or pause liquidstaking
// module entirely. The key is controlled by an offchain process that is
// selecting validators based on a criteria. Pausing of the module can be
// required during important migrations or failures.
string whitelist_admin_address = 9
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// ModulePaused is a safety toggle that allows to stop main module functions
// such as stake/unstake/stake-to-lp and the BeginBlocker logic.
bool module_paused = 10;
}

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

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

Expand Down Expand Up @@ -96,7 +118,6 @@ message LiquidValidator {
// encoded in JSON.
string operator_address = 1
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

}

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


// weight specifies the weight for liquid staking, unstaking amount
string weight = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
Expand Down
49 changes: 47 additions & 2 deletions proto/pstake/liquidstake/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ service Msg {

// UpdateParams defines a method to update the module params.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);

// UpdateWhitelistedValidators defines a method to update the whitelisted
// validators list.
rpc UpdateWhitelistedValidators(MsgUpdateWhitelistedValidators)
returns (MsgUpdateWhitelistedValidatorsResponse);

// SetModulePaused defines a method to update the module's pause status,
// setting value of the safety flag in params.
rpc SetModulePaused(MsgSetModulePaused) returns (MsgSetModulePausedResponse);
}

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


string validator_address = 2
[ (cosmos_proto.scalar) = "cosmos.AddressString" ];

Expand Down Expand Up @@ -95,9 +103,46 @@ message MsgUpdateParams {

// params defines the parameters to update.
//
// NOTE: All parameters must be supplied.
// NOTE: denom and whitelisted validators are not updated.
//
Params params = 2 [ (gogoproto.nullable) = false ];
}

// MsgUpdateParamsResponse defines the response structure for executing a
message MsgUpdateParamsResponse {}

message MsgUpdateWhitelistedValidators {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "authority";

// Authority is the address that is allowed to update whitelisted validators,
// defined as admin address in params (WhitelistAdminAddress).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// WhitelistedValidators specifies the validators elected to become Active
// Liquid Validators.
repeated WhitelistedValidator whitelisted_validators = 2
[ (gogoproto.nullable) = false ];
}

// MsgUpdateWhitelistedValidatorsResponse defines the response structure for
// executing a
message MsgUpdateWhitelistedValidatorsResponse {}

message MsgSetModulePaused {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "authority";

// Authority is the address that is allowed to update module's paused state,
// defined as admin address in params (WhitelistAdminAddress).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// IsPaused represents the target state of the paused flag.
bool is_paused = 2;
}

// MsgSetModulePausedResponse defines the response structure for
// executing a
message MsgSetModulePausedResponse {}
20 changes: 20 additions & 0 deletions proto/pstake/liquidstakeibc/v1beta1/liquidstakeibc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,19 @@ message HostChain {
];
// host chain flags
HostChainFlags flags = 16;
// non-compoundable chain reward params
RewardParams reward_params = 17;
}

message HostChainFlags { bool lsm = 1; }

message RewardParams {
// rewards denom on the host chain
string denom = 1;
// entity which will convert rewards to the host denom
string destination = 2 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}

message HostChainLSParams {
string deposit_fee = 1 [
(cosmos_proto.scalar) = "cosmos.Dec",
Expand Down Expand Up @@ -107,6 +116,17 @@ message HostChainLSParams {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
string upper_c_value_limit = 10 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
]; // upper limit for the c value of the host chain

string lower_c_value_limit = 11 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
]; // lower limit for the c value of the host chain
}

message ICAAccount {
Expand Down
15 changes: 4 additions & 11 deletions proto/pstake/liquidstakeibc/v1beta1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ message Params {
string fee_address = 2 [ (cosmos_proto.scalar) =
"cosmos.AddressString" ]; // protocol fee address

string upper_c_value_limit = 3 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
]; // upper limit for the c value of a host chain

string lower_c_value_limit = 4 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
]; // lower limit for the c value of a host chain
// fields 3 and 4 were migrated to on-chain params.
// check https://github.com/persistenceOne/pstake-native/pull/732.
reserved 3; // upper_c_value_limit
reserved 4; // lower_c_value_limit
}
44 changes: 44 additions & 0 deletions proto/pstake/liquidstakeibc/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ service Query {
"/pstake/liquidstakeibc/v1beta1/user_unbondings/{address}";
}

// Queries all unbondings for a host chain.
rpc HostChainUserUnbondings(QueryHostChainUserUnbondingsRequest)
returns (QueryHostChainUserUnbondingsResponse) {
option (google.api.http).get =
"/pstake/liquidstakeibc/v1beta1/user_unbondings/{chain_id}";
}

// Queries all validator unbondings for a host chain.
rpc ValidatorUnbondings(QueryValidatorUnbondingRequest)
returns (QueryValidatorUnbondingResponse) {
Expand All @@ -84,6 +91,21 @@ service Query {
option (google.api.http).get =
"/pstake/liquidstakeibc/v1beta1/exchange_rate/{chain_id}";
}

// Queries for a host chain redelegation entries on the host token delegation
// acct.
rpc Redelegations(QueryRedelegationsRequest)
returns (QueryRedelegationsResponse) {
option (google.api.http).get =
"/pstake/liquidstakeibc/v1beta1/redelegations/{chain_id}";
}

// Queries for a host chain redelegation-txs for the host token.
rpc RedelegationTx(QueryRedelegationTxRequest)
returns (QueryRedelegationTxResponse) {
option (google.api.http).get =
"/pstake/liquidstakeibc/v1beta1/redelegation_tx/{chain_id}";
}
}

message QueryParamsRequest {}
Expand Down Expand Up @@ -127,6 +149,16 @@ message QueryUserUnbondingsResponse {
repeated UserUnbonding user_unbondings = 1;
}

message QueryHostChainUserUnbondingsRequest {
string chain_id = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

message QueryHostChainUserUnbondingsResponse {
repeated UserUnbonding user_unbondings = 1;
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryValidatorUnbondingRequest { string chain_id = 1; }

message QueryValidatorUnbondingResponse {
Expand All @@ -148,3 +180,15 @@ message QueryExchangeRateResponse {
(cosmos_proto.scalar) = "cosmos.Dec"
];
}

message QueryRedelegationsRequest { string chain_id = 1; }

message QueryRedelegationsResponse {
liquidstakeibc.v1beta1.Redelegations redelegations = 1;
}

message QueryRedelegationTxRequest { string chain_id = 1; }

message QueryRedelegationTxResponse {
repeated liquidstakeibc.v1beta1.RedelegateTx redelegation_tx = 1;
}
Loading

0 comments on commit e94e4d9

Please sign in to comment.