-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.graphql
129 lines (118 loc) · 2.82 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
type Overview @entity {
id: ID!
totalListings: BigInt!
totalRents: BigInt!
administrativeOperator: Bytes!
}
type Metaverse @entity {
id: ID!
name: String!
registries: [MetaverseRegistry!]! @derivedFrom(field: "metaverse")
}
type MetaverseRegistry @entity {
id: ID!
name: String!
symbol: String!
metaverse: Metaverse!
isRemoved: Boolean!
}
type PaymentToken @entity {
"Address of the token or 0x0 for ETH"
id: ID!
feePercentage: BigInt!
name: String!
symbol: String!
decimals: Int!
isRemoved: Boolean!
}
enum AssetStatus {
LISTED,
DELISTED,
WITHDRAWN
}
type Asset @entity {
id: ID!
metaverse: Metaverse!
metaverseRegistry: MetaverseRegistry!
metaverseAssetId: BigInt!
owner: User!
consumer: User!
minPeriod: BigInt!
maxPeriod: BigInt!
maxFutureTime: BigInt!
paymentToken: PaymentToken!
unclaimedRentFee: BigInt!
pricePerSecond: BigInt!
lastRentEnd: BigInt!
lastRentTimestamp: BigInt!
status: AssetStatus!
decentralandData: DecentralandData
rents: [Rent!]! @derivedFrom(field: "asset")
totalRents: BigInt!
claimHistory: [ClaimHistory!]! @derivedFrom(field: "asset")
txHash: String!
"list tx block.timestamp"
timestamp: BigInt!
"withdraw tx block.timestamp"
withdrawTimestamp: BigInt
operator: Bytes
}
type Rent @entity {
"ID is generated: assetId-rentId"
id: ID!
asset: Asset!
renter: User!
start: BigInt!
end: BigInt!
paymentToken: PaymentToken!
fee: BigInt!
txHash: String!
"tx block.timestamp"
timestamp: BigInt!
operator: Bytes
"asset's metaverse"
metaverse: Metaverse!
}
type ClaimHistory @entity {
"ID is generated: 'assetId-txHash-logIndex' or 'distributorAddress-txHash-logIndex'"
id: ID!
asset: Asset
receiver: User!
paymentToken: PaymentToken!
amount: BigInt!
txHash: String!
"tx block.timestamp"
timestamp: BigInt!
"asset's metaverse"
metaverse: Metaverse!
}
type User @entity {
id: ID!
assets: [Asset!]! @derivedFrom(field: "owner")
rents: [Rent!]! @derivedFrom(field: "renter")
consumerTo: [Asset!]! @derivedFrom(field: "consumer")
claimHistory: [ClaimHistory!]! @derivedFrom(field: "receiver")
referralRewards: [ReferralReward!] @derivedFrom(field: "user")
}
type ReferralReward @entity {
"ID Is generated: user-paymentToken"
id: ID!
user: User!
paymentToken: PaymentToken!
amount: BigInt!
}
type DecentralandData @entity {
"ID is generated: registry-tokenId"
id: ID!
asset: Asset!
metadata: String!
isLAND: Boolean!
coordinates: [CoordinatesLAND!]! @derivedFrom(field: "data")
}
type CoordinatesLAND @entity {
"ID is generated: x-y"
id: ID!
x: BigInt!
y: BigInt!
data: DecentralandData!
}