syntax = "proto3";
package sentinel.provider.v2;

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "sentinel/types/v1/status.proto";
import "sentinel/provider/v2/params.proto";
import "sentinel/provider/v2/provider.proto";

option go_package = "github.com/sentinel-official/hub/x/provider/types";
option (gogoproto.equal_all)           = false;
option (gogoproto.goproto_getters_all) = false;

message QueryProvidersRequest {
  cosmos.base.query.v1beta1.PageRequest pagination = 1;
  sentinel.types.v1.Status status                  = 2;
}

message QueryProviderRequest { string address = 1; }

message QueryParamsRequest {}

message QueryProvidersResponse {
  repeated Provider providers = 1 [ (gogoproto.nullable) = false ];
  cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryProviderResponse {
  Provider provider = 1 [ (gogoproto.nullable) = false ];
}

message QueryParamsResponse {
  Params params = 1 [ (gogoproto.nullable) = false ];
}

service QueryService {
  rpc QueryProviders(QueryProvidersRequest) returns (QueryProvidersResponse) {
    option (google.api.http).get = "/sentinel/providers";
  }

  rpc QueryProvider(QueryProviderRequest) returns (QueryProviderResponse) {
    option (google.api.http).get = "/sentinel/providers/{address}";
  }

  rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) {
    option (google.api.http).get = "/sentinel/params/provider";
  }
}
