// Generated from IC repo commit 0d3e699 (2026-03-11) 'packages/canisters/src/declarations/sns/governance_test.did.tmp' by import-candid

type Account = record {
  owner : opt principal;
  subaccount : opt Subaccount;
};

type Action = variant {
  ManageNervousSystemParameters : NervousSystemParameters;
  AddGenericNervousSystemFunction : NervousSystemFunction;
  SetTopicsForCustomProposals : SetTopicsForCustomProposals;
  ManageDappCanisterSettings : ManageDappCanisterSettings;
  RemoveGenericNervousSystemFunction : nat64;
  UpgradeSnsToNextVersion : record {};
  AdvanceSnsTargetVersion : AdvanceSnsTargetVersion;
  RegisterDappCanisters : RegisterDappCanisters;
  RegisterExtension : RegisterExtension;
  UpgradeExtension : UpgradeExtension;
  ExecuteExtensionOperation : ExecuteExtensionOperation;
  TransferSnsTreasuryFunds : TransferSnsTreasuryFunds;
  UpgradeSnsControlledCanister : UpgradeSnsControlledCanister;
  DeregisterDappCanisters : DeregisterDappCanisters;
  MintSnsTokens : MintSnsTokens;
  Unspecified : record {};
  ManageSnsMetadata : ManageSnsMetadata;
  ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction;
  ManageLedgerParameters : ManageLedgerParameters;
  Motion : Motion;
};

type ActionAuxiliary = variant {
  TransferSnsTreasuryFunds : MintSnsTokensActionAuxiliary;
  MintSnsTokens : MintSnsTokensActionAuxiliary;
  AdvanceSnsTargetVersion : AdvanceSnsTargetVersionActionAuxiliary;
};

type AddNeuronPermissions = record {
  permissions_to_add : opt NeuronPermissionList;
  principal_id : opt principal;
};

type Amount = record {
  e8s : nat64;
};

type Ballot = record {
  vote : int32;
  cast_timestamp_seconds : nat64;
  voting_power : nat64;
};

type By = variant {
  MemoAndController : MemoAndController;
  NeuronId : record {};
};

type MemoryMetrics = record {
  wasm_memory_size : opt nat;
  stable_memory_size : opt nat;
  global_memory_size : opt nat;
  wasm_binary_size : opt nat;
  custom_sections_size : opt nat;
  canister_history_size : opt nat;
  wasm_chunk_store_size : opt nat;
  snapshots_size : opt nat;
};

type CanisterStatusResultV2 = record {
  status : CanisterStatusType;
  memory_size : nat;
  memory_metrics : opt MemoryMetrics;
  cycles : nat;
  settings : DefiniteCanisterSettingsArgs;
  idle_cycles_burned_per_day : nat;
  module_hash : opt blob;
  query_stats : opt QueryStats;
};

type CanisterStatusType = variant {
  stopped;
  stopping;
  running;
};

type ChangeAutoStakeMaturity = record {
  requested_setting_for_auto_stake_maturity : bool;
};

type ClaimOrRefresh = record {
  by : opt By;
};

type ClaimOrRefreshResponse = record {
  refreshed_neuron_id : opt NeuronId;
};

type ClaimSwapNeuronsRequest = record {
  neuron_recipes : opt NeuronRecipes;
};

type ClaimSwapNeuronsResponse = record {
  claim_swap_neurons_result : opt ClaimSwapNeuronsResult;
};

type ClaimSwapNeuronsResult = variant {
  Ok : ClaimedSwapNeurons;
  Err : int32;
};

type ClaimedSwapNeurons = record {
  swap_neurons : vec SwapNeuron;
};

type Command = variant {
  Split : Split;
  Follow : Follow;
  SetFollowing : SetFollowing;
  DisburseMaturity : DisburseMaturity;
  ClaimOrRefresh : ClaimOrRefresh;
  Configure : Configure;
  RegisterVote : RegisterVote;
  MakeProposal : Proposal;
  StakeMaturity : StakeMaturity;
  RemoveNeuronPermissions : RemoveNeuronPermissions;
  AddNeuronPermissions : AddNeuronPermissions;
  MergeMaturity : MergeMaturity;
  Disburse : Disburse;
};

