################### Council ####################################################

type AnnouncingPeriodStartedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###
}

type NotEnoughCandidatesEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###
}

type VotingPeriodStartedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Number of candidates in the election."
  numOfCandidates: BigInt!
}

type NewCandidateEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Related candidate."
  candidate: Candidate!

  "Candidate's account used to stake currency."
  stakingAccount: String!

  "Candidate's account that will be recieving rewards if candidate's elected."
  rewardAccount: String!

  "Amount of currency to be staked for the candidacy."
  balance: BigInt!
}

type NewCouncilElectedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Newly elected council."
  electedCouncil: ElectedCouncil!
}

type NewCouncilNotElectedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###
}

type CandidacyStakeReleaseEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Related candidate."
  candidate: Candidate!
}

type CandidacyWithdrawEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Related candidate."
  candidate: Candidate!
}

type CandidacyNoteSetEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Related candidate."
  candidate: Candidate!

  "The metadata contained in note."
  noteMetadata: CandidacyNoteMetadata!
}

type RewardPaymentEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Related council member."
  councilMember: CouncilMember!

  "Candidate's account that will be recieving rewards if candidate's elected."
  rewardAccount: String!

  "Amount paid to the council member"
  paidBalance: BigInt!

  "Amount that couldn't be paid and will be paid the next time."
  missingBalance: BigInt!
}

type BudgetBalanceSetEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Budget balance that has been set."
  balance: BigInt!
}

type BudgetRefillEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Balance that has been refilled."
  balance: BigInt!
}

type BudgetRefillPlannedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  nextRefillInBlock: Int!
}

type BudgetIncrementUpdatedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Amount that is added to the budget each time it's refilled."
  amount: BigInt!
}

type CouncilorRewardUpdatedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "New reward amount paid each reward period."
  rewardAmount: BigInt!
}

type RequestFundedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Target account."
  account: String!

  "Funding amount."
  amount: BigInt!
}

################### Referendum #################################################

type ReferendumStartedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Amount of winning referendum options."
  winningTargetCount: BigInt!
}

type ReferendumStartedForcefullyEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Amount of winning referendum options."
  winningTargetCount: BigInt!
}

type RevealingStageStartedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###
}

type ReferendumFinishedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###
}

type VoteCastEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Vote cast."
  castVote: CastVote!
}

type VoteRevealedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Vote cast."
  castVote: CastVote!
}

type StakeReleasedEvent implements Event @entity {
  ### GENERIC DATA ###

  "(network}-{blockNumber}-{indexInBlock}"
  id: ID!

  "Hash of the extrinsic which caused the event to be emitted"
  inExtrinsic: String

  "Blocknumber of the block in which the event was emitted."
  inBlock: Int!

  "Network the block was produced in"
  network: Network!

  "Index of event in block from which it was emitted."
  indexInBlock: Int!

  ### SPECIFIC DATA ###

  "Account used to stake the value."
  stakingAccount: String!
}