proposals.graphql 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. "The final proposal status is not yet decided, the council can still submit votes that may impact the outcome."
  2. type ProposalStatusDeciding @variant {
  3. "Related ProposalStatusUpdatedEvent"
  4. proposalStatusUpdatedEvent: ProposalStatusUpdatedEvent
  5. }
  6. "The proposal is awaiting execution until the specified trigger block, or GRACING_LIMIT blocks since start of period if no trigger was provided."
  7. type ProposalStatusGracing @variant {
  8. "Related ProposalStatusUpdatedEvent"
  9. proposalStatusUpdatedEvent: ProposalStatusUpdatedEvent
  10. }
  11. "The proposal was approved by current council, but requires further approvals to satisfy CONSTITUTIONALITY requirement. Transitions to Deciding stage when next council is elected."
  12. type ProposalStatusDormant @variant {
  13. "Related ProposalStatusUpdatedEvent"
  14. proposalStatusUpdatedEvent: ProposalStatusUpdatedEvent
  15. }
  16. "Was halted by sudo or by council through veto-proposal. "
  17. type ProposalStatusVetoed @variant {
  18. "Related ProposalDecisionMadeEvent event"
  19. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  20. }
  21. "The proposal was successfully executed"
  22. type ProposalStatusExecuted @variant {
  23. "Related ProposalExecutedEvent"
  24. proposalExecutedEvent: ProposalExecutedEvent
  25. }
  26. "The proposal executution has failed."
  27. type ProposalStatusExecutionFailed @variant {
  28. "Related ProposalExecutedEvent"
  29. proposalExecutedEvent: ProposalExecutedEvent
  30. "The runtime execution error message"
  31. errorMessage: String!
  32. }
  33. "The proposal was rejected and the associated stake was slashed."
  34. type ProposalStatusSlashed @variant {
  35. "Related ProposalDecisionMadeEvent"
  36. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  37. }
  38. "The proposal was rejected."
  39. type ProposalStatusRejected @variant {
  40. "Related ProposalDecisionMadeEvent"
  41. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  42. }
  43. "The proposal didn't recieve enough votes and the voting period has expired."
  44. type ProposalStatusExpired @variant {
  45. "Related ProposalDecisionMadeEvent"
  46. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  47. }
  48. "The proposal was cancelled by the original proposer."
  49. type ProposalStatusCancelled @variant {
  50. "The related ProposalCancelledEvent"
  51. cancelledInEvent: ProposalCancelledEvent
  52. }
  53. "The proposal was canceled by the runtime (for example, due to runtime upgrade). No cancellation fee was applied."
  54. type ProposalStatusCanceledByRuntime @variant {
  55. "Related ProposalDecisionMadeEvent"
  56. proposalDecisionMadeEvent: ProposalDecisionMadeEvent
  57. }
  58. "Intermediate / pending proposal status, the final status is still to be determined"
  59. union ProposalIntermediateStatus = ProposalStatusDeciding | ProposalStatusGracing | ProposalStatusDormant
  60. "Proposal status after the voting stage has finished for the current council."
  61. union ProposalDecisionStatus = # Approved:
  62. ProposalStatusDormant
  63. | ProposalStatusGracing # Not approved:
  64. | ProposalStatusVetoed
  65. | ProposalStatusSlashed
  66. | ProposalStatusRejected
  67. | ProposalStatusExpired
  68. | ProposalStatusCancelled
  69. | ProposalStatusCanceledByRuntime
  70. "Statuses representing approved proposal post-execution result"
  71. union ProposalExecutionStatus = ProposalStatusExecuted | ProposalStatusExecutionFailed
  72. "All valid proposal statuses"
  73. union ProposalStatus = # Intermediate statuses:
  74. ProposalStatusDeciding
  75. | ProposalStatusGracing
  76. | ProposalStatusDormant # Final statuses:
  77. | ProposalStatusVetoed
  78. | ProposalStatusExecuted
  79. | ProposalStatusExecutionFailed
  80. | ProposalStatusSlashed
  81. | ProposalStatusRejected
  82. | ProposalStatusExpired
  83. | ProposalStatusCancelled
  84. | ProposalStatusCanceledByRuntime
  85. type Proposal @entity {
  86. "Proposal's runtime id"
  87. id: ID!
  88. "Proposal title"
  89. title: String! @fulltext(query: "proposalsByTitle")
  90. "Proposal description"
  91. description: String!
  92. "Proposal details depending on proposal type"
  93. details: ProposalDetails!
  94. "Staking account with proposal stake (in case a stake is required)"
  95. stakingAccount: String
  96. "Proposal creator"
  97. creator: Membership!
  98. "The event the proposal was created in"
  99. createdInEvent: ProposalCreatedEvent! @derivedFrom(field: "proposal")
  100. "Exact block number the proposal is supposed to be executed at (if specified)"
  101. exactExecutionBlock: Int
  102. "Proposal's discussion thread"
  103. discussionThread: ProposalDiscussionThread! @derivedFrom(field: "proposal")
  104. "How many prior councils have already approved the proposal (starts with 0)"
  105. councilApprovals: Int!
  106. "List of proposal (intermediate) status update events (to Deciding, Dormant or Gracing status)"
  107. proposalStatusUpdates: [ProposalStatusUpdatedEvent!] @derivedFrom(field: "proposal")
  108. "List of proposal votes (in form of ProposalVotedEvents)"
  109. votes: [ProposalVotedEvent!] @derivedFrom(field: "proposal")
  110. "Current proposal status"
  111. status: ProposalStatus!
  112. "If true then the proposal status is final and will not change form this point"
  113. isFinalized: Boolean
  114. # Additional fileds to avoid the need for complex filtering through status variant relations:
  115. "Number of the block the current status was set at"
  116. statusSetAtBlock: Int!
  117. "Time the current status was set at (based on block timestamp)"
  118. statusSetAtTime: DateTime!
  119. }
  120. type SignalProposalDetails @variant {
  121. "Signal proposal content"
  122. text: String!
  123. }
  124. type RuntimeWasmBytecode @entity {
  125. "Blake2b hash of the runtime bytecode"
  126. id: ID!
  127. "The bytecode itself"
  128. bytecode: Bytes!
  129. }
  130. type RuntimeUpgradeProposalDetails @variant {
  131. "Runtime upgrade WASM bytecode"
  132. newRuntimeBytecode: RuntimeWasmBytecode!
  133. }
  134. type FundingRequestDestination @entity {
  135. "Amount of funds requested"
  136. amount: BigInt!
  137. "Destination account"
  138. account: String!
  139. "The list that this funding request destination is part of"
  140. list: FundingRequestDestinationsList!
  141. }
  142. # We need to have additional intermediate FundingRequestDestinationsList entity,
  143. # because varaints don't directly support One-to-Many relationships
  144. type FundingRequestDestinationsList @entity {
  145. # Prevents "GraphQLError: Input Object type FundingRequestDestinationsListUpdateInput must define one or more fields."
  146. _phantom: Int
  147. "List of funding request destinations"
  148. destinations: [FundingRequestDestination!] @derivedFrom(field: "list")
  149. }
  150. type FundingRequestProposalDetails @variant {
  151. # Workaround for lack of direct One-to-Many relationships
  152. "Related list of funding request destinations"
  153. destinationsList: FundingRequestDestinationsList!
  154. }
  155. type SetMaxValidatorCountProposalDetails @variant {
  156. "The new (propsed) max. number of active validators"
  157. newMaxValidatorCount: Int!
  158. }
  159. type CreateWorkingGroupLeadOpeningProposalDetails @variant {
  160. "The opening metadata"
  161. metadata: WorkingGroupOpeningMetadata!
  162. "Min. application / role stake amount"
  163. stakeAmount: BigInt!
  164. "Role stake unstaking period in blocks"
  165. unstakingPeriod: Int!
  166. "Initial workers' reward per block"
  167. rewardPerBlock: BigInt!
  168. "Related working group"
  169. group: WorkingGroup!
  170. }
  171. type FillWorkingGroupLeadOpeningProposalDetails @variant {
  172. "Lead opening to to be filled"
  173. opening: WorkingGroupOpening!
  174. "Selected successful application"
  175. application: WorkingGroupApplication!
  176. }
  177. type UpdateWorkingGroupBudgetProposalDetails @variant {
  178. "Amount to increase / decrease the working group budget by (will be decudted from / appended to council budget accordingly)"
  179. amount: BigInt!
  180. "Related working group"
  181. group: WorkingGroup!
  182. }
  183. type DecreaseWorkingGroupLeadStakeProposalDetails @variant {
  184. "The lead that should be affected"
  185. lead: Worker!
  186. "Amount to decrease the stake by"
  187. amount: BigInt!
  188. }
  189. type SlashWorkingGroupLeadProposalDetails @variant {
  190. "The lead that should be affected"
  191. lead: Worker!
  192. "Amount to slash the stake by"
  193. amount: BigInt!
  194. }
  195. type SetWorkingGroupLeadRewardProposalDetails @variant {
  196. "The lead that should be affected"
  197. lead: Worker!
  198. "Lead's new (proposed) reward per block"
  199. newRewardPerBlock: BigInt!
  200. }
  201. type TerminateWorkingGroupLeadProposalDetails @variant {
  202. "Lead that's supposed to be terminated"
  203. lead: Worker!
  204. "Optionally - the amount to slash the lead's stake by"
  205. slashingAmount: BigInt
  206. }
  207. type AmendConstitutionProposalDetails @variant {
  208. "New (proposed) constitution text (md-formatted)"
  209. text: String!
  210. }
  211. type CancelWorkingGroupLeadOpeningProposalDetails @variant {
  212. "Opening to be cancelled"
  213. opening: WorkingGroupOpening!
  214. }
  215. type SetMembershipPriceProposalDetails @variant {
  216. "New (proposed) membership price"
  217. newPrice: BigInt!
  218. }
  219. type SetCouncilBudgetIncrementProposalDetails @variant {
  220. "New (proposed) amount the council budget should be increased by per each budget period"
  221. newAmount: BigInt!
  222. }
  223. type SetCouncilorRewardProposalDetails @variant {
  224. "New (proposed) council members' reward per block"
  225. newRewardPerBlock: BigInt!
  226. }
  227. type SetInitialInvitationBalanceProposalDetails @variant {
  228. "The new (proposed) initial balance credited to controller account of an invitee (locked for transaction fee payments only)"
  229. newInitialInvitationBalance: BigInt!
  230. }
  231. type SetInitialInvitationCountProposalDetails @variant {
  232. "The new (proposed) initial invitations count for paid memberships"
  233. newInitialInvitationsCount: Int!
  234. }
  235. type SetMembershipLeadInvitationQuotaProposalDetails @variant {
  236. "The new (proposed) membership working group lead invitation quota"
  237. newLeadInvitationQuota: Int!
  238. }
  239. type SetReferralCutProposalDetails @variant {
  240. "The new (proposed) percentage of tokens diverted to referrer (from referred member's membership price)."
  241. newReferralCut: Int!
  242. }
  243. type CreateBlogPostProposalDetails @variant {
  244. "Blog post title"
  245. title: String!
  246. "Blog post content (md-formatted)"
  247. body: String!
  248. }
  249. type EditBlogPostProposalDetails @variant {
  250. "The related blog post"
  251. # TODO: Change to relationship once Blog module is supported
  252. blogPost: ID!
  253. "The new blog post title (if should be updated)"
  254. newTitle: String
  255. "The new blog post body (if should be updated)"
  256. newBody: String
  257. }
  258. type LockBlogPostProposalDetails @variant {
  259. "The blog post that should be locked"
  260. # TODO: Change to relationship once Blog module is supported
  261. blogPost: ID!
  262. }
  263. type UnlockBlogPostProposalDetails @variant {
  264. "The blog post that should be unlocked"
  265. # TODO: Change to relationship once Blog module is supported
  266. blogPost: ID!
  267. }
  268. type VetoProposalDetails @variant {
  269. "Proposal to be vetoed"
  270. proposal: Proposal!
  271. }
  272. union ProposalDetails =
  273. SignalProposalDetails
  274. | RuntimeUpgradeProposalDetails
  275. | FundingRequestProposalDetails
  276. | SetMaxValidatorCountProposalDetails
  277. | CreateWorkingGroupLeadOpeningProposalDetails
  278. | FillWorkingGroupLeadOpeningProposalDetails
  279. | UpdateWorkingGroupBudgetProposalDetails
  280. | DecreaseWorkingGroupLeadStakeProposalDetails
  281. | SlashWorkingGroupLeadProposalDetails
  282. | SetWorkingGroupLeadRewardProposalDetails
  283. | TerminateWorkingGroupLeadProposalDetails
  284. | AmendConstitutionProposalDetails
  285. | CancelWorkingGroupLeadOpeningProposalDetails
  286. | SetMembershipPriceProposalDetails
  287. | SetCouncilBudgetIncrementProposalDetails
  288. | SetCouncilorRewardProposalDetails
  289. | SetInitialInvitationBalanceProposalDetails
  290. | SetInitialInvitationCountProposalDetails
  291. | SetMembershipLeadInvitationQuotaProposalDetails
  292. | SetReferralCutProposalDetails
  293. | CreateBlogPostProposalDetails
  294. | EditBlogPostProposalDetails
  295. | LockBlogPostProposalDetails
  296. | UnlockBlogPostProposalDetails
  297. | VetoProposalDetails