type Command_1 = variant {
  Error : GovernanceError;
  Split : SplitResponse;
  Follow : record {};
  SetFollowing : record {};
  DisburseMaturity : DisburseMaturityResponse;
  ClaimOrRefresh : ClaimOrRefreshResponse;
  Configure : record {};
  RegisterVote : record {};
  MakeProposal : GetProposal;
  RemoveNeuronPermission : record {};
  StakeMaturity : StakeMaturityResponse;
  MergeMaturity : MergeMaturityResponse;
  Disburse : DisburseResponse;
  AddNeuronPermission : record {};
};

type Command_2 = variant {
  Split : Split;
  Follow : Follow;
  SetFollowing : SetFollowing;
  DisburseMaturity : DisburseMaturity;
  Configure : Configure;
  RegisterVote : RegisterVote;
  SyncCommand : record {};
  MakeProposal : Proposal;
  FinalizeDisburseMaturity : FinalizeDisburseMaturity;
  ClaimOrRefreshNeuron : ClaimOrRefresh;
  RemoveNeuronPermissions : RemoveNeuronPermissions;
  AddNeuronPermissions : AddNeuronPermissions;
  MergeMaturity : MergeMaturity;
  Disburse : Disburse;
};

type Configure = record {
  operation : opt Operation;
};

type Decimal = record {
  human_readable : opt text;
};

type DefaultFollowees = record {
  followees : vec record { nat64; Followees };
};

type DefiniteCanisterSettingsArgs = record {
  freezing_threshold : nat;
  controllers : vec principal;
  wasm_memory_limit : opt nat;
  memory_allocation : nat;
  compute_allocation : nat;
  wasm_memory_threshold : opt nat;
};

type DeregisterDappCanisters = record {
  canister_ids : vec principal;
  new_controllers : vec principal;
};

type Disburse = record {
  to_account : opt Account;
  amount : opt Amount;
};

type DisburseMaturity = record {
  to_account : opt Account;
  percentage_to_disburse : nat32;
};

type DisburseMaturityInProgress = record {
  timestamp_of_disbursement_seconds : nat64;
  amount_e8s : nat64;
  account_to_disburse_to : opt Account;
  finalize_disbursement_timestamp_seconds : opt nat64;
};

type DisburseMaturityResponse = record {
  amount_disbursed_e8s : nat64;
  amount_deducted_e8s : opt nat64;
};

type DisburseResponse = record {
  transfer_block_height : nat64;
};

type DissolveState = variant {
  DissolveDelaySeconds : nat64;
  WhenDissolvedTimestampSeconds : nat64;
};

type ExecuteGenericNervousSystemFunction = record {
  function_id : nat64;
  payload : blob;
};

type FinalizeDisburseMaturity = record {
  amount_to_be_disbursed_e8s : nat64;
  to_account : opt Account;
};

type Follow = record {
  function_id : nat64;
  followees : vec NeuronId;
};

type SetFollowing = record {
  topic_following : vec FolloweesForTopic;
};

type Followees = record {
  followees : vec NeuronId;
};

type FunctionType = variant {
  NativeNervousSystemFunction : record {};
  GenericNervousSystemFunction : GenericNervousSystemFunction;
};

type GenericNervousSystemFunction = record {
  validator_canister_id : opt principal;
  target_canister_id : opt principal;
  validator_method_name : opt text;
  target_method_name : opt text;
  topic : opt Topic;
};

type GetMaturityModulationResponse = record {
  maturity_modulation : opt MaturityModulation;
};

type GetMetadataResponse = record {
  url : opt text;
  logo : opt text;
  name : opt text;
  description : opt text;
};

type GetMetricsRequest = record {
  time_window_seconds : opt nat64;
};

