syntax = "proto3";
package provlabs.vault.v1;

import "cosmos/bank/v1beta1/bank.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "provlabs/vault/v1/params.proto";

option go_package = "github.com/provlabs/vault/types";

// Msg is the service for the vault module's tx endpoints.
service Msg {
  option (cosmos.msg.v1.service) = true;

  // CreateVault creates a new vault.
  // Must be signed by the governance module account, so vaults can only be created
  // through a passed governance proposal.
  rpc CreateVault(MsgCreateVaultRequest) returns (MsgCreateVaultResponse);

  // SetShareDenomMetadata allows Denom Metadata (see bank module) to be set for the vault's share denom.
  // Similar to marker's SetDenomMetadata, but scoped to a specific vault. Only the vault admin may call this.
  rpc SetShareDenomMetadata(MsgSetShareDenomMetadataRequest) returns (MsgSetShareDenomMetadataResponse);

  // SwapIn exchanges underlying assets for vault shares by depositing them into a vault.
  rpc SwapIn(MsgSwapInRequest) returns (MsgSwapInResponse);

  // SwapOut exchanges vault shares for underlying assets by withdrawing from a vault.
  rpc SwapOut(MsgSwapOutRequest) returns (MsgSwapOutResponse);

  // UpdateMinInterestRate sets the minimum allowed annual interest rate for a vault.
  rpc UpdateMinInterestRate(MsgUpdateMinInterestRateRequest) returns (MsgUpdateMinInterestRateResponse);

  // UpdateMaxInterestRate sets the maximum allowed annual interest rate for a vault.
  rpc UpdateMaxInterestRate(MsgUpdateMaxInterestRateRequest) returns (MsgUpdateMaxInterestRateResponse);

  // UpdateInterestRate allows the interest admin to update the current annual interest rate within limits.
  rpc UpdateInterestRate(MsgUpdateInterestRateRequest) returns (MsgUpdateInterestRateResponse);

  // UpdateWithdrawalDelay allows updating the withdrawal delay for a vault.
  rpc UpdateWithdrawalDelay(MsgUpdateWithdrawalDelayRequest) returns (MsgUpdateWithdrawalDelayResponse);

  // UpdateMinSwapInValue sets the minimum allowed value for a swap-in operation.
  rpc UpdateMinSwapInValue(MsgUpdateMinSwapInValueRequest) returns (MsgUpdateMinSwapInValueResponse);

  // UpdateMinSwapOutValue sets the minimum allowed value for a swap-out operation.
  rpc UpdateMinSwapOutValue(MsgUpdateMinSwapOutValueRequest) returns (MsgUpdateMinSwapOutValueResponse);

  // UpdateMaxSwapInValue sets the maximum allowed value for a swap-in operation.
  rpc UpdateMaxSwapInValue(MsgUpdateMaxSwapInValueRequest) returns (MsgUpdateMaxSwapInValueResponse);

  // UpdateMaxSwapOutValue sets the maximum allowed value for a swap-out operation.
  rpc UpdateMaxSwapOutValue(MsgUpdateMaxSwapOutValueRequest) returns (MsgUpdateMaxSwapOutValueResponse);

  // ToggleSwapIn allows enabling or disabling swap-in operations for a vault.
  rpc ToggleSwapIn(MsgToggleSwapInRequest) returns (MsgToggleSwapInResponse);

  // ToggleSwapOut allows enabling or disabling swap-out operations for a vault.
  rpc ToggleSwapOut(MsgToggleSwapOutRequest) returns (MsgToggleSwapOutResponse);

  // DepositInterestFunds allows depositing funds into the vault for paying interest.
  // May be signed by the vault admin or the configured asset manager.
  rpc DepositInterestFunds(MsgDepositInterestFundsRequest) returns (MsgDepositInterestFundsResponse);

  // WithdrawInterestFunds allows withdrawing unused interest funds.
  // May be signed by the vault admin or the configured asset manager.
  rpc WithdrawInterestFunds(MsgWithdrawInterestFundsRequest) returns (MsgWithdrawInterestFundsResponse);

  // DepositPrincipalFunds allows depositing principal funds into a vault.
  // May be signed by the vault admin or the configured asset manager.
  rpc DepositPrincipalFunds(MsgDepositPrincipalFundsRequest) returns (MsgDepositPrincipalFundsResponse);

  // WithdrawPrincipalFunds allows withdrawing principal funds from a vault.
  // May be signed by the vault admin or the configured asset manager.
  rpc WithdrawPrincipalFunds(MsgWithdrawPrincipalFundsRequest) returns (MsgWithdrawPrincipalFundsResponse);

  // ExpeditePendingSwapOut expedites a pending swap out from a vault.
  rpc ExpeditePendingSwapOut(MsgExpeditePendingSwapOutRequest) returns (MsgExpeditePendingSwapOutResponse);

  // PauseVault pauses user-facing swap operations for a vault and records a reason.
  // May be signed by the vault admin or the configured asset manager.
  rpc PauseVault(MsgPauseVaultRequest) returns (MsgPauseVaultResponse);

  // UnpauseVault re-enables user-facing swap operations for a vault.
  // May be signed by the vault admin or the configured asset manager.
  rpc UnpauseVault(MsgUnpauseVaultRequest) returns (MsgUnpauseVaultResponse);

  // SetBridgeAddress sets the single external bridge address allowed to mint or burn shares for a vault.
  rpc SetBridgeAddress(MsgSetBridgeAddressRequest) returns (MsgSetBridgeAddressResponse);

  // ToggleBridge enables or disables the bridge functionality for a vault.
  rpc ToggleBridge(MsgToggleBridgeRequest) returns (MsgToggleBridgeResponse);

  // BridgeMintShares mints local share marker supply for a vault; must be signed by the configured bridge address.
  rpc BridgeMintShares(MsgBridgeMintSharesRequest) returns (MsgBridgeMintSharesResponse);

  // BridgeBurnShares burns local share marker supply for a vault; must be signed by the configured bridge address.
  rpc BridgeBurnShares(MsgBridgeBurnSharesRequest) returns (MsgBridgeBurnSharesResponse);

  // SetAssetManager sets or clears the optional asset manager address for a vault.
  // The vault admin must sign this transaction. Passing an empty address clears it.
  rpc SetAssetManager(MsgSetAssetManagerRequest) returns (MsgSetAssetManagerResponse);

  // UpdateParams updates the module parameters.
  rpc UpdateParams(MsgUpdateParamsRequest) returns (MsgUpdateParamsResponse);

  // UpdateVaultAUMFeeBips updates the AUM fee bips for a specific vault.
  rpc UpdateVaultAUMFeeBips(MsgUpdateVaultAUMFeeBipsRequest) returns (MsgUpdateVaultAUMFeeBipsResponse);

  // UpdateVaultNAV creates or updates a vault's internal net asset value entry for a denom.
  // Must be signed by the vault's NAV authority.
  rpc UpdateVaultNAV(MsgUpdateVaultNAVRequest) returns (MsgUpdateVaultNAVResponse);

  // RemoveVaultNAV deletes a vault's internal net asset value entry for a denom the vault
  // does not hold, revoking the authorization to acquire it at that price.
  // Must be signed by the vault's NAV authority.
  rpc RemoveVaultNAV(MsgRemoveVaultNAVRequest) returns (MsgRemoveVaultNAVResponse);

  // UpdateNAVAuthority rotates the address authorized to mutate a vault's internal NAV table.
  // Must be signed by the vault admin.
  rpc UpdateNAVAuthority(MsgUpdateNAVAuthorityRequest) returns (MsgUpdateNAVAuthorityResponse);

  // AcceptAsset settles a pending exchange-module payment whose target is the vault,
  // exchanging an external asset for the vault's underlying asset.
  // Must be signed by the vault's asset manager; the admin cannot settle.
  rpc AcceptAsset(MsgAcceptAssetRequest) returns (MsgAcceptAssetResponse);

  // RejectAsset declines a pending exchange-module payment whose target is the vault,
  // causing the exchange module to cancel it and refund the source's escrow.
  // Must be signed by the vault's asset manager; the admin cannot reject.
  rpc RejectAsset(MsgRejectAssetRequest) returns (MsgRejectAssetResponse);
}

