syntax = "proto3";
package sentinel.swap.v1;

option go_package = "github.com/sentinel-official/hub/x/swap/types";

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

option (gogoproto.equal_all)           = false;
option (gogoproto.goproto_getters_all) = false;

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

message QuerySwapRequest { bytes tx_hash = 1; }

message QueryParamsRequest {}

message QuerySwapsResponse {
  repeated Swap swaps = 1 [ (gogoproto.nullable) = false ];
  cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QuerySwapResponse { Swap swap = 1 [ (gogoproto.nullable) = false ]; }

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

service QueryService {
  rpc QuerySwaps(QuerySwapsRequest) returns (QuerySwapsResponse) {
    option (google.api.http).get = "/sentinel/swaps";
  }

  rpc QuerySwap(QuerySwapRequest) returns (QuerySwapResponse) {
    option (google.api.http).get = "/sentinel/swaps/{tx_hash}";
  }

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