Skip to content

Commit

Permalink
chore: add stride staking protos
Browse files Browse the repository at this point in the history
pulled rom stride's main branch, https://github.com/Stride-Labs/stride/tree/main/proto/stride , Commit 41eb417
  • Loading branch information
99adarsh authored and turadg committed Feb 12, 2025
1 parent 93802a7 commit b7b5d2e
Show file tree
Hide file tree
Showing 29 changed files with 2,758 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/cosmic-proto/proto/stride/epochs/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
syntax = "proto3";
package stride.epochs;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/Stride-Labs/stride/v25/x/epochs/types";

message EpochInfo {
string identifier = 1;
google.protobuf.Timestamp start_time = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"start_time\""
];
google.protobuf.Duration duration = 3 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.jsontag) = "duration,omitempty",
(gogoproto.moretags) = "yaml:\"duration\""
];
int64 current_epoch = 4;
google.protobuf.Timestamp current_epoch_start_time = 5 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"current_epoch_start_time\""
];
bool epoch_counting_started = 6;
int64 current_epoch_start_height = 7;
}

// GenesisState defines the epochs module's genesis state.
message GenesisState {
repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ];
}
74 changes: 74 additions & 0 deletions packages/cosmic-proto/proto/stride/epochs/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
syntax = "proto3";
package stride.epochs;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "stride/epochs/genesis.proto";

option go_package = "github.com/Stride-Labs/stride/v25/x/epochs/types";

// Query defines the gRPC querier service.
service Query {
// EpochInfos provide running epochInfos
rpc EpochInfos(QueryEpochsInfoRequest) returns (QueryEpochsInfoResponse) {
option (google.api.http).get = "/Stridelabs/stride/epochs";
}
// CurrentEpoch provide current epoch of specified identifier
rpc CurrentEpoch(QueryCurrentEpochRequest)
returns (QueryCurrentEpochResponse) {
option (google.api.http).get = "/Stridelabs/stride/epochs/current_epoch";
}
// CurrentEpoch provide current epoch of specified identifier
rpc EpochInfo(QueryEpochInfoRequest) returns (QueryEpochInfoResponse) {
option (google.api.http).get = "/Stridelabs/stride/epochs/epoch_info";
}
}

message QueryEpochsInfoRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryEpochsInfoResponse {
repeated EpochInfo epochs = 1 [ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryCurrentEpochRequest { string identifier = 1; }
message QueryCurrentEpochResponse { int64 current_epoch = 1; }

message QueryEpochInfoRequest { string identifier = 1; }
message QueryEpochInfoResponse {
EpochInfo epoch = 1 [ (gogoproto.nullable) = false ];
}

// syntax = "proto3";
// package stride.epochs;

// import "gogoproto/gogo.proto";
// import "google/api/annotations.proto";
// import "cosmos/base/query/v1beta1/pagination.proto";
// import "epochs/params.proto";
// // this line is used by starport scaffolding # 1

// option go_package = "github.com/Stride-Labs/stride/v25/x/epochs/types";

// // Query defines the gRPC querier service.
// service Query {
// // Parameters queries the parameters of the module.
// rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
// option (google.api.http).get = "/Stridelabs/stride/epochs/params";
// }
// // this line is used by starport scaffolding # 2
// }

// // QueryParamsRequest is request type for the Query/Params RPC method.
// message QueryParamsRequest {}

// // QueryParamsResponse is response type for the Query/Params RPC method.
// message QueryParamsResponse {
// // params holds all the parameters of this module.
// Params params = 1 [(gogoproto.nullable) = false];
// }

// // this line is used by starport scaffolding # 3
10 changes: 10 additions & 0 deletions packages/cosmic-proto/proto/stride/records/callbacks.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";
package stride.records;

import "stride/records/records.proto";

option go_package = "github.com/Stride-Labs/stride/v25/x/records/types";

message TransferCallback { uint64 deposit_record_id = 1; }

message TransferLSMTokenCallback { LSMTokenDeposit deposit = 1; }
24 changes: 24 additions & 0 deletions packages/cosmic-proto/proto/stride/records/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";
package stride.records;

import "stride/records/params.proto";
import "stride/records/records.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/Stride-Labs/stride/v25/x/records/types";

// GenesisState defines the records module's genesis state.
message GenesisState {
Params params = 1 [ (gogoproto.nullable) = false ];
string port_id = 2;
repeated UserRedemptionRecord user_redemption_record_list = 3
[ (gogoproto.nullable) = false ];
uint64 user_redemption_record_count = 4;
repeated EpochUnbondingRecord epoch_unbonding_record_list = 5
[ (gogoproto.nullable) = false ];
repeated DepositRecord deposit_record_list = 7
[ (gogoproto.nullable) = false ];
uint64 deposit_record_count = 8;
repeated LSMTokenDeposit lsm_token_deposit_list = 9
[ (gogoproto.nullable) = false ];
}
7 changes: 7 additions & 0 deletions packages/cosmic-proto/proto/stride/records/params.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
syntax = "proto3";
package stride.records;

option go_package = "github.com/Stride-Labs/stride/v25/x/records/types";

// Params defines the parameters for the module.
message Params {}
185 changes: 185 additions & 0 deletions packages/cosmic-proto/proto/stride/records/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
syntax = "proto3";
package stride.records;

import "stride/records/records.proto";
import "stride/records/params.proto";

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

option go_package = "github.com/Stride-Labs/stride/v25/x/records/types";

// Query defines the gRPC querier service.
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/StrideLabs/stride/records/params";
}
// Queries a UserRedemptionRecord by id.
rpc UserRedemptionRecord(QueryGetUserRedemptionRecordRequest)
returns (QueryGetUserRedemptionRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/user_redemption_record/{id}";
}

// Queries a list of UserRedemptionRecord items.
rpc UserRedemptionRecordAll(QueryAllUserRedemptionRecordRequest)
returns (QueryAllUserRedemptionRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/user_redemption_record";
}

// Queries a list of UserRedemptionRecord items by chainId / userId pair.
rpc UserRedemptionRecordForUser(QueryAllUserRedemptionRecordForUserRequest)
returns (QueryAllUserRedemptionRecordForUserResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/user_redemption_record_for_user/"
"{chain_id}/{day}/{address}/{limit}";
}

// Queries a EpochUnbondingRecord by id.
rpc EpochUnbondingRecord(QueryGetEpochUnbondingRecordRequest)
returns (QueryGetEpochUnbondingRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/epoch_unbonding_record/{epoch_number}";
}

// Queries a list of EpochUnbondingRecord items.
rpc EpochUnbondingRecordAll(QueryAllEpochUnbondingRecordRequest)
returns (QueryAllEpochUnbondingRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/epoch_unbonding_record";
}

// Queries a DepositRecord by id.
rpc DepositRecord(QueryGetDepositRecordRequest)
returns (QueryGetDepositRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/deposit_record/{id}";
}

// Queries a list of DepositRecord items.
rpc DepositRecordAll(QueryAllDepositRecordRequest)
returns (QueryAllDepositRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/deposit_record";
}

// Queries a list of DepositRecord items for a given host zone
rpc DepositRecordByHost(QueryDepositRecordByHostRequest)
returns (QueryDepositRecordByHostResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/"
"deposit_record_by_host_zone/{host_zone_id}";
}

// Queries the existing LSMTokenDeposits for one specific deposit
rpc LSMDeposit(QueryLSMDepositRequest) returns (QueryLSMDepositResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/stakeibc/lsm_deposit/{chain_id}/{denom}";
}

// Queries the existing LSMTokenDeposits for all which match filters
// intended use:
// ...stakeibc/lsm_deposits?chain_id=X&validator_address=Y&status=Z
rpc LSMDeposits(QueryLSMDepositsRequest) returns (QueryLSMDepositsResponse) {
option (google.api.http).get = "/Stride-Labs/stride/stakeibc/lsm_deposits";
}
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [ (gogoproto.nullable) = false ];
}