// MsgCreateVaultRequest is the request message for the CreateVault endpoint.
// Vault creation is governance-gated: the message must be signed by the governance
// module account, so it can only be executed as part of a passed proposal.
message MsgCreateVaultRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // admin is the initial administrator of the vault. It is designated by the
  // governance proposal and is not required to be the signer.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // share_denom is the name of the assets created by the vault used for distribution.
  string share_denom = 2;
  // underlying_asset is the denomination of the asset supported by the vault.
  string underlying_asset = 3;
  // payment_denom previously configured a secondary accepted denomination.
  // Vaults are single-denom on underlying_asset; if set, this must equal
  // underlying_asset. Retained for wire compatibility with released clients.
  string payment_denom = 4 [deprecated = true];
  // withdrawal_delay_seconds is the time period (in seconds) that a withdrawal
  // must wait in the pending queue before being processed.
  uint64 withdrawal_delay_seconds = 5;
  // min_swap_in_value is the minimum value required for a deposit, measured in the underlying_asset.
  // - Values must be non-negative (>= 0).
  // - An empty string "" or "0" indicates no minimum.
  string min_swap_in_value = 6 [(cosmos_proto.scalar) = "cosmos.IntString"];
  // min_swap_out_value is the minimum value required for a withdrawal, measured in the underlying_asset.
  // - Values must be non-negative (>= 0).
  // - An empty string "" or "0" indicates no minimum.
  string min_swap_out_value = 7 [(cosmos_proto.scalar) = "cosmos.IntString"];
  // max_swap_in_value is the maximum value allowed for a deposit, measured in the underlying_asset.
  // - Values must be positive (> 0).
  // - An empty string "" clears the maximum / represents no maximum.
  string max_swap_in_value = 8 [(cosmos_proto.scalar) = "cosmos.IntString"];
  // max_swap_out_value is the maximum value allowed for a withdrawal, measured in the underlying_asset.
  // - Values must be positive (> 0).
  // - An empty string "" indicates no maximum limit.
  string max_swap_out_value = 9 [(cosmos_proto.scalar) = "cosmos.IntString"];
  // authority is the address of the governance module account.
  string authority = 10 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgCreateVaultResponse is the response message for the CreateVault endpoint.
