syntax = "proto3";
package neutron.harpoon;

import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "neutron/harpoon/hooks.proto";

option go_package = "github.com/neutron-org/neutron/v7/x/harpoon/types";

// Defines the Msg interface of the module.
service Msg {
  option (cosmos.msg.v1.service) = true;

  // Updates hook subscriptions for a specific contract address.
  // To remove a subscription, pass an empty array to `hook_subscription.hooks`.
  // Can only be executed by the module's authority.
  rpc ManageHookSubscription(MsgManageHookSubscription) returns (MsgManageHookSubscriptionResponse);
}

// Defines the Msg/ManageHookSubscription request type.
message MsgManageHookSubscription {
  option (cosmos.msg.v1.signer) = "authority";
  option (amino.name) = "harpoon/MsgManageHookSubscription";

  // Address of the governance account.
  string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

  // Hook subscription to be updated.
  HookSubscription hook_subscription = 2;
}

// Defines the response structure for executing a MsgManageHookSubscription message.
message MsgManageHookSubscriptionResponse {}

// Specifies new hook subscriptions for the contract_address.
message HookSubscription {
  // Contract address to update subscriptions for.
  string contract_address = 2;

  // List of hooks to subscribe to. Hooks not listed here will be removed.
  repeated HookType hooks = 3;
}