message QueryGetDepositRecordRequest { uint64 id = 1; }

message QueryGetDepositRecordResponse {
DepositRecord deposit_record = 1 [ (gogoproto.nullable) = false ];
}

message QueryAllDepositRecordRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllDepositRecordResponse {
repeated DepositRecord deposit_record = 1 [ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryDepositRecordByHostRequest { string host_zone_id = 1; }

message QueryDepositRecordByHostResponse {
repeated DepositRecord deposit_record = 1 [ (gogoproto.nullable) = false ];
}

message QueryGetUserRedemptionRecordRequest { string id = 1; }

message QueryGetUserRedemptionRecordResponse {
UserRedemptionRecord user_redemption_record = 1
[ (gogoproto.nullable) = false ];
}

message QueryAllUserRedemptionRecordRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllUserRedemptionRecordResponse {
repeated UserRedemptionRecord user_redemption_record = 1
[ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// Query UserRedemptionRecords by chainId / userId pair
message QueryAllUserRedemptionRecordForUserRequest {
string chain_id = 1;
uint64 day = 2;
string address = 3;
uint64 limit = 4;
cosmos.base.query.v1beta1.PageRequest pagination = 5;
}

message QueryAllUserRedemptionRecordForUserResponse {
repeated UserRedemptionRecord user_redemption_record = 1
[ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetEpochUnbondingRecordRequest { uint64 epoch_number = 1; }

message QueryGetEpochUnbondingRecordResponse {
EpochUnbondingRecord epoch_unbonding_record = 1
[ (gogoproto.nullable) = false ];
}

message QueryAllEpochUnbondingRecordRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllEpochUnbondingRecordResponse {
repeated EpochUnbondingRecord epoch_unbonding_record = 1
[ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryLSMDepositRequest {
string chain_id = 1;
string denom = 2;
}

message QueryLSMDepositResponse {
LSMTokenDeposit deposit = 1 [ (gogoproto.nullable) = false ];
}

message QueryLSMDepositsRequest {
string chain_id = 1;
string validator_address = 2;
string status = 3;
}

message QueryLSMDepositsResponse {
repeated LSMTokenDeposit deposits = 1 [ (gogoproto.nullable) = false ];
}
Loading

0 comments on commit b7b5d2e

Please sign in to comment.