type TreasuryMetrics = record {
  // Same as, e.g., `TransferSnsTreasuryFunds.from_treasury`.
  treasury : int32;

  // A human-readable identified for this treasury, e.g., "ICP".
  name : opt text;
  
  // The source of truth for the treasury balance is this ledger canister / account.
  ledger_canister_id : opt principal;
  account : opt Account;

  // The regularly updated amount of tokens in this treasury.
  amount_e8s : opt nat64;
  // The amount of tokens in this treasury at the end of swap finalization.
  original_amount_e8s : opt nat64;

  // When the metrics were last updated.
  timestamp_seconds : opt nat64;
};

type VotingPowerMetrics = record {
  governance_total_potential_voting_power : opt nat64;

  // When the metrics were last updated.
  timestamp_seconds : opt nat64;
};

type Metrics = record {
  num_recently_submitted_proposals : opt nat64;
  num_recently_executed_proposals: opt nat64;

  last_ledger_block_timestamp : opt nat64;

  // The metrics below are cached (albeit this is an implementation detail).
  treasury_metrics : opt vec TreasuryMetrics;
  voting_power_metrics : opt VotingPowerMetrics;
  genesis_timestamp_seconds : opt nat64;
};

type GetMetricsResult = variant {
  Ok : Metrics;
  Err : GovernanceError;
};

type GetMetricsResponse = record {
  get_metrics_result : opt GetMetricsResult;
};

type GetModeResponse = record {
  mode : opt int32;
};

type GetNeuron = record {
  neuron_id : opt NeuronId;
};

type GetNeuronResponse = record {
  result : opt Result;
};

type GetProposal = record {
  proposal_id : opt ProposalId;
};

type GetProposalResponse = record {
  result : opt Result_1;
};

type GetRunningSnsVersionResponse = record {
  deployed_version : opt Version;
  pending_version : opt record {
    mark_failed_at_seconds : nat64;
    checking_upgrade_lock : nat64;
    proposal_id : nat64;
    target_version : opt Version;
  };
};

type GetSnsInitializationParametersResponse = record {
  sns_initialization_parameters : text;
};

type CachedUpgradeSteps = record {
  upgrade_steps : opt Versions;
  requested_timestamp_seconds : opt nat64;
  response_timestamp_seconds : opt nat64;
};

type Governance = record {
  root_canister_id : opt principal;
  id_to_nervous_system_functions : vec record { nat64; NervousSystemFunction };
  metrics : opt GovernanceCachedMetrics;
  maturity_modulation : opt MaturityModulation;
  mode : int32;
  parameters : opt NervousSystemParameters;
  is_finalizing_disburse_maturity : opt bool;
  deployed_version : opt Version;
  cached_upgrade_steps : opt CachedUpgradeSteps;
  sns_initialization_parameters : text;
  latest_reward_event : opt RewardEvent;
  pending_version : opt PendingVersion;
  swap_canister_id : opt principal;
  ledger_canister_id : opt principal;
  proposals : vec record { nat64; ProposalData };
  in_flight_commands : vec record { text; NeuronInFlightCommand };
  sns_metadata : opt ManageSnsMetadata;
  neurons : vec record { text; Neuron };
  genesis_timestamp_seconds : nat64;
  target_version : opt Version;
  timers : opt Timers;
  upgrade_journal : opt UpgradeJournal;
};

type Timers = record {
  requires_periodic_tasks : opt bool;
  last_reset_timestamp_seconds : opt nat64;
  last_spawned_timestamp_seconds : opt nat64;
};

type GetTimersResponse = record {
  timers : opt Timers;
};

type GovernanceCachedMetrics = record {
  not_dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
  garbage_collectable_neurons_count : nat64;
  neurons_with_invalid_stake_count : nat64;
  not_dissolving_neurons_count_buckets : vec record { nat64; nat64 };
  neurons_with_less_than_6_months_dissolve_delay_count : nat64;
  dissolved_neurons_count : nat64;
  total_staked_e8s : nat64;
  total_supply_governance_tokens : nat64;
  not_dissolving_neurons_count : nat64;
  dissolved_neurons_e8s : nat64;
  neurons_with_less_than_6_months_dissolve_delay_e8s : nat64;
  dissolving_neurons_count_buckets : vec record { nat64; nat64 };
  dissolving_neurons_count : nat64;
  dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
  timestamp_seconds : nat64;
  treasury_metrics : vec TreasuryMetrics;
  voting_power_metrics : opt VotingPowerMetrics;
};

