-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
122 lines (104 loc) · 2.78 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
type Domain @entity {
id: ID! # The namehash of the name
name: String # The human readable name, if known. Unknown portions replaced with hash in square brackets (eg, foo.[1234].etc)
labelName: String # The human readable label name (imported from CSV), if known
labelhash: Bytes # keccak256(labelName)
parent: Domain # The namehash (id) of the parent name
subdomains: [Domain!]! @derivedFrom(field: "parent") # Can count domains from length of array
resolvedAddress: Account # Address logged from current resolver, if any
owner: Account!
resolver: Resolver
ttl: BigInt
isMigrated: Boolean!
events: [DomainEvent!]! @derivedFrom(field: "domain")
}
interface DomainEvent {
id: ID!
domain: Domain!
blockNumber: Int!
transactionID: Bytes!
}
type Transfer implements DomainEvent @entity {
id: ID!
domain: Domain!
blockNumber: Int!
transactionID: Bytes!
owner: Account!
}
type NewOwner implements DomainEvent @entity {
id: ID!
domain: Domain!
blockNumber: Int!
transactionID: Bytes!
owner: Account!
}
type NewResolver implements DomainEvent @entity {
id: ID!
domain: Domain!
blockNumber: Int!
transactionID: Bytes!
resolver: Resolver!
}
type NewTTL implements DomainEvent @entity {
id: ID!
domain: Domain!
blockNumber: Int!
transactionID: Bytes!
ttl: BigInt!
}
type Account @entity {
id: ID!
domains: [Domain!]! @derivedFrom(field: "owner")
deeds: [Deed!]! @derivedFrom(field: "owner")
registrations: [Registration!] @derivedFrom(field: "registrant")
}
enum AuctionState {
AUCTION
FINALIZED
RELEASED
FORBIDDEN
}
type Deed @entity {
id: ID!
owner: Account!
value: BigInt!
name: AuctionedName @derivedFrom(field: "deed")
}
type AuctionedName @entity {
id: ID!
domain: Domain
registrationDate: BigInt!
releaseDate: BigInt
deed: Deed
secondBid: BigInt
bidCount: Int!
state: AuctionState!
}
type Registration @entity {
id: ID!
domain: Domain
registrationDate: BigInt!
expiryDate: BigInt!
registrant: Account!
}
interface RegistrationEvent {
id: ID!
registration: Registration!
blockNumber: Int!
transactionID: Bytes!
}
type Resolver @entity {
id: ID! # Concatenation of resolver address and namehash
domain: Domain!
address: Bytes! # Address of resolver contract
addr: Account # Current value of addr record (per events)
texts: [String!] # Set of observed text record keys
coinTypes: [Int!] # Set of observed SLIP-44 coin types
events: [ResolverEvent!]! @derivedFrom(field: "resolver")
}
interface ResolverEvent {
id: ID! # Concatenation of block number and log ID
resolver: Resolver! # Used to derive relationships to Resolvers
blockNumber: Int!
transactionID: Bytes!
}