contentNft.graphql 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. # TODO: add runtime ids to entities (`id: ID!`) where it's needed and possible
  2. # TODO: move `ContentActor*` to `content.graphql` after schema/mappings are finished
  3. # keep it here for easier reviews
  4. type ContentActorCurator @variant {
  5. "Type needs to have at least one non-relation entity. This value is not used."
  6. dummy: Int
  7. curator: Curator!
  8. }
  9. type ContentActorMember @variant {
  10. "Type needs to have at least one non-relation entity. This value is not used."
  11. dummy: Int
  12. member: Membership!
  13. }
  14. type ContentActorLead @variant {
  15. "Type needs to have at least one non-relation entity. This value is not used."
  16. dummy: Int
  17. }
  18. type ContentActorCollaborator @variant {
  19. "Type needs to have at least one non-relation entity. This value is not used."
  20. dummy: Int
  21. member: Membership!
  22. }
  23. union ContentActor = ContentActorCurator | ContentActorMember | ContentActorLead | ContentActorCollaborator
  24. type CuratorGroup @entity {
  25. "Runtime identifier"
  26. id: ID!
  27. "Is group active or not"
  28. isActive: Boolean!
  29. "Curators belonging to this group"
  30. curators: [Curator!]! @derivedFrom(field: "curatorGroups")
  31. "Channels curated by this group"
  32. channels: [Channel!]! @derivedFrom(field: "ownerCuratorGroup")
  33. }
  34. type Curator @entity {
  35. "Runtime identifier"
  36. id: ID!
  37. "Type needs to have at least one non-relation entity. This value is not used."
  38. dummy: Int
  39. curatorGroups: [CuratorGroup!]!
  40. }
  41. "Represents NFT details"
  42. type OwnedNft
  43. @entity { # NFT in name can't be UPPERCASE because it causes codegen errors
  44. "NFT's video"
  45. video: Video! @derivedFrom(field: "nft")
  46. "Auctions done for this NFT"
  47. auctions: [Auction!]! @derivedFrom(field: "nft")
  48. "Member owning the NFT. Channel owner owns the NFT if not set."
  49. ownerMember: Membership
  50. "NFT's metadata"
  51. metadata: String!
  52. "NFT transactional status"
  53. transactionalStatus: TransactionalStatus!
  54. "History of transacional status changes"
  55. transactionalStatusUpdates: [TransactionalStatusUpdate!]! @derivedFrom(field: "nft")
  56. "Creator royalty"
  57. creatorRoyalty: Float
  58. }
  59. type TransactionalStatusUpdate @entity {
  60. "Video NFT details"
  61. nft: OwnedNft!
  62. "NFT transactional status"
  63. transactionalStatus: TransactionalStatus!
  64. "Block number at which change happened"
  65. changedAt: Int!
  66. }
  67. "NFT transactional state"
  68. union TransactionalStatus =
  69. TransactionalStatusIdle
  70. | TransactionalStatusInitiatedOfferToMember
  71. | TransactionalStatusAuction
  72. | TransactionalStatusBuyNow
  73. "Represents TransactionalStatus Idle"
  74. type TransactionalStatusIdle @variant {
  75. "Type needs to have at least one non-relation entity. This value is not used."
  76. dummy: Int
  77. }
  78. "Represents TransactionalStatus InitiatedOfferToMember"
  79. type TransactionalStatusInitiatedOfferToMember @variant {
  80. "Member identifier"
  81. memberId: Int!
  82. "Whether member should pay to accept offer (optional)"
  83. price: BigInt
  84. }
  85. "Represents TransactionalStatus Auction"
  86. type TransactionalStatusAuction @variant {
  87. "Type needs to have at least one non-relation entity. This value is not used."
  88. dummy: Int
  89. "Auction"
  90. auction: Auction!
  91. }
  92. "Represents TransactionalStatus BuyNow"
  93. type TransactionalStatusBuyNow @variant {
  94. price: BigInt!
  95. }
  96. "Represents various action types"
  97. union AuctionType = AuctionTypeEnglish | AuctionTypeOpen
  98. "Represents English auction details"
  99. type AuctionTypeEnglish @variant {
  100. "English auction duration"
  101. duration: Int!
  102. "Auction extension time"
  103. extensionPeriod: Int
  104. }
  105. "Represents Open auction details"
  106. type AuctionTypeOpen @variant {
  107. "Auction bid lock duration"
  108. bidLockingTime: Int!
  109. }
  110. "Represents NFT auction"
  111. type Auction @entity {
  112. "Auctioned NFT"
  113. nft: OwnedNft!
  114. "Member starting NFT auction. If not set channel owner started auction"
  115. initialOwner: Membership
  116. "Member that won this auction"
  117. winningMember: Membership
  118. "Auction starting price"
  119. startingPrice: BigInt!
  120. "Whether auction can be completed instantly"
  121. buyNowPrice: BigInt
  122. # TODO: maybe there is a need to distinguish regular auction completion from buy now
  123. "The type of auction"
  124. auctionType: AuctionType!
  125. "Minimal step between auction bids"
  126. minimalBidStep: BigInt!
  127. "Auction last bid (if exists)"
  128. lastBid: Bid
  129. bids: [Bid!]! @derivedFrom(field: "auction")
  130. "Block when auction starts"
  131. startsAtBlock: Int!
  132. "Block when auction ended"
  133. endedAtBlock: Int
  134. "Block when auction is supposed to end"
  135. plannedEndAtBlock: Int
  136. "Is auction canceled"
  137. isCanceled: Boolean!
  138. "Is auction completed"
  139. isCompleted: Boolean!
  140. "Auction participants whitelist"
  141. whitelistedMembers: [Membership!]! @derivedFrom(field: "whitelistedInAuctions")
  142. }
  143. "Represents bid in NFT auction"
  144. type Bid @entity {
  145. "NFT's auction"
  146. auction: Auction!
  147. "Bidder membership"
  148. bidder: Membership!
  149. # TODO: probably remove that
  150. #"Bidder account, used to pay for NFT"
  151. #bidderAccount: String!
  152. "Amount bidded"
  153. amount: BigInt!
  154. "Sign for canceled bid"
  155. isCanceled: Boolean!
  156. "Block in which the bid was placed"
  157. createdInBlock: Int!
  158. }
  159. # TODO entity for (cancelable) offers; will be needed to see history of offers