syntax = "proto3";
package provenance.flatfees.v1;

option go_package          = "github.com/provenance-io/provenance/x/flatfees/types";
option java_package        = "io.provenance.flatfees.v1";
option java_multiple_files = true;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "provenance/flatfees/v1/flatfees.proto";

// Msg defines the flatfees Msg service.
service Msg {
  option (cosmos.msg.v1.service) = true;

  // UpdateParams is a governance endpoint for updating the x/flatfees params.
  rpc UpdateParams(MsgUpdateParamsRequest) returns (MsgUpdateParamsResponse);

  // UpdateConversionFactor is a governance endpoint for updating just the conversion factor in the x/flatfees params.
  rpc UpdateConversionFactor(MsgUpdateConversionFactorRequest) returns (MsgUpdateConversionFactorResponse);

  // UpdateMsgFees is a governance endpoint for updating fees for specific msgs.
  rpc UpdateMsgFees(MsgUpdateMsgFeesRequest) returns (MsgUpdateMsgFeesResponse);

  // AddOracleAddress is a governance endpoint for adding an oracle address that can update the conversion factor.
  rpc AddOracleAddress(MsgAddOracleAddressRequest) returns (MsgAddOracleAddressResponse);

  // RemoveOracleAddress is a governance endpoint for removing an oracle address.
  rpc RemoveOracleAddress(MsgRemoveOracleAddressRequest) returns (MsgRemoveOracleAddressResponse);
}

// MsgUpdateParamsRequest is the request for the UpdateParams governance endpoint.
message MsgUpdateParamsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority should be the governance module account address.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // params are the new param values to set.
  Params params = 2 [(gogoproto.nullable) = false];
}

// MsgUpdateParamsResponse is the response for the UpdateParams governance endpoint.
message MsgUpdateParamsResponse {}

// MsgUpdateConversionFactorRequest is the request for the UpdateConversionFactor governance endpoint.
message MsgUpdateConversionFactorRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority should be either the governance module account address or an oracle address.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // conversion_factor is the new conversion factor that should be used.
  ConversionFactor conversion_factor = 2 [(gogoproto.nullable) = false];
}

// MsgUpdateConversionFactorResponse is the response for the UpdateConversionFactor governance endpoint.
message MsgUpdateConversionFactorResponse {}

// MsgUpdateMsgFeesRequest is the request for the UpdateMsgFees governance endpoint.
message MsgUpdateMsgFeesRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority should be the governance module account address.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // to_set is the list of msg fees to create and/or update.
  repeated MsgFee to_set = 2;
  // to_unset is the list of msg-type-urls that should have their msg fee entries
  // deleted (they'll go back to using the default cost).
  repeated string to_unset = 3;
}

// MsgUpdateMsgFeesResponse is the response for the UpdateMsgFees governance endpoint.
message MsgUpdateMsgFeesResponse {}

// MsgAddOracleAddressRequest is the request for the AddOracleAddress governance endpoint.
message MsgAddOracleAddressRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority should be the governance module account address.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // oracle_address is the address to be added to the oracle list.
  string oracle_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgAddOracleAddressResponse is the response for the AddOracleAddress governance endpoint.
message MsgAddOracleAddressResponse {}

// MsgRemoveOracleAddressRequest is the request for the RemoveOracleAddress governance endpoint.
message MsgRemoveOracleAddressRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority should be the governance module account address.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // oracle_address is the address to be removed from the oracle list.
  string oracle_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgRemoveOracleAddressResponse is the response for the RemoveOracleAddress governance endpoint.
message MsgRemoveOracleAddressResponse {}