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

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

import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";

// Query defines the gRPC querier service for msgfees module.
service Query {
  // CalculateTxFees simulates executing a transaction for estimating gas usage and additional fees.
  // Deprecated: This query is deprecated. It is replaced by the CalculateTxFees query in the x/flatfees module.
  // This query endpoint will be removed in a future release.
  rpc CalculateTxFees(CalculateTxFeesRequest) returns (CalculateTxFeesResponse) {
    option (google.api.http) = {
      post: "/provenance/tx/v1/calculate_msg_based_fee"
      body: "*"
    };
  }
}

// CalculateTxFeesRequest is the request type for the Query RPC method.
// Deprecated: This query is deprecated. It is replaced by the CalculateTxFees query in the x/flatfees module.
// This query endpoint will be removed in a future release.
message CalculateTxFeesRequest {
  // tx_bytes is the transaction to simulate.
  bytes tx_bytes = 1;
  // default_base_denom used to be the denom used for gas fees.
  // Deprecated: This field is now ignored. The fees will be in the appropriate denomination(s) automatically.
  string default_base_denom = 2;
  // gas_adjustment is the adjustment factor to be multiplied against the estimate gas returned by the tx simulation.
  // This only affects the returned gas (since the fee is flat).
  float gas_adjustment = 3;
}

// CalculateTxFeesResponse is the response type for the Query RPC method.
// Deprecated: This query is deprecated. It is replaced by the CalculateTxFees query in the x/flatfees module.
// This query endpoint will be removed in a future release.
message CalculateTxFeesResponse {
  // additional_fees are the amount of coins to be for addition msg fees
  // Deprecated: This field will always be empty
  repeated cosmos.base.v1beta1.Coin additional_fees = 1 [
    (gogoproto.nullable)     = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (amino.dont_omitempty)   = true,
    (amino.encoding)         = "legacy_coins"
  ];
  // total_fees are the total amount of fees needed for the transactions (msg fees + gas fee)
  // note: the gas fee is calculated with the floor gas price module param.
  repeated cosmos.base.v1beta1.Coin total_fees = 2 [
    (gogoproto.nullable)     = false,
    (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
    (amino.dont_omitempty)   = true,
    (amino.encoding)         = "legacy_coins"
  ];
  // estimated_gas is the amount of gas needed for the transaction
  uint64 estimated_gas = 3;
}