message MsgCreateVaultResponse {
  // vault_address is the bech32 address of the newly created vault.
  string vault_address = 1;
}

// MsgSetShareDenomMetadataRequest defines the request to set bank denom metadata for a vault's share denom.
// The target denom is derived from the vault identified by vault_address.
message MsgSetShareDenomMetadataRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // metadata is the bank module Metadata to assign to the vault's share denom.
  cosmos.bank.v1beta1.Metadata metadata = 1 [
    (gogoproto.nullable) = false,
    (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/x/bank/types.Metadata"
  ];
  // admin is the address of the vault administrator authorizing this update.
  string admin = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault whose share denom metadata is being set.
  string vault_address = 3;
}

// MsgSetShareDenomMetadataResponse defines the response for setting a vault's share denom metadata.
message MsgSetShareDenomMetadataResponse {}

// MsgSwapInRequest is the request message for depositing underlying assets into a vault in exchange for shares.
message MsgSwapInRequest {
  option (cosmos.msg.v1.signer) = "owner";

  // owner is the address initiating the swap in (deposit).
  string owner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the address of the target vault.
  string vault_address = 2;
  // assets is the amount of underlying assets to deposit.
  cosmos.base.v1beta1.Coin assets = 3 [(gogoproto.nullable) = false];
}

// MsgSwapInResponse is the response message for a successful SwapIn.
message MsgSwapInResponse {
  // shares_received is the amount of vault shares minted to the depositor.
  cosmos.base.v1beta1.Coin shares_received = 1 [(gogoproto.nullable) = false];
}

// MsgSwapOutRequest is the request message for redeeming vault shares in exchange for underlying assets.
message MsgSwapOutRequest {
  option (cosmos.msg.v1.signer) = "owner";

  // owner is the address initiating the swap out (withdraw).
  string owner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the address of the vault to redeem from.
  string vault_address = 2;
  // assets is the amount of underlying assets to withdraw.
  cosmos.base.v1beta1.Coin assets = 3 [(gogoproto.nullable) = false];
  // redeem_denom previously selected the payout coin. The payout is always the
  // vault's underlying_asset; if set, this must equal underlying_asset.
  // Retained for wire compatibility with released clients.
  string redeem_denom = 4 [deprecated = true];
}

