|
| 1 | +syntax = "proto3"; |
| 2 | +package cork.v1; |
| 3 | + |
| 4 | +import "gogoproto/gogo.proto"; |
| 5 | +import "google/api/annotations.proto"; |
| 6 | +import "cork/v1/genesis.proto"; |
| 7 | +import "cork/v1/cork.proto"; |
| 8 | +import "cosmos_proto/cosmos.proto"; |
| 9 | +import "cosmos/base/query/v1beta1/pagination.proto"; |
| 10 | + |
| 11 | +option go_package = "github.com/peggyjv/sommelier/v8/x/cork/types/v1"; |
| 12 | + |
| 13 | +// Query defines the gRPC query service for the cork module. |
| 14 | +service Query { |
| 15 | + // QueryParams queries the allocation module parameters. |
| 16 | + rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) { |
| 17 | + option (google.api.http).get = "/sommelier/cork/v1/params"; |
| 18 | + } |
| 19 | + // QuerySubmittedCorks queries the submitted corks awaiting vote |
| 20 | + rpc QuerySubmittedCorks(QuerySubmittedCorksRequest) returns (QuerySubmittedCorksResponse) { |
| 21 | + option (google.api.http).get = "/sommelier/cork/v1/submitted"; |
| 22 | + } |
| 23 | + // QueryCommitPeriod queries the heights for the current voting period (current, start and end) |
| 24 | + rpc QueryCommitPeriod(QueryCommitPeriodRequest) returns (QueryCommitPeriodResponse) { |
| 25 | + option (google.api.http).get = "/sommelier/cork/v1/commit_period"; |
| 26 | + } |
| 27 | + // QueryCellarIDs returns all cellars and current tick ranges |
| 28 | + rpc QueryCellarIDs(QueryCellarIDsRequest) returns (QueryCellarIDsResponse) { |
| 29 | + option (google.api.http).get = "/sommelier/cork/v1/cellar_ids"; |
| 30 | + } |
| 31 | + // QueryScheduledCorks returns all scheduled corks |
| 32 | + rpc QueryScheduledCorks(QueryScheduledCorksRequest) returns (QueryScheduledCorksResponse) { |
| 33 | + option (google.api.http).get = "/sommelier/cork/v1/scheduled_corks"; |
| 34 | + } |
| 35 | + // QueryScheduledBlockHeights returns all scheduled block heights |
| 36 | + rpc QueryScheduledBlockHeights(QueryScheduledBlockHeightsRequest) returns (QueryScheduledBlockHeightsResponse) { |
| 37 | + option (google.api.http).get = "/sommelier/cork/v1/scheduled_block_heights"; |
| 38 | + } |
| 39 | + |
| 40 | + // QueryScheduledCorks returns all scheduled corks at a block height |
| 41 | + rpc QueryScheduledCorksByBlockHeight(QueryScheduledCorksByBlockHeightRequest) returns (QueryScheduledCorksByBlockHeightResponse) { |
| 42 | + option (google.api.http).get = "/sommelier/cork/v1/scheduled_corks_by_block_height/{block_height}"; |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +// QueryParamsRequest is the request type for the Query/Params gRPC method. |
| 47 | +message QueryParamsRequest {} |
| 48 | + |
| 49 | +// QueryParamsRequest is the response type for the Query/Params gRPC method. |
| 50 | +message QueryParamsResponse { |
| 51 | + // allocation parameters |
| 52 | + Params params = 1 [(gogoproto.nullable) = false]; |
| 53 | +} |
| 54 | + |
| 55 | +// QuerySubmittedCorksRequest is the request type for the Query/QuerySubmittedCorks gRPC query method. |
| 56 | +message QuerySubmittedCorksRequest {} |
| 57 | + |
| 58 | +// QuerySubmittedCorksResponse is the response type for the Query/QuerySubmittedCorks gRPC query method. |
| 59 | +message QuerySubmittedCorksResponse { |
| 60 | + // corks in keeper awaiting vote |
| 61 | + repeated Cork corks = 1; |
| 62 | +} |
| 63 | + |
| 64 | + |
| 65 | +// QueryCommitPeriodRequest is the request type for the Query/QueryCommitPeriod gRPC method. |
| 66 | +message QueryCommitPeriodRequest {} |
| 67 | + |
| 68 | +// QueryCommitPeriodResponse is the response type for the Query/QueryCommitPeriod gRPC method. |
| 69 | +message QueryCommitPeriodResponse { |
| 70 | + // block height at which the query was processed |
| 71 | + int64 current_height = 1; |
| 72 | + // latest vote period start block height |
| 73 | + int64 vote_period_start = 2; |
| 74 | + // block height at which the current voting period ends |
| 75 | + int64 vote_period_end = 3; |
| 76 | +} |
| 77 | + |
| 78 | + |
| 79 | +// QueryCellarIDsRequest is the request type for Query/QueryCellarIDs gRPC method. |
| 80 | +message QueryCellarIDsRequest {} |
| 81 | + |
| 82 | +// QueryCellarIDsResponse is the response type for Query/QueryCellars gRPC method. |
| 83 | +message QueryCellarIDsResponse { |
| 84 | + repeated string cellar_ids = 1; |
| 85 | +} |
| 86 | + |
| 87 | +// QueryScheduledCorksRequest |
| 88 | +message QueryScheduledCorksRequest {} |
| 89 | + |
| 90 | +// QueryScheduledCorksResponse |
| 91 | +message QueryScheduledCorksResponse { |
| 92 | + repeated ScheduledCork corks = 1; |
| 93 | +} |
| 94 | + |
| 95 | +// QueryScheduledBlockHeightsRequest |
| 96 | +message QueryScheduledBlockHeightsRequest {} |
| 97 | + |
| 98 | +// QueryScheduledBlockHeightsResponse |
| 99 | +message QueryScheduledBlockHeightsResponse { |
| 100 | + repeated uint64 block_heights = 1; |
| 101 | +} |
| 102 | + |
| 103 | +// QueryScheduledCorksByBlockHeightRequest |
| 104 | +message QueryScheduledCorksByBlockHeightRequest { |
| 105 | + uint64 block_height = 1; |
| 106 | +} |
| 107 | + |
| 108 | +// QueryScheduledCorksByBlockHeightResponse |
| 109 | +message QueryScheduledCorksByBlockHeightResponse { |
| 110 | + repeated ScheduledCork corks = 1; |
| 111 | +} |
0 commit comments