type GovernanceError = record {
  error_message : text;
  error_type : int32;
};

type IncreaseDissolveDelay = record {
  additional_dissolve_delay_seconds : nat32;
};

type ListNervousSystemFunctionsResponse = record {
  reserved_ids : vec nat64;
  functions : vec NervousSystemFunction;
};

type ListNeurons = record {
  of_principal : opt principal;
  limit : nat32;
  start_page_at : opt NeuronId;
};

type ListNeuronsResponse = record {
  neurons : vec Neuron;
};

type ListProposals = record {
  include_reward_status : vec int32;
  before_proposal : opt ProposalId;
  limit : nat32;
  exclude_type : vec nat64;
  include_status : vec int32;
  include_topics : opt vec TopicSelector;
};

type TopicSelector = record {
  topic : opt Topic;
};

type ListProposalsResponse = record {
  include_ballots_by_caller : opt bool;
  include_topic_filtering : opt bool;
  proposals : vec ProposalData;
};

type ManageDappCanisterSettings = record {
  freezing_threshold : opt nat64;
  canister_ids : vec principal;
  reserved_cycles_limit : opt nat64;
  log_visibility : opt int32;
  wasm_memory_limit : opt nat64;
  memory_allocation : opt nat64;
  compute_allocation : opt nat64;
  wasm_memory_threshold : opt nat64;
};

type SnsVersion = record {
  governance_wasm_hash : opt blob;
  swap_wasm_hash : opt blob;
  root_wasm_hash : opt blob;
  index_wasm_hash : opt blob;
  ledger_wasm_hash : opt blob;
  archive_wasm_hash : opt blob;
};

type AdvanceSnsTargetVersion = record {
  new_target : opt SnsVersion;
};

type SetTopicsForCustomProposals = record {
  custom_function_id_to_topic : vec record { nat64; Topic };
};

type ManageLedgerParameters = record {
  token_symbol : opt text;
  transfer_fee : opt nat64;
  token_logo : opt text;
  token_name : opt text;
};

type ManageNeuron = record {
  subaccount : blob;
  command : opt Command;
};

type ManageNeuronResponse = record {
  command : opt Command_1;
};

type ManageSnsMetadata = record {
  url : opt text;
  logo : opt text;
  name : opt text;
  description : opt text;
};

type MaturityModulation = record {
  current_basis_points : opt int32;
  updated_at_timestamp_seconds : opt nat64;
};

type MemoAndController = record {
  controller : opt principal;
  memo : nat64;
};

type MergeMaturity = record {
  percentage_to_merge : nat32;
};

type MergeMaturityResponse = record {
  merged_maturity_e8s : nat64;
  new_stake_e8s : nat64;
};

type MintSnsTokens = record {
  to_principal : opt principal;
  to_subaccount : opt Subaccount;
  memo : opt nat64;
  amount_e8s : opt nat64;
};

type MintSnsTokensActionAuxiliary = record {
  valuation : opt Valuation;
};

type AdvanceSnsTargetVersionActionAuxiliary = record {
  target_version : opt SnsVersion;
};

type Motion = record {
  motion_text : text;
};

type NervousSystemFunction = record {
  id : nat64;
  name : text;
  description : opt text;
  function_type : opt FunctionType;
};

type CustomProposalCriticality = record {
  additional_critical_native_action_ids : vec nat64;
};

