0g-chain/proto/zgc/committee/v1beta1/query.proto

182 lines
6.7 KiB
Protocol Buffer
Raw Permalink Normal View History

syntax = "proto3";
2024-05-01 03:56:00 +00:00
package zgc.committee.v1beta1;
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
2024-05-01 03:56:00 +00:00
import "zgc/committee/v1beta1/genesis.proto";
2024-05-01 03:17:24 +00:00
option go_package = "github.com/0glabs/0g-chain/x/committee/types";
option (gogoproto.goproto_getters_all) = false;
// Query defines the gRPC querier service for committee module
service Query {
// Committees queries all committess of the committee module.
rpc Committees(QueryCommitteesRequest) returns (QueryCommitteesResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/committees";
}
// Committee queries a committee based on committee ID.
rpc Committee(QueryCommitteeRequest) returns (QueryCommitteeResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/committees/{committee_id}";
}
// Proposals queries proposals based on committee ID.
rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/proposals";
}
// Deposits queries a proposal based on proposal ID.
rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}";
}
// NextProposalID queries the next proposal ID of the committee module.
rpc NextProposalID(QueryNextProposalIDRequest) returns (QueryNextProposalIDResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/next-proposal-id";
}
// Votes queries all votes for a single proposal ID.
rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}/votes";
}
// Vote queries the vote of a single voter for a single proposal ID.
rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}/votes/{voter}";
}
// Tally queries the tally of a single proposal ID.
rpc Tally(QueryTallyRequest) returns (QueryTallyResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/proposals/{proposal_id}/tally";
}
// RawParams queries the raw params data of any subspace and key.
rpc RawParams(QueryRawParamsRequest) returns (QueryRawParamsResponse) {
2024-05-01 17:43:59 +00:00
option (google.api.http).get = "/0g/committee/v1beta1/raw-params";
}
}
// QueryCommitteesRequest defines the request type for querying x/committee committees.
message QueryCommitteesRequest {}
// QueryCommitteesResponse defines the response type for querying x/committee committees.
message QueryCommitteesResponse {
repeated google.protobuf.Any committees = 1 [(cosmos_proto.accepts_interface) = "Committee"];
}
// QueryCommitteeRequest defines the request type for querying x/committee committee.
message QueryCommitteeRequest {
uint64 committee_id = 1;
}
// QueryCommitteeResponse defines the response type for querying x/committee committee.
message QueryCommitteeResponse {
google.protobuf.Any committee = 1 [(cosmos_proto.accepts_interface) = "Committee"];
}
// QueryProposalsRequest defines the request type for querying x/committee proposals.
message QueryProposalsRequest {
uint64 committee_id = 1;
}
// QueryProposalsResponse defines the response type for querying x/committee proposals.
message QueryProposalsResponse {
repeated QueryProposalResponse proposals = 1 [(gogoproto.nullable) = false];
}
// QueryProposalRequest defines the request type for querying x/committee proposal.
message QueryProposalRequest {
uint64 proposal_id = 1;
}
// QueryProposalResponse defines the response type for querying x/committee proposal.
message QueryProposalResponse {
google.protobuf.Any pub_proposal = 1 [
(cosmos_proto.accepts_interface) = "cosmos.gov.v1beta1.Content",
(gogoproto.customname) = "PubProposal"
];
uint64 id = 2 [(gogoproto.customname) = "ID"];
uint64 committee_id = 3 [(gogoproto.customname) = "CommitteeID"];
google.protobuf.Timestamp deadline = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true
];
}
// QueryNextProposalIDRequest defines the request type for querying x/committee NextProposalID.
message QueryNextProposalIDRequest {}
// QueryNextProposalIDRequest defines the response type for querying x/committee NextProposalID.
message QueryNextProposalIDResponse {
uint64 next_proposal_id = 1 [(gogoproto.customname) = "NextProposalID"];
}
// QueryVotesRequest defines the request type for querying x/committee votes.
message QueryVotesRequest {
uint64 proposal_id = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryVotesResponse defines the response type for querying x/committee votes.
message QueryVotesResponse {
// votes defined the queried votes.
repeated QueryVoteResponse votes = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryVoteRequest defines the request type for querying x/committee vote.
message QueryVoteRequest {
uint64 proposal_id = 1;
string voter = 2;
}
// QueryVoteResponse defines the response type for querying x/committee vote.
message QueryVoteResponse {
uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID"];
string voter = 2;
VoteType vote_type = 3;
}
// QueryTallyRequest defines the request type for querying x/committee tally.
message QueryTallyRequest {
uint64 proposal_id = 1;
}
// QueryTallyResponse defines the response type for querying x/committee tally.
message QueryTallyResponse {
uint64 proposal_id = 1 [(gogoproto.customname) = "ProposalID"];
string yes_votes = 2 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string no_votes = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string current_votes = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string possible_votes = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string vote_threshold = 6 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
string quorum = 7 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
}
// QueryRawParamsRequest defines the request type for querying x/committee raw params.
message QueryRawParamsRequest {
string subspace = 1;
string key = 2;
}
// QueryRawParamsResponse defines the response type for querying x/committee raw params.
message QueryRawParamsResponse {
string raw_data = 1;
}