syntax = "proto3";
package wormhole_foundation.wormchain.wormhole;

import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "wormhole/guardian.proto";
import "wormhole/config.proto";
import "wormhole/replay_protection.proto";
import "wormhole/sequence_counter.proto";
import "wormhole/consensus_guardian_set_index.proto";
// this line is used by starport scaffolding # 1
import "gogoproto/gogo.proto";

option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types";

// Query defines the gRPC querier service.
service Query {
    // Queries a guardianSet by index.
	rpc GuardianSet(QueryGetGuardianSetRequest) returns (QueryGetGuardianSetResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardianSet/{index}";
	}

	// Queries a list of guardianSet items.
	rpc GuardianSetAll(QueryAllGuardianSetRequest) returns (QueryAllGuardianSetResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardianSet";
	}

// Queries a config by index.
	rpc Config(QueryGetConfigRequest) returns (QueryGetConfigResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/config";
	}
// Queries a replayProtection by index.
	rpc ReplayProtection(QueryGetReplayProtectionRequest) returns (QueryGetReplayProtectionResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/replayProtection/{index}";
	}

	// Queries a list of replayProtection items.
	rpc ReplayProtectionAll(QueryAllReplayProtectionRequest) returns (QueryAllReplayProtectionResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/replayProtection";
	}

// Queries a sequenceCounter by index.
	rpc SequenceCounter(QueryGetSequenceCounterRequest) returns (QueryGetSequenceCounterResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/sequenceCounter/{index}";
	}

	// Queries a list of sequenceCounter items.
	rpc SequenceCounterAll(QueryAllSequenceCounterRequest) returns (QueryAllSequenceCounterResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/sequenceCounter";
	}

// Queries a ConsensusGuardianSetIndex by index.
	rpc ConsensusGuardianSetIndex(QueryGetConsensusGuardianSetIndexRequest) returns (QueryGetConsensusGuardianSetIndexResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/consensus_guardian_set_index";
	}
// Queries a GuardianValidator by index.
	rpc GuardianValidator(QueryGetGuardianValidatorRequest) returns (QueryGetGuardianValidatorResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardian_validator/{guardianKey}";
	}

	// Queries a list of GuardianValidator items.
	rpc GuardianValidatorAll(QueryAllGuardianValidatorRequest) returns (QueryAllGuardianValidatorResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/guardian_validator";
	}

// Queries a list of LatestGuardianSetIndex items.
	rpc LatestGuardianSetIndex(QueryLatestGuardianSetIndexRequest) returns (QueryLatestGuardianSetIndexResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/latest_guardian_set_index";
	}

	rpc AllowlistAll(QueryAllValidatorAllowlist) returns (QueryAllValidatorAllowlistResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/allowlist";
	}

	rpc Allowlist(QueryValidatorAllowlist) returns (QueryValidatorAllowlistResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/allowlist/{validator_address}";
	}

	rpc IbcComposabilityMwContract(QueryIbcComposabilityMwContractRequest) returns (QueryIbcComposabilityMwContractResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/ibc_composability_mw_contract";
	}

	rpc WasmInstantiateAllowlistAll(QueryAllWasmInstantiateAllowlist) returns (QueryAllWasmInstantiateAllowlistResponse) {
		option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/wasm_instantiate_allowlist";
	}

// this line is used by starport scaffolding # 2
}

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

// all allowlisted entries by all validators
message QueryAllValidatorAllowlistResponse {
	repeated ValidatorAllowedAddress allowlist = 1;
	cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryValidatorAllowlist {
	string validator_address = 1;
	cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// all allowlisted entries by a specific validator
message QueryValidatorAllowlistResponse {
	string validator_address = 1;
	repeated ValidatorAllowedAddress allowlist = 2;
	cosmos.base.query.v1beta1.PageResponse pagination = 3;
}

message QueryGetGuardianSetRequest {
	uint32 index = 1;
}

message QueryGetGuardianSetResponse {
	GuardianSet GuardianSet = 1 [(gogoproto.nullable) = false];
}

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

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

message QueryGetConfigRequest {}

message QueryGetConfigResponse {
	Config Config = 1 [(gogoproto.nullable) = false];
}
message QueryGetReplayProtectionRequest {
	  string index = 1;

}

message QueryGetReplayProtectionResponse {
	ReplayProtection replayProtection = 1 [(gogoproto.nullable) = false];
}

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

message QueryAllReplayProtectionResponse {
	repeated ReplayProtection replayProtection = 1 [(gogoproto.nullable) = false];
	cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetSequenceCounterRequest {
	  string index = 1;

}

message QueryGetSequenceCounterResponse {
	SequenceCounter sequenceCounter = 1 [(gogoproto.nullable) = false];
}

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

message QueryAllSequenceCounterResponse {
	repeated SequenceCounter sequenceCounter = 1 [(gogoproto.nullable) = false];
	cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetConsensusGuardianSetIndexRequest {}

message QueryGetConsensusGuardianSetIndexResponse {
	ConsensusGuardianSetIndex ConsensusGuardianSetIndex = 1 [(gogoproto.nullable) = false];
}
message QueryGetGuardianValidatorRequest {
	  bytes guardianKey = 1;

}

message QueryGetGuardianValidatorResponse {
	GuardianValidator guardianValidator = 1 [(gogoproto.nullable) = false];
}

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

message QueryAllGuardianValidatorResponse {
	repeated GuardianValidator guardianValidator = 1 [(gogoproto.nullable) = false];
	cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryLatestGuardianSetIndexRequest {
}

message QueryLatestGuardianSetIndexResponse {
  uint32 latestGuardianSetIndex = 1;
}

message QueryIbcComposabilityMwContractRequest {
}

message QueryIbcComposabilityMwContractResponse {
	string contractAddress = 1;
}

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

// all allowlisted entries by all validators
message QueryAllWasmInstantiateAllowlistResponse {
	repeated WasmInstantiateAllowedContractCodeId allowlist = 1 [(gogoproto.nullable) = false];
	cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// this line is used by starport scaffolding # 3