type NervousSystemParameters = record {
  default_followees : opt DefaultFollowees;
  max_dissolve_delay_seconds : opt nat64;
  max_dissolve_delay_bonus_percentage : opt nat64;
  max_followees_per_function : opt nat64;
  neuron_claimer_permissions : opt NeuronPermissionList;
  neuron_minimum_stake_e8s : opt nat64;
  max_neuron_age_for_age_bonus : opt nat64;
  initial_voting_period_seconds : opt nat64;
  neuron_minimum_dissolve_delay_to_vote_seconds : opt nat64;
  reject_cost_e8s : opt nat64;
  max_proposals_to_keep_per_action : opt nat32;
  wait_for_quiet_deadline_increase_seconds : opt nat64;
  max_number_of_neurons : opt nat64;
  transaction_fee_e8s : opt nat64;
  max_number_of_proposals_with_ballots : opt nat64;
  max_age_bonus_percentage : opt nat64;
  neuron_grantable_permissions : opt NeuronPermissionList;
  voting_rewards_parameters : opt VotingRewardsParameters;
  maturity_modulation_disabled : opt bool;
  max_number_of_principals_per_neuron : opt nat64;
  automatically_advance_target_version : opt bool;
  custom_proposal_criticality : opt CustomProposalCriticality;
};

type FolloweesForTopic = record {
  followees : vec Followee;
  topic : opt Topic;
};

type Neuron = record {
  id : opt NeuronId;
  staked_maturity_e8s_equivalent : opt nat64;
  permissions : vec NeuronPermission;
  maturity_e8s_equivalent : nat64;
  cached_neuron_stake_e8s : nat64;
  created_timestamp_seconds : nat64;
  source_nns_neuron_id : opt nat64;
  auto_stake_maturity : opt bool;
  aging_since_timestamp_seconds : nat64;
  dissolve_state : opt DissolveState;
  voting_power_percentage_multiplier : nat64;
  vesting_period_seconds : opt nat64;
  disburse_maturity_in_progress : vec DisburseMaturityInProgress;
  followees : vec record { nat64; Followees };
  topic_followees : opt record {
    topic_id_to_followees : vec record { int32; FolloweesForTopic };
  };
  neuron_fees_e8s : nat64;
};

type NeuronId = record {
  id : blob;
};

type Followee = record {
  neuron_id : opt NeuronId;
  alias : opt text;
};

type NeuronIds = record {
  neuron_ids : vec NeuronId;
};

type NeuronInFlightCommand = record {
  command : opt Command_2;
  timestamp : nat64;
};

type NeuronPermission = record {
  "principal" : opt principal;
  permission_type : vec int32;
};

type NeuronPermissionList = record {
  permissions : vec int32;
};

type NeuronRecipe = record {
  controller : opt principal;
  dissolve_delay_seconds : opt nat64;
  participant : opt Participant;
  stake_e8s : opt nat64;
  followees : opt NeuronIds;
  neuron_id : opt NeuronId;
};

type NeuronRecipes = record {
  neuron_recipes : vec NeuronRecipe;
};

type NeuronsFund = record {
  nns_neuron_hotkeys : opt Principals;
  nns_neuron_controller : opt principal;
  nns_neuron_id : opt nat64;
};

type Operation = variant {
  ChangeAutoStakeMaturity : ChangeAutoStakeMaturity;
  StopDissolving : record {};
  StartDissolving : record {};
  IncreaseDissolveDelay : IncreaseDissolveDelay;
  SetDissolveTimestamp : SetDissolveTimestamp;
};

type Participant = variant {
  NeuronsFund : NeuronsFund;
  Direct : record {};
};

type Percentage = record {
  basis_points : opt nat64;
};

type Principals = record {
  principals : vec principal;
};

type Proposal = record {
  url : text;
  title : text;
  action : opt Action;
  summary : text;
};

type ProposalData = record {
  id : opt ProposalId;
  payload_text_rendering : opt text;
  action : nat64;
  failure_reason : opt GovernanceError;
  action_auxiliary : opt ActionAuxiliary;
  ballots : vec record { text; Ballot };
  minimum_yes_proportion_of_total : opt Percentage;
  reward_event_round : nat64;
  failed_timestamp_seconds : nat64;
  reward_event_end_timestamp_seconds : opt nat64;
  proposal_creation_timestamp_seconds : nat64;
  initial_voting_period_seconds : nat64;
  reject_cost_e8s : nat64;
  latest_tally : opt Tally;
  wait_for_quiet_deadline_increase_seconds : nat64;
  decided_timestamp_seconds : nat64;
  proposal : opt Proposal;
  proposer : opt NeuronId;
  wait_for_quiet_state : opt WaitForQuietState;
  minimum_yes_proportion_of_exercised : opt Percentage;
  is_eligible_for_rewards : bool;
  executed_timestamp_seconds : nat64;
  topic : opt Topic;
};