// MsgSwapOutResponse is the response message for the SwapOut endpoint.
message MsgSwapOutResponse {
  // request_id is the unique identifier for the newly queued swap out request.
  uint64 request_id = 1;
}

// MsgUpdateMinInterestRateRequest is the request message for updating the minimum interest rate of a vault.
message MsgUpdateMinInterestRateRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // The address of the account authorized to update the minimum interest rate for the vault.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // The bech32 address of the vault whose minimum interest rate is being updated.
  string vault_address = 2;
  // min_rate is the minimum allowable interest rate(APY) for the vault as a decimal string (e.g., "0.9" for 90% and "0.9001353" for 90.01353%).
  // An empty string "" represents no minimum.
  string min_rate = 3;
}

// MsgUpdateMinInterestRateResponse is the response message for the UpdateMinInterestRate endpoint.
message MsgUpdateMinInterestRateResponse {}

// MsgUpdateMaxInterestRateRequest is the request message for updating the maximum interest rate of a vault.
message MsgUpdateMaxInterestRateRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // The address of the account authorized to update the maximum interest rate for the vault.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // The bech32 address of the vault whose maximum interest rate is being updated.
  string vault_address = 2;
  // max_rate is the maximum allowable annual interest rate for the vault as a decimal string (e.g., "0.9" for 90% and "0.9001353" for 90.01353%).
  // An empty string "" represents no maximum.
  string max_rate = 3;
}

// MsgUpdateMaxInterestRateResponse is the response message for the UpdateMaxInterestRate endpoint.
message MsgUpdateMaxInterestRateResponse {}

// MsgUpdateInterestRateRequest is the request message for updating the annual interest rate of a vault.
message MsgUpdateInterestRateRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault administrator or asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // new_rate is the new annual interest rate for the the vault as a decimal string (e.g., "0.9" for 90% and "0.9001353" for 90.01353%).
  string new_rate = 3;
}

// MsgUpdateInterestRateResponse is the response message for the UpdateInterestRate endpoint.
message MsgUpdateInterestRateResponse {}

// MsgUpdateWithdrawalDelayRequest is the request message for updating the withdrawal delay of a vault.
message MsgUpdateWithdrawalDelayRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault admin or asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // withdrawal_delay_seconds is the time period (in seconds) that a withdrawal
  // must wait in the pending queue before being processed.
  uint64 withdrawal_delay_seconds = 3;
}

// MsgUpdateWithdrawalDelayResponse is the response message for the UpdateWithdrawalDelay endpoint.
message MsgUpdateWithdrawalDelayResponse {}

// MsgUpdateMinSwapInValueRequest is the request message for updating the minimum swap-in value of a vault.
message MsgUpdateMinSwapInValueRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the bech32 address of the vault administrator or asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // min_swap_in_value is the minimum value required for a deposit, measured in the underlying_asset.
  // - Values must be non-negative (>= 0).
  // - An empty string "" or "0" clears the minimum / represents no minimum.
  string min_swap_in_value = 3 [(cosmos_proto.scalar) = "cosmos.IntString"];
}

// MsgUpdateMinSwapInValueResponse is the response message for the UpdateMinSwapInValue endpoint.
message MsgUpdateMinSwapInValueResponse {}

// MsgUpdateMinSwapOutValueRequest is the request message for updating the minimum swap-out value of a vault.
message MsgUpdateMinSwapOutValueRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the bech32 address of the vault administrator or asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // min_swap_out_value is the minimum value required for a withdrawal, measured in the underlying_asset.
  // - Values must be non-negative (>= 0).
  // - An empty string "" or "0" clears the minimum / represents no minimum.
  string min_swap_out_value = 3 [(cosmos_proto.scalar) = "cosmos.IntString"];
}

// MsgUpdateMinSwapOutValueResponse is the response message for the UpdateMinSwapOutValue endpoint.
message MsgUpdateMinSwapOutValueResponse {}

// MsgUpdateMaxSwapInValueRequest is the request message for updating the maximum swap-in value of a vault.
message MsgUpdateMaxSwapInValueRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the bech32 address of the vault administrator or asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // max_swap_in_value is the maximum value allowed for a deposit, measured in the underlying_asset.
  // - Values must be positive (> 0).
  // - An empty string "" clears the maximum / represents no maximum.
  string max_swap_in_value = 3 [(cosmos_proto.scalar) = "cosmos.IntString"];
}

