events.graphql 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. | MemberBannedFromChannelEventData
  57. # Atlas use-case: `GetCommentEdits` query
  58. type CommentCreatedEventData {
  59. "The comment that was added"
  60. comment: Comment!
  61. "Comment's original text"
  62. text: String!
  63. }
  64. # Atlas use-case: `GetCommentEdits` query
  65. type CommentTextUpdatedEventData {
  66. "The comment being updated"
  67. comment: Comment!
  68. "New comment text"
  69. newText: String!
  70. # Only author can edit the comment, so no actor context required
  71. }
  72. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  73. type OpenAuctionStartedEventData {
  74. "Actor that started this auction."
  75. actor: ContentActor!
  76. "Nft owner at the time it was put on an auction."
  77. nftOwner: NftOwner!
  78. "Auction started."
  79. auction: Auction!
  80. }
  81. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  82. type EnglishAuctionStartedEventData {
  83. "Actor that started this auction."
  84. actor: ContentActor!
  85. "Nft owner at the time it was put on an auction."
  86. nftOwner: NftOwner!
  87. "Auction started."
  88. auction: Auction!
  89. }
  90. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  91. type NftIssuedEventData {
  92. "Actor that issued the NFT."
  93. actor: ContentActor!
  94. "NFT that was issued."
  95. nft: OwnedNft!
  96. "NFT's initial owner."
  97. nftOwner: NftOwner!
  98. }
  99. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  100. type AuctionBidMadeEventData {
  101. "The bid that was submitted "
  102. bid: Bid!
  103. "Nft owner at the time it was being auctioned."
  104. nftOwner: NftOwner!
  105. }
  106. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  107. type AuctionBidCanceledEventData {
  108. "Member that canceled the bid."
  109. member: Membership!
  110. "Nft owner at the time it was being auctioned."
  111. nftOwner: NftOwner!
  112. "The bid that got canceled."
  113. bid: Bid!
  114. }
  115. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  116. type AuctionCanceledEventData {
  117. "Content actor canceling the auction."
  118. actor: ContentActor!
  119. "Nft owner at the time the auction was being auctioned."
  120. nftOwner: NftOwner!
  121. "Auction that was canceled."
  122. auction: Auction!
  123. }
  124. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  125. type EnglishAuctionSettledEventData {
  126. "English auction winning bid"
  127. winningBid: Bid!
  128. "NFT owner before the english auction was settled"
  129. previousNftOwner: NftOwner!
  130. }
  131. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  132. type BidMadeCompletingAuctionEventData {
  133. "Bid that completed the auction"
  134. winningBid: Bid!
  135. "NFT owner before the auction was completed"
  136. previousNftOwner: NftOwner!
  137. }
  138. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  139. type OpenAuctionBidAcceptedEventData {
  140. "Content actor that accepted the bid."
  141. actor: ContentActor!
  142. "Accepted/winning bid"
  143. winningBid: Bid!
  144. "NFT owner before the auction was completed"
  145. previousNftOwner: NftOwner!
  146. }
  147. # Atlas use-case: `GetNftActivities` and `GetNftHistory` query
  148. type NftSellOrderMadeEventData {
  149. "NFT being sold"
  150. nft: OwnedNft!
  151. "Content actor acting as NFT owner."
  152. actor: ContentActor!
  153. "NFT owner at the time it was put on sale"
  154. nftOwner: NftOwner!
  155. "Offer's price."
  156. price: BigInt!
  157. }
  158. # Atlas use-case: `GetNftActivities`, `GetNftHistory` and `GetNotifications` query
  159. type NftBoughtEventData {
  160. "The NFT that was bought"
  161. nft: OwnedNft!
  162. "Member that bought the NFT."
  163. buyer: Membership!
  164. "NFT owner before it was bought"
  165. previousNftOwner: NftOwner!
  166. "Price for which the NFT was bought"
  167. price: BigInt!
  168. }
  169. # Atlas use-case: `GetNftActivities` and `GetNftHistory`
  170. type BuyNowCanceledEventData {
  171. "The NFT for which the buy now offer was canceled"
  172. nft: OwnedNft!
  173. "Content actor acting as NFT owner."
  174. actor: ContentActor!
  175. "Owner of the NFT at the time the buy now offer was canceled."
  176. nftOwner: NftOwner!
  177. }
  178. # Atlas use-case: `GetNftActivities` and `GetNftHistory`
  179. type BuyNowPriceUpdatedEventData {
  180. "NFT being sold"
  181. nft: OwnedNft!
  182. "Content actor acting as NFT owner."
  183. actor: ContentActor!
  184. "NFT owner at the time it was on sale"
  185. nftOwner: NftOwner!
  186. "New sell order price."
  187. newPrice: BigInt!
  188. }
  189. type MetaprotocolTransactionResultCommentCreated {
  190. commentCreated: Comment
  191. }
  192. type MetaprotocolTransactionResultCommentEdited {
  193. commentEdited: Comment
  194. }
  195. type MetaprotocolTransactionResultCommentDeleted {
  196. commentDeleted: Comment
  197. }
  198. type MetaprotocolTransactionResultCommentModerated {
  199. commentModerated: Comment
  200. }
  201. type MetaprotocolTransactionResultOK {
  202. phantom: Int
  203. }
  204. type MetaprotocolTransactionResultFailed {
  205. errorMessage: String!
  206. }
  207. union MetaprotocolTransactionResult =
  208. MetaprotocolTransactionResultOK
  209. | MetaprotocolTransactionResultCommentCreated
  210. | MetaprotocolTransactionResultCommentEdited
  211. | MetaprotocolTransactionResultCommentDeleted
  212. | MetaprotocolTransactionResultCommentModerated
  213. | MetaprotocolTransactionResultFailed
  214. type MetaprotocolTransactionStatusEventData {
  215. "The result of metaprotocol action"
  216. result: MetaprotocolTransactionResult!
  217. }
  218. # This event is emitted both when a member is banned and when they are unbanned
  219. type MemberBannedFromChannelEventData {
  220. "The chanel the member is being banned / unbanned from"
  221. channel: Channel!
  222. "The member being banned / unbanned"
  223. member: Membership!
  224. "The action performed. TRUE if the member is being banned, FALSE if the member is being unbanned"
  225. action: Boolean!
  226. }