type ProposalId = record {
  id : nat64;
};

type QueryStats = record {
  num_calls_total : opt nat;
  num_instructions_total : opt nat;
  request_payload_bytes_total : opt nat;
  response_payload_bytes_total : opt nat;
};

type RegisterDappCanisters = record {
  canister_ids : vec principal;
};

// This type is equivalant to `ICRC3Value`, but we give it another name since it is used here not
// in the context of the ICRC-3 ledger standard. The justification is the same: The candid format
// supports sharing information even when the client and the server involved do not have the same
// schema (see the Upgrading and subtyping section of the candid spec). While this mechanism allows
// to evolve services and clients independently without breaking them, it also means that a client
// may not receive all the information that the server is sending, e.g. in case the client schema
// lacks some fields that the server schema has.
//
// This loss of information is not an option for SNS voters deciding if an extension with particular
// init args should be installed or if an extension function with particular arguments should be
// called. The client must receive the same exact data the server sent in order to verify it.
//
// Verification of a priorly installed extension is done by hashing the extension's init arg data
// and checking that the result is consistent with what has been certified by the SNS.
type PreciseValue = variant {
  Bool : bool;
  Blob : blob;
  Text : text;
  Nat : nat64;
  Int : int64;
  Array : vec PreciseValue;
  Map : vec record { text; PreciseValue };
};

type ExtensionInit = record {
  value : opt PreciseValue;
};

type RegisterExtension = record {
  chunked_canister_wasm : opt ChunkedCanisterWasm;

  extension_init : opt ExtensionInit;
};

type ExtensionOperationArg = record {
  value : opt PreciseValue;
};

type ExtensionUpgradeArg = record {
  value : opt PreciseValue;
};

type Wasm = variant {
  Bytes : blob;
  Chunked : ChunkedCanisterWasm;
};

type UpgradeExtension = record {
  extension_canister_id : opt principal;
  canister_upgrade_arg : opt ExtensionUpgradeArg;
  wasm : opt Wasm;
};

type ExecuteExtensionOperation = record {
  extension_canister_id : opt principal;

  operation_name : opt text;

  operation_arg : opt ExtensionOperationArg;
};

type ExtensionOperationSpec = record {
  operation_type : opt ExtensionOperationType;
  description : opt text;
  extension_type : opt ExtensionType;
  topic : opt Topic;
};

type ExtensionOperationType = variant {
  TreasuryManagerDeposit;
  TreasuryManagerWithdraw;
};

type ExtensionType = variant {
  TreasuryManager;
};

type RegisteredExtensionOperationSpec = record {
  canister_id : opt principal;
  spec : opt ExtensionOperationSpec;
};

type RegisterVote = record {
  vote : int32;
  proposal : opt ProposalId;
};

type RemoveNeuronPermissions = record {
  permissions_to_remove : opt NeuronPermissionList;
  principal_id : opt principal;
};

type Result = variant {
  Error : GovernanceError;
  Neuron : Neuron;
};

type Result_1 = variant {
  Error : GovernanceError;
  Proposal : ProposalData;
};

type RewardEvent = record {
  rounds_since_last_distribution : opt nat64;
  actual_timestamp_seconds : nat64;
  end_timestamp_seconds : opt nat64;
  total_available_e8s_equivalent : opt nat64;
  distributed_e8s_equivalent : nat64;
  round : nat64;
  settled_proposals : vec ProposalId;
};

type SetDissolveTimestamp = record {
  dissolve_timestamp_seconds : nat64;
};

type SetMode = record {
  mode : int32;
};