// MsgUpdateMaxSwapInValueResponse is the response message for the UpdateMaxSwapInValue endpoint.
message MsgUpdateMaxSwapInValueResponse {}

// MsgUpdateMaxSwapOutValueRequest is the request message for updating the maximum swap-out value of a vault.
message MsgUpdateMaxSwapOutValueRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the bech32 address of the vault administrator or asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // max_swap_out_value is the maximum value allowed for a withdrawal, measured in the underlying_asset.
  // - Values must be positive (> 0).
  // - An empty string "" clears the maximum / represents no maximum.
  string max_swap_out_value = 3 [(cosmos_proto.scalar) = "cosmos.IntString"];
}

// MsgUpdateMaxSwapOutValueResponse is the response message for the UpdateMaxSwapOutValue endpoint.
message MsgUpdateMaxSwapOutValueResponse {}

// MsgToggleSwapInRequest is the request message for enabling or disabling swap-in operations for a vault.
message MsgToggleSwapInRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // admin is the address of the vault administrator.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // enabled specifies whether swap-in operations should be enabled (true) or disabled (false).
  bool enabled = 3;
}

// MsgToggleSwapInResponse is the response message for the ToggleSwapIn endpoint.
message MsgToggleSwapInResponse {}

// MsgToggleSwapOutRequest is the request message for enabling or disabling swap-out operations for a vault.
message MsgToggleSwapOutRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // admin is the address of the vault administrator.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault.
  string vault_address = 2;
  // enabled specifies whether swap-out operations should be enabled (true) or disabled (false).
  bool enabled = 3;
}

// MsgToggleSwapOutResponse is the response message for the ToggleSwapOut endpoint.
message MsgToggleSwapOutResponse {}

// MsgDepositInterestFundsRequest is the request message for depositing funds to be used for paying interest.
message MsgDepositInterestFundsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the account depositing the funds.
  // Must match either the vault admin or the configured asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to which funds are being deposited.
  string vault_address = 2;
  // amount is the amount of funds to deposit.
  cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

// MsgDepositInterestFundsResponse is the response message for the DepositInterestFunds endpoint.
message MsgDepositInterestFundsResponse {}

// MsgWithdrawInterestFundsRequest is the request message for withdrawing unused interest funds.
message MsgWithdrawInterestFundsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault administrator or asset manager initiating the withdrawal.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault from which funds are being withdrawn.
  string vault_address = 2;
  // amount is the amount of funds to withdraw.
  cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

// MsgWithdrawInterestFundsResponse is the response message for the WithdrawInterestFunds endpoint.
message MsgWithdrawInterestFundsResponse {}

// MsgDepositPrincipalFundsRequest is the request message for depositing principal funds into a vault.
message MsgDepositPrincipalFundsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the account depositing the funds.
  // Must match either the vault admin or the configured asset manager.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to which funds are being deposited.
  string vault_address = 2;
  // amount is the amount of funds to deposit.
  cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

// MsgDepositPrincipalFundsResponse is the response message for the DepositPrincipalFunds endpoint.
message MsgDepositPrincipalFundsResponse {}

// MsgWithdrawPrincipalFundsRequest is the request message for withdrawing principal funds from a vault.
message MsgWithdrawPrincipalFundsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault administrator or asset manager initiating the withdrawal.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault from which funds are being withdrawn.
  string vault_address = 2;
  // amount is the amount of funds to withdraw.
  cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
}

// MsgWithdrawPrincipalFundsResponse is the response message for the WithdrawPrincipalFunds endpoint.
message MsgWithdrawPrincipalFundsResponse {}

// MsgExpeditePendingSwapOutRequest is the request message for expediting a swap out from a vault.
message MsgExpeditePendingSwapOutRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault admin or asset manager initiating the expedite.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // request_id is the id of the pending swap out to expedite.
  uint64 request_id = 2;
}

// MsgExpeditePendingSwapOutResponse is the response message for the ExpeditePendingSwapOut endpoint.
message MsgExpeditePendingSwapOutResponse {}

