syntax = "proto3";
package cosmos.params.v1beta1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/params/v1beta1/params.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal";

// Query defines the gRPC querier service.
service Query {
  // Params queries a specific parameter of a module, given its subspace and
  // key.
  rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
    option (google.api.http).get = "/cosmos/params/v1beta1/params";
  }

  // Subspaces queries for all registered subspaces and all keys for a subspace.
  //
  // Since: cosmos-sdk 0.46
  rpc Subspaces(QuerySubspacesRequest) returns (QuerySubspacesResponse) {
    option (google.api.http).get = "/cosmos/params/v1beta1/subspaces";
  }
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {
  // subspace defines the module to query the parameter for.
  string subspace = 1;

  // key defines the key of the parameter in the subspace.
  string key = 2;
}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
  // param defines the queried parameter.
  ParamChange param = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// QuerySubspacesRequest defines a request type for querying for all registered
// subspaces and all keys for a subspace.
//
// Since: cosmos-sdk 0.46
message QuerySubspacesRequest {}

// QuerySubspacesResponse defines the response types for querying for all
// registered subspaces and all keys for a subspace.
//
// Since: cosmos-sdk 0.46
message QuerySubspacesResponse {
  repeated Subspace subspaces = 1;
}

// Subspace defines a parameter subspace name and all the keys that exist for
// the subspace.
//
// Since: cosmos-sdk 0.46
message Subspace {
  string          subspace = 1;
  repeated string keys     = 2;
}
