-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphql
163 lines (144 loc) · 3.18 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
enum NftState {
NONE
CLOSED_PORTAL
OPENED_PORTAL
AAVEGOTCHI
AAVEGOTCHI_LAND
AVATAR
WAVATAR
SPACESHIP
WSPACESHIP
}
enum NftType {
AAVEGOTCHI
AAVEGOTCHI_LAND
NOVAAVATAR
WNOVAAVATAR
NOVASPACESHIP
WNOVASPACESHIP
TRAVELER
WTRAVELER
COMETHSPACESHIP
}
type Nft @entity(immutable: false) {
id: ID!
address: String!
state: NftState!
type: NftType!
tokenId: BigInt!
platform: String!
currentOwner: Account!
previousOwner: Account!
originalOwner: Account!
currentRental: Rental
rentalHistory: [Rental!]! @derivedFrom(field: "nft")
currentDirectRental: DirectRental
directRentalHistory: [DirectRental!]! @derivedFrom(field: "nft")
currentRentalOffer: RentalOffer
rentalOfferHistory: [RentalOffer!]! @derivedFrom(field: "nfts")
lastOfferExpirationAt: BigInt!
}
type Account @entity(immutable: false) {
id: ID!
nfts: [Nft!]! @derivedFrom(field: "originalOwner")
borrowings: [Rental!]! @derivedFrom(field: "borrower")
lendings: [Rental!]! @derivedFrom(field: "lender")
}
type DirectRental @entity(immutable: false) {
id: ID!
nft: Nft!
lender: Account!
taker: String
startedAt: BigInt!
startedTxHash: String!
endedAt: BigInt
endedTxHash: String
expirationDate: BigInt
profitShareTokens: [String!]
profitShareSplit: [BigInt!]
rentalEarnings: [RentalEarning!] @derivedFrom(field: "directRental")
}
type Rental @entity(immutable: false) {
id: ID!
nft: Nft!
borrower: Account!
lender: Account!
startedAt: BigInt!
startedTxHash: String!
endedAt: BigInt
endedTxHash: String
expirationDate: BigInt
rentalOffer: RentalOffer
rentalEarnings: [RentalEarning!] @derivedFrom(field: "rental")
beneficiaries: [String!]
}
type RentalOffer @entity(immutable: false) {
id: ID!
nfts: [Nft!]!
lender: Account!
createdAt: BigInt!
cancelledAt: BigInt
creationTxHash: String!
cancellationTxHash: String
executionTxHash: String
duration: [BigInt!]
rentals: [Rental!] @derivedFrom(field: "rentalOffer")
feeToken: String
feeAmount: BigInt
taker: String
expirationDate: BigInt!
profitShareTokens: [String!]
profitShareSplit: [BigInt!]
}
type RentalEarning @entity(immutable: false) {
id: ID! # ${txHash}-${logIndex}
tokenAddress: String!
amount: BigInt!
nft: Nft!
txHash: String!
timestamp: BigInt!
eventName: String!
rental: Rental
directRental: DirectRental
}
type AavegotchiLand @entity(immutable: false) {
id: ID!
nft: Nft!
channelingAccessRight: BigInt!
emptyReservoirAccessRight: BigInt!
channelingWhitelist: BigInt!
emptyReservoirWhitelist: BigInt!
}
type ClaimedToken @entity {
id: ID!
rental: Rental!
token: String!
amount: BigInt!
}
type Control @entity {
id: ID!
lastNftTransferred: Nft!
}
type Approval @entity {
id: ID!
owner: Bytes! # address
approved: Bytes! # address
tokenId: BigInt! # uint256
}
type ApprovalForAll @entity {
id: ID!
owner: Bytes! # address
operator: Bytes! # address
approved: Boolean! # bool
}
type OwnershipTransferred @entity {
id: ID!
previousOwner: Bytes! # address
newOwner: Bytes! # address
}
type ContractTransfer @entity {
id: ID!
from: Bytes! # address
to: Bytes! # address
tokenId: BigInt! # uint256
}