// MsgPauseVaultRequest is the request message to pause a vault. When processed,
// the vault disables user-facing swap operations and records the provided reason.
message MsgPauseVaultRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault administrator or asset manager initiating the pause.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to pause.
  string vault_address = 2;
  // reason is a human-readable explanation for pausing the vault. This is recorded
  // for operators and clients to understand the context (e.g., maintenance or anomaly).
  string reason = 3;
  // force, when true, allows the pause to proceed even if the pre-pause
  // reconcile or vault valuation fails. The pause is applied best-effort:
  // tolerated failures are logged and surfaced on EventVaultPaused, and
  // PausedBalance may be the net TVV, zero (when valuation itself failed), or
  // otherwise approximate. When false (default), any reconcile or valuation
  // failure aborts the pause and the vault remains unpaused.
  bool force = 4;
}

// MsgPauseVaultResponse is the response message for the PauseVault endpoint.
message MsgPauseVaultResponse {}

// MsgUnpauseVaultRequest is the request message to unpause a vault. When processed,
// the vault re-enables user-facing swap operations (subject to existing flags).
message MsgUnpauseVaultRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault administrator or asset manager initiating the unpause.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to unpause.
  string vault_address = 2;
}

// MsgUnpauseVaultResponse is the response message for the UnpauseVault endpoint.
message MsgUnpauseVaultResponse {}

// MsgSetBridgeAddressRequest is the request message for configuring the bridge address for a vault.
message MsgSetBridgeAddressRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // admin is the address of the vault administrator.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to update.
  string vault_address = 2;
  // bridge_address is the single external address allowed to mint or burn shares on behalf of this vault.
  string bridge_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgSetBridgeAddressResponse is the response message for the SetBridgeAddress endpoint.
message MsgSetBridgeAddressResponse {}

// MsgToggleBridgeRequest is the request message for enabling or disabling the bridge for a vault.
message MsgToggleBridgeRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // admin is the address of the vault administrator.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to update.
  string vault_address = 2;
  // enabled indicates whether bridge operations are allowed.
  bool enabled = 3;
}

// MsgToggleBridgeResponse is the response message for the ToggleBridge endpoint.
message MsgToggleBridgeResponse {}

// MsgBridgeMintSharesRequest is the request message for minting local share marker supply; must be signed by the configured bridge address.
message MsgBridgeMintSharesRequest {
  option (cosmos.msg.v1.signer) = "bridge";

  // bridge is the signer and must match the vault's configured bridge_address.
  string bridge = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault whose local share marker supply will be increased.
  string vault_address = 2;
  // shares is the amount of shares to mint into local marker supply.
  cosmos.base.v1beta1.Coin shares = 3 [(gogoproto.nullable) = false];
}

// MsgBridgeMintSharesResponse is the response message for the BridgeMintShares endpoint.
message MsgBridgeMintSharesResponse {}

// MsgBridgeBurnSharesRequest is the request message for burning local share marker supply; must be signed by the configured bridge address.
message MsgBridgeBurnSharesRequest {
  option (cosmos.msg.v1.signer) = "bridge";

  // bridge is the signer and must match the vault's configured bridge_address.
  string bridge = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault whose local share marker supply will be decreased.
  string vault_address = 2;
  // shares is the amount of shares to burn from local marker supply.
  cosmos.base.v1beta1.Coin shares = 3 [(gogoproto.nullable) = false];
}

// MsgBridgeBurnSharesResponse is the response message for the BridgeBurnShares endpoint.
message MsgBridgeBurnSharesResponse {}

// MsgSetAssetManagerRequest sets or clears the optional asset manager address for a vault.
message MsgSetAssetManagerRequest {
  option (cosmos.msg.v1.signer) = "admin";

  // admin is the address of the vault administrator.
  string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to update.
  string vault_address = 2;
  // asset_manager is the address that will be allowed to manage certain vault operations alongside the admin.
  // Passing an empty string clears any configured asset manager.
  string asset_manager = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgSetAssetManagerResponse is the response message for the SetAssetManager endpoint.
message MsgSetAssetManagerResponse {}

// MsgUpdateParamsRequest is the request message for updating the module parameters.
message MsgUpdateParamsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the governance module account.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // params defines the vault module parameters to update.
  Params params = 2 [(gogoproto.nullable) = false];
}

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

