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

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

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

// Params defines the set of params for the msgfees module.
// Deprecated: The msgfees module is deprecated in favor of flatfees.
// This type is no longer used.
message Params {
  option deprecated        = true;
  option (gogoproto.equal) = false;

  // floor_gas_price is the constant used to calculate fees when gas fees shares denom with msg fee.
  //
  // Conversions:
  //   - x nhash/usd-mil = 1,000,000/x usd/hash
  //   - y usd/hash = 1,000,000/y nhash/usd-mil
  //
  // Examples:
  //   - 40,000,000 nhash/usd-mil = 1,000,000/40,000,000 usd/hash = $0.025/hash,
  //   - $0.040/hash = 1,000,000/0.040 nhash/usd-mil = 25,000,000 nhash/usd-mil
  cosmos.base.v1beta1.Coin floor_gas_price = 2 [(gogoproto.nullable) = false];
  // nhash_per_usd_mil is the total nhash per usd mil for converting usd to nhash.
  uint64 nhash_per_usd_mil = 3;
  // conversion_fee_denom is the denom usd is converted to.
  string conversion_fee_denom = 4;
}

// MsgFee is the core of what gets stored on the blockchain to define a msg-based fee.
// Deprecated: The msgfees module is deprecated in favor of flatfees.
message MsgFee {
  option deprecated = true;

  // msg_type_url is the type-url of the message with the added fee, e.g. "/cosmos.bank.v1beta1.MsgSend".
  string msg_type_url = 1;
  // additional_fee is the extra fee that is required for the given message type (can be in any denom).
  cosmos.base.v1beta1.Coin additional_fee = 2 [(gogoproto.nullable) = false];
  // recipient is an option address that will receive a portion of the additional fee.
  // There can only be a recipient if the recipient_basis_points is not zero.
  string recipient = 3;
  // recipient_basis_points is an optional portion of the additional fee to be sent to the recipient.
  // Must be between 0 and 10,000 (inclusive).
  //
  // If there is a recipient, this must not be zero. If there is not a recipient, this must be zero.
  //
  // The recipient will receive additional_fee * recipient_basis_points / 10,000.
  // The fee collector will receive the rest, i.e. additional_fee * (10,000 - recipient_basis_points) / 10,000.
  uint32 recipient_basis_points = 4;
}

// EventMsgFee final event property for msg fee on type
// Deprecated: The msgfees module is deprecated in favor of flatfees.
message EventMsgFee {
  option deprecated = true;

  string msg_type  = 1;
  string count     = 2;
  string total     = 3;
  string recipient = 4;
}

// EventMsgFees event emitted with summary of msg fees
// Deprecated: The msgfees module is deprecated in favor of flatfees.
message EventMsgFees {
  option deprecated = true;

  repeated EventMsgFee msg_fees = 1 [(gogoproto.nullable) = false];
}
