syntax = "proto3";

package ibc.core.port.v1;

option go_package = "github.com/cosmos/ibc-go/v2/modules/core/05-port/types";

import "ibc/core/channel/v1/channel.proto";

// Query defines the gRPC querier service
service Query {
  // AppVersion queries an IBC Port and determines the appropriate application version to be used
  rpc AppVersion(QueryAppVersionRequest) returns (QueryAppVersionResponse) {}
}

// QueryAppVersionRequest is the request type for the Query/AppVersion RPC method
message QueryAppVersionRequest {
  // port unique identifier
  string port_id = 1;
  // connection unique identifier
  string connection_id = 2;
  // whether the channel is ordered or unordered
  ibc.core.channel.v1.Order ordering = 3;
  // counterparty channel end
  ibc.core.channel.v1.Counterparty counterparty = 4;
  // proposed version
  string proposed_version = 5;
}

// QueryAppVersionResponse is the response type for the Query/AppVersion RPC method.
message QueryAppVersionResponse {
  // port id associated with the request identifiers
  string port_id = 1;
  // supported app version
  string version = 2;
}