// MsgUpdateVaultAUMFeeBipsRequest is the request message for updating the AUM fee bips for a specific vault.
message MsgUpdateVaultAUMFeeBipsRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the tech fee address authorized to update per-vault bips.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault to update.
  string vault_address = 2;
  // aum_fee_bips is the new fee rate (in basis points) for the vault.
  // The value must be between 0 and 10,000 (inclusive), where 10,000 represents 100%.
  uint32 aum_fee_bips = 3;
}

// MsgUpdateVaultAUMFeeBipsResponse is the response message for the UpdateVaultAUMFeeBips endpoint.
message MsgUpdateVaultAUMFeeBipsResponse {}

// MsgUpdateVaultNAVRequest is the request message for creating or updating a vault's internal NAV entry.
message MsgUpdateVaultNAVRequest {
  option (cosmos.msg.v1.signer) = "signer";

  // signer is the address of the vault's NAV authority authorizing this update.
  string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault whose NAV entry is being updated.
  string vault_address = 2;
  // denom is the asset denomination being priced. It must not be the vault's
  // share denom.
  string denom = 3;
  // price is the total value of `volume` units of the denom, denominated in
  // the vault's underlying asset.
  cosmos.base.v1beta1.Coin price = 4 [(gogoproto.nullable) = false];
  // volume is the number of units of the denom that price covers. It must be positive.
  string volume = 5 [
    (cosmos_proto.scalar) = "cosmos.Int",
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
  // source identifies the origin of this NAV update (for example an oracle name).
  // It is optional.
  string source = 6;
}

// MsgUpdateVaultNAVResponse is the response message for the UpdateVaultNAV endpoint.
message MsgUpdateVaultNAVResponse {}

// MsgRemoveVaultNAVRequest is the request message for deleting a vault's internal NAV
// entry for a denom. Only entries for denoms the vault does not hold may be removed; a
// held asset is written down through UpdateVaultNAV instead, so that its value stays
// accounted for.
message MsgRemoveVaultNAVRequest {
  option (cosmos.msg.v1.signer) = "signer";

  // signer is the address of the vault's NAV authority authorizing this removal.
  string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault whose NAV entry is being removed.
  string vault_address = 2;
  // denom is the asset denomination whose NAV entry is being removed.
  string denom = 3;
}

// MsgRemoveVaultNAVResponse is the response message for the RemoveVaultNAV endpoint.
message MsgRemoveVaultNAVResponse {}

// MsgUpdateNAVAuthorityRequest is the request message for rotating a vault's NAV authority.
message MsgUpdateNAVAuthorityRequest {
  option (cosmos.msg.v1.signer) = "signer";

  // signer is the address of the vault administrator authorizing this rotation.
  string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault whose NAV authority is being rotated.
  string vault_address = 2;
  // new_authority is the address that will be authorized to mutate the vault's internal NAV table.
  string new_authority = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// MsgUpdateNAVAuthorityResponse is the response message for the UpdateNAVAuthority endpoint.
message MsgUpdateNAVAuthorityResponse {}

// MsgAcceptAssetRequest is the request message for settling a pending exchange-module
// payment whose target is the vault. The payment is identified by its source account and
// external_id. The vault settles only payments where one leg is the vault's underlying
// asset; the settlement direction (inbound or outbound) is derived from which leg that is.
message MsgAcceptAssetRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault's asset manager authorizing the settlement.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault, which must be the payment's target.
  string vault_address = 2;
  // source is the bech32 address of the account that created the pending payment.
  string source = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // external_id, together with source, uniquely identifies the pending payment to settle.
  string external_id = 4;
}

// MsgAcceptAssetResponse is the response message for the AcceptAsset endpoint.
message MsgAcceptAssetResponse {}

// MsgRejectAssetRequest is the request message for declining a pending exchange-module
// payment whose target is the vault. The exchange module cancels the payment and refunds
// the source's escrow. The payment is identified by its source account and external_id.
message MsgRejectAssetRequest {
  option (cosmos.msg.v1.signer) = "authority";

  // authority is the address of the vault's asset manager authorizing the rejection.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // vault_address is the bech32 address of the vault, which must be the payment's target.
  string vault_address = 2;
  // source is the bech32 address of the account that created the pending payment.
  string source = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
  // external_id, together with source, uniquely identifies the pending payment to reject.
  string external_id = 4;
}

// MsgRejectAssetResponse is the response message for the RejectAsset endpoint.
message MsgRejectAssetResponse {}
