-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.graphql
92 lines (82 loc) · 2.41 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
type Block @entity {
id: ID!
network: String! @index
number: Int! @index
timestamp: DateTime! @index
}
type Transaction @entity {
id: ID!
network: String! @index
blockNumber: Int @index
blockTimestamp: DateTime! @index
hash: String! @index
to: String @index
from: String @index
status: Int @index
}
# Prefixed with RentalStarted
# to make it explicit that it is to be used
# only in context of the RentalStarted entity
type RentalStartedItem @entity {
id: ID! @index
rentalStarted: RentalStarted!
itemType: Int! # an enum actually. RENTAL: 0, PAYMENT: 1
settleTo: Int! # an enum actually. LENDER: 0, RENTER: 1
token: String! # address
amount: BigInt! # uint256
identifier: BigInt! # uint256
}
# Prefixed with RentalStarted
# to make it explicit that it is to be used
# only in context of the RentalStarted entity
# and to avoid collision with the hook table in api
type RentalStartedHook @entity {
id: ID! @index
rentalStarted: RentalStarted!
target: String! # address
itemIndex: BigInt! # uint256
extraData: String! # bytes
}
type RentalStarted @entity {
id: ID!
network: String! @index
blockNumber: Int! @index
blockTimestamp: DateTime! @index
transactionHash: String! @index
contract: String! @index
eventName: String! @index
orderHash: String! @index # bytes32
emittedExtraData: String! # bytes
seaportOrderHash: String! @index # bytes32
items: [RentalStartedItem!]! @derivedFrom(field: "rentalStarted")
hooks: [RentalStartedHook!]! @derivedFrom(field: "rentalStarted")
orderType: Int! # OrderType
lender: String! @index # address
renter: String! @index # address
rentalWallet: String! @index # address
startTimestamp: BigInt! # uint256
endTimestamp: BigInt! # uint256
}
type RentalStopped @entity {
id: ID!
network: String! @index
blockNumber: Int! @index
blockTimestamp: DateTime! @index
transactionHash: String! @index
contract: String! @index
eventName: String! @index
seaportOrderHash: String! @index
stopper: String! @index
}
type RentalSafeDeployment @entity {
id: ID!
network: String! @index
blockNumber: Int! @index
blockTimestamp: DateTime! @index
transactionHash: String! @index
contract: String! @index
eventName: String! @index
safe: String! @index # address
owners: [String!]! # address[]
threshold: BigInt! # uint256
}