events.graphql 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. type Event @entity {
  2. "{blockNumber}-{indexInBlock}"
  3. id: ID!
  4. "Blocknumber of the block in which the event was emitted."
  5. inBlock: Int!
  6. "Hash of the extrinsic the event was emitted in"
  7. inExtrinsic: String @index
  8. "Index of event in block from which it was emitted."
  9. indexInBlock: Int!
  10. "Timestamp of the block the event was emitted in"
  11. timestamp: DateTime!
  12. "More specific event data, which depends on event type"
  13. data: EventData!
  14. }
  15. type Notification @entity {
  16. "Autoincremented"
  17. id: ID!
  18. "Member that should recieve the notification"
  19. member: Membership!
  20. "The notification event"
  21. event: Event!
  22. }
  23. type NftHistoryEntry @entity {
  24. "Autoincremented"
  25. id: ID!
  26. "The NFT the event relates to"
  27. nft: OwnedNft!
  28. "Nft-related event"
  29. event: Event!
  30. }
  31. type NftActivity @entity {
  32. "Autoincremented"
  33. id: ID!
  34. "The member the activity relates to"
  35. member: Membership!
  36. "Nft-related activity"
  37. event: Event!
  38. }
  39. union EventData =
  40. CommentCreatedEventData
  41. | CommentTextUpdatedEventData
  42. | OpenAuctionStartedEventData
  43. | EnglishAuctionStartedEventData
  44. | NftIssuedEventData
  45. | AuctionBidMadeEventData
  46. | AuctionBidCanceledEventData
  47. | AuctionCanceledEventData
  48. | EnglishAuctionSettledEventData
  49. | BidMadeCompletingAuctionEventData
  50. | OpenAuctionBidAcceptedEventData
  51. | NftSellOrderMadeEventData
  52. | NftBoughtEventData
  53. | BuyNowCanceledEventData
  54. | BuyNowPriceUpdatedEventData
  55. | MetaprotocolTransactionStatusEventData
  56. | ChannelRewardClaimedEventData
  57. | ChannelRewardClaimedAndWithdrawnEventData
  58. | ChannelFundsWithdrawnEventData
  59. | ChannelPayoutsUpdatedEventData
  60. | ChannelPaymentMadeEventData
  61. | MemberBannedFromChannelEventData
  62. # Atlas use-case: `GetCommentEdits` query
  63. type CommentCreatedEventData {
  64. "The comment that was added"
  65. comment: Comment!
  66. "Comment's original text"
  67. text: String!
  68. }
  69. # Atlas use-case: `GetCommentEdits` query
  70. type CommentTextUpdatedEventData {
  71. "The comment being updated"
  72. comment: Comment!
  73. "New comment text"
  74. newText: String!
  75. # Only author can edit the comment, so no actor context required
  76. }
  77. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  78. type OpenAuctionStartedEventData {
  79. "Actor that started this auction."
  80. actor: ContentActor!
  81. "Nft owner at the time it was put on an auction."
  82. nftOwner: NftOwner!
  83. "Auction started."
  84. auction: Auction!
  85. }
  86. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  87. type EnglishAuctionStartedEventData {
  88. "Actor that started this auction."
  89. actor: ContentActor!
  90. "Nft owner at the time it was put on an auction."
  91. nftOwner: NftOwner!
  92. "Auction started."
  93. auction: Auction!
  94. }
  95. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  96. type NftIssuedEventData {
  97. "Actor that issued the NFT."
  98. actor: ContentActor!
  99. "NFT that was issued."
  100. nft: OwnedNft!
  101. "NFT's initial owner."
  102. nftOwner: NftOwner!
  103. }
  104. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  105. type AuctionBidMadeEventData {
  106. "The bid that was submitted "
  107. bid: Bid!
  108. "Nft owner at the time it was being auctioned."
  109. nftOwner: NftOwner!
  110. }
  111. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  112. type AuctionBidCanceledEventData {
  113. "Member that canceled the bid."
  114. member: Membership!
  115. "Nft owner at the time it was being auctioned."
  116. nftOwner: NftOwner!
  117. "The bid that got canceled."
  118. bid: Bid!
  119. }
  120. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  121. type AuctionCanceledEventData {
  122. "Content actor canceling the auction."
  123. actor: ContentActor!
  124. "Nft owner at the time the auction was being auctioned."
  125. nftOwner: NftOwner!
  126. "Auction that was canceled."
  127. auction: Auction!
  128. }
  129. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  130. type EnglishAuctionSettledEventData {
  131. "English auction winning bid"
  132. winningBid: Bid!
  133. "NFT owner before the english auction was settled"
  134. previousNftOwner: NftOwner!
  135. }
  136. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  137. type BidMadeCompletingAuctionEventData {
  138. "Bid that completed the auction"
  139. winningBid: Bid!
  140. "NFT owner before the auction was completed"
  141. previousNftOwner: NftOwner!
  142. }
  143. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  144. type OpenAuctionBidAcceptedEventData {
  145. "Content actor that accepted the bid."
  146. actor: ContentActor!
  147. "Accepted/winning bid"
  148. winningBid: Bid!
  149. "NFT owner before the auction was completed"
  150. previousNftOwner: NftOwner!
  151. }
  152. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  153. type NftSellOrderMadeEventData {
  154. "NFT being sold"
  155. nft: OwnedNft!
  156. "Content actor acting as NFT owner."
  157. actor: ContentActor!
  158. "NFT owner at the time it was put on sale"
  159. nftOwner: NftOwner!
  160. "Offer's price."
  161. price: BigInt!
  162. }
  163. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  164. type NftBoughtEventData {
  165. "The NFT that was bought"
  166. nft: OwnedNft!
  167. "Member that bought the NFT."
  168. buyer: Membership!
  169. "NFT owner before it was bought"
  170. previousNftOwner: NftOwner!
  171. "Price for which the NFT was bought"
  172. price: BigInt!
  173. }
  174. # Atlas use-case: `GetNftActivities` and `GetNftHistory`
  175. type BuyNowCanceledEventData {
  176. "The NFT for which the buy now offer was canceled"
  177. nft: OwnedNft!
  178. "Content actor acting as NFT owner."
  179. actor: ContentActor!
  180. "Owner of the NFT at the time the buy now offer was canceled."
  181. nftOwner: NftOwner!
  182. }
  183. # Atlas use-case: `GetNftActivities` and `GetNftHistory`
  184. type BuyNowPriceUpdatedEventData {
  185. "NFT being sold"
  186. nft: OwnedNft!
  187. "Content actor acting as NFT owner."
  188. actor: ContentActor!
  189. "NFT owner at the time it was on sale"
  190. nftOwner: NftOwner!
  191. "New sell order price."
  192. newPrice: BigInt!
  193. }
  194. type MetaprotocolTransactionResultCommentCreated {
  195. commentCreated: Comment
  196. }
  197. type MetaprotocolTransactionResultCommentEdited {
  198. commentEdited: Comment
  199. }
  200. type MetaprotocolTransactionResultCommentDeleted {
  201. commentDeleted: Comment
  202. }
  203. type MetaprotocolTransactionResultCommentModerated {
  204. commentModerated: Comment
  205. }
  206. type MetaprotocolTransactionResultChannelPaid {
  207. channelPaid: Channel
  208. }
  209. type MetaprotocolTransactionResultOK {
  210. phantom: Int
  211. }
  212. type MetaprotocolTransactionResultFailed {
  213. errorMessage: String!
  214. }
  215. union MetaprotocolTransactionResult =
  216. MetaprotocolTransactionResultOK
  217. | MetaprotocolTransactionResultCommentCreated
  218. | MetaprotocolTransactionResultCommentEdited
  219. | MetaprotocolTransactionResultCommentDeleted
  220. | MetaprotocolTransactionResultCommentModerated
  221. | MetaprotocolTransactionResultFailed
  222. | MetaprotocolTransactionResultChannelPaid
  223. type MetaprotocolTransactionStatusEventData {
  224. "The result of metaprotocol action"
  225. result: MetaprotocolTransactionResult!
  226. }
  227. type ChannelRewardClaimedEventData {
  228. "The channel that claimed the reward"
  229. channel: Channel!
  230. "Reward amount claimed"
  231. amount: BigInt!
  232. }
  233. type ChannelRewardClaimedAndWithdrawnEventData {
  234. "The channel that claimed the reward"
  235. channel: Channel!
  236. "Reward amount claimed"
  237. amount: BigInt!
  238. "Destination account ID. Null if claimed by curators' channel (paid to council budget in this case)"
  239. account: String
  240. "Content actor"
  241. actor: ContentActor!
  242. }
  243. type ChannelFundsWithdrawnEventData {
  244. "The channel that claimed the reward"
  245. channel: Channel!
  246. "Reward amount claimed"
  247. amount: BigInt!
  248. "Destination account ID. Null if claimed by curators' channel (paid to council budget in this case)"
  249. account: String
  250. "Content actor"
  251. actor: ContentActor!
  252. }
  253. type ChannelPayoutsUpdatedEventData {
  254. "Merkle root of the channel payouts"
  255. commitment: String
  256. "Storage data object corresponding to the channel payouts payload"
  257. payloadDataObject: StorageDataObject
  258. "Minimum amount of channel reward cashout allowed at a time"
  259. minCashoutAllowed: BigInt
  260. "Maximum amount of channel reward cashout allowed at a time"
  261. maxCashoutAllowed: BigInt
  262. "Can channel cashout the rewards"
  263. channelCashoutsEnabled: Boolean
  264. }
  265. type PaymentContextVideo {
  266. "Video for which the payment was made"
  267. video: Video!
  268. }
  269. type PaymentContextChannel {
  270. "Channel for which the payment was made"
  271. channel: Channel!
  272. }
  273. "Various Channel Payment Contexts"
  274. union PaymentContext = PaymentContextVideo | PaymentContextChannel
  275. "Direct channel payment by any member by-passing the council payouts"
  276. type ChannelPaymentMadeEventData {
  277. "Actor that made the payment"
  278. payer: Membership!
  279. "Amount of the payment"
  280. amount: BigInt!
  281. "Payment and payee context"
  282. paymentContext: PaymentContext
  283. "Channel that received the payment (if any)"
  284. payeeChannel: Channel
  285. "Reason of the payment"
  286. rationale: String
  287. }
  288. # This event is emitted both when a member is banned and when they are unbanned
  289. type MemberBannedFromChannelEventData {
  290. "The chanel the member is being banned / unbanned from"
  291. channel: Channel!
  292. "The member being banned / unbanned"
  293. member: Membership!
  294. "The action performed. TRUE if the member is being banned, FALSE if the member is being unbanned"
  295. action: Boolean!
  296. }