type Split = record {
  memo : nat64;
  amount_e8s : nat64;
};

type SplitResponse = record {
  created_neuron_id : opt NeuronId;
};

type StakeMaturity = record {
  percentage_to_stake : opt nat32;
};

type StakeMaturityResponse = record {
  maturity_e8s : nat64;
  staked_maturity_e8s : nat64;
};

type Subaccount = record {
  subaccount : blob;
};

type SwapNeuron = record {
  id : opt NeuronId;
  status : int32;
};

type Tally = record {
  no : nat64;
  yes : nat64;
  total : nat64;
  timestamp_seconds : nat64;
};

type Tokens = record {
  e8s : opt nat64;
};

type TransferSnsTreasuryFunds = record {
  from_treasury : int32;
  to_principal : opt principal;
  to_subaccount : opt Subaccount;
  memo : opt nat64;
  amount_e8s : nat64;
};

type UpgradeInProgress = record {
  mark_failed_at_seconds : nat64;
  checking_upgrade_lock : nat64;
  proposal_id : opt nat64;
  target_version : opt Version;
};

type PendingVersion = record {
  mark_failed_at_seconds : nat64;
  checking_upgrade_lock : nat64;
  proposal_id : opt nat64;
  target_version : opt Version;
};

type ChunkedCanisterWasm = record {
  wasm_module_hash : blob;
  store_canister_id : opt principal;
  chunk_hashes_list : vec blob;
};

type UpgradeSnsControlledCanister = record {
  new_canister_wasm : blob;
  chunked_canister_wasm : opt ChunkedCanisterWasm;
  mode : opt int32;
  canister_id : opt principal;
  canister_upgrade_arg : opt blob;
};

type Valuation = record {
  token : opt int32;
  account : opt Account;
  valuation_factors : opt ValuationFactors;
  timestamp_seconds : opt nat64;
};

type ValuationFactors = record {
  xdrs_per_icp : opt Decimal;
  icps_per_token : opt Decimal;
  tokens : opt Tokens;
};

type Version = record {
  archive_wasm_hash : blob;
  root_wasm_hash : blob;
  swap_wasm_hash : blob;
  ledger_wasm_hash : blob;
  governance_wasm_hash : blob;
  index_wasm_hash : blob;
};

type Versions = record { versions : vec Version };

type VotingRewardsParameters = record {
  final_reward_rate_basis_points : opt nat64;
  initial_reward_rate_basis_points : opt nat64;
  reward_rate_transition_duration_seconds : opt nat64;
  round_duration_seconds : opt nat64;
};

type WaitForQuietState = record {
  current_deadline_timestamp_seconds : nat64;
};

type UpgradeJournalEntry = record {
  event : opt variant {
    UpgradeStepsRefreshed : UpgradeStepsRefreshed;
    UpgradeStepsReset : UpgradeStepsReset;
    TargetVersionSet : TargetVersionSet;
    TargetVersionReset : TargetVersionReset;
    UpgradeStarted : UpgradeStarted;
    UpgradeOutcome : UpgradeOutcome;
  };
  timestamp_seconds : opt nat64;
};

type UpgradeStepsRefreshed = record {
  upgrade_steps : opt Versions;
};

type UpgradeStepsReset = record {
  human_readable : opt text;
  upgrade_steps : opt Versions;
};

type TargetVersionSet = record {
  new_target_version : opt Version;
  old_target_version : opt Version;
  is_advanced_automatically : opt bool;
};

type TargetVersionReset = record {
  new_target_version : opt Version;
  old_target_version : opt Version;
  human_readable : opt text;
};

type UpgradeStarted = record {
  current_version : opt Version;
  expected_version : opt Version;
  reason : opt variant {
    UpgradeSnsToNextVersionProposal : ProposalId;
    BehindTargetVersion : record {};
  }
};

type UpgradeOutcome = record {
  human_readable : opt text;
  status : opt variant {
    Success : record {};
    Timeout : record {};
    InvalidState : record { version : opt Version };
    ExternalFailure : record {};
  };
};

type UpgradeJournal = record {
  entries : vec UpgradeJournalEntry;
};

type GetUpgradeJournalRequest = record {
  limit : opt nat64;
  offset : opt nat64;
};

type GetUpgradeJournalResponse = record {
  upgrade_steps : opt Versions;
  response_timestamp_seconds : opt nat64;
  target_version : opt Version;
  deployed_version : opt Version;
  upgrade_journal : opt UpgradeJournal;
  upgrade_journal_entry_count: opt nat64;
};

type Topic = variant {
  DaoCommunitySettings;
  SnsFrameworkManagement;
  DappCanisterManagement;
  ApplicationBusinessLogic;
  Governance;
  TreasuryAssetManagement;
  CriticalDappOperations;
};

type TopicInfo = record {
  topic : opt Topic;
  name : opt text;
  description : opt text;
  native_functions : opt vec NervousSystemFunction;
  custom_functions : opt vec NervousSystemFunction;
  extension_operations : opt vec RegisteredExtensionOperationSpec;
  is_critical : opt bool;
};

type ListTopicsRequest = record {};
type ListTopicsResponse = record {
  topics: opt vec TopicInfo;
  uncategorized_functions: opt vec NervousSystemFunction
};

// The following types are for feature = "test"
type AddMaturityRequest = record {
  id : opt NeuronId;
  amount_e8s : opt nat64;
};

type AddMaturityResponse = record {
  new_maturity_e8s : opt nat64;
};

type MintTokensRequest = record {
  recipient : opt Account;
  amount_e8s : opt nat64;
};

type AdvanceTargetVersionRequest = record { target_version : opt Version; };
type AdvanceTargetVersionResponse = record {};

service : (Governance) -> {
  claim_swap_neurons : (ClaimSwapNeuronsRequest) -> (ClaimSwapNeuronsResponse);
  fail_stuck_upgrade_in_progress : (record {}) -> (record {});
  get_build_metadata : () -> (text) query;
  get_latest_reward_event : () -> (RewardEvent) query;
  get_maturity_modulation : (record {}) -> (GetMaturityModulationResponse);
  get_metadata : (record {}) -> (GetMetadataResponse) query;
  get_metrics : (GetMetricsRequest) -> (GetMetricsResponse) composite_query;
  get_metrics_replicated : (GetMetricsRequest) -> (GetMetricsResponse);
  get_mode : (record {}) -> (GetModeResponse) query;
  get_nervous_system_parameters : (null) -> (NervousSystemParameters) query;
  get_neuron : (GetNeuron) -> (GetNeuronResponse) query;
  get_proposal : (GetProposal) -> (GetProposalResponse) query;
  get_root_canister_status : (null) -> (CanisterStatusResultV2);
  get_running_sns_version : (record {}) -> (GetRunningSnsVersionResponse) query;
  get_sns_initialization_parameters : (record {}) -> (GetSnsInitializationParametersResponse) query;
  get_upgrade_journal : (GetUpgradeJournalRequest) -> (GetUpgradeJournalResponse) query;
  list_nervous_system_functions : () -> (ListNervousSystemFunctionsResponse) query;
  list_neurons : (ListNeurons) -> (ListNeuronsResponse) query;
  list_proposals : (ListProposals) -> (ListProposalsResponse) query;
  list_topics : (ListTopicsRequest) -> (ListTopicsResponse) query;
  manage_neuron : (ManageNeuron) -> (ManageNeuronResponse);
  set_mode : (SetMode) -> (record {});
  reset_timers : (record {}) -> (record {});
  get_timers : (record {}) -> (GetTimersResponse) query;

  // The following are methods for feature = "test"
  add_maturity : (AddMaturityRequest) -> (AddMaturityResponse);
  advance_target_version : (AdvanceTargetVersionRequest) -> (AdvanceTargetVersionResponse);
  mint_tokens : (MintTokensRequest) -> (record {});
  refresh_cached_upgrade_steps : (record {}) -> (record {});
  update_neuron : (Neuron) -> (opt GovernanceError);
}
