This repository has been archived by the owner on Jan 17, 2024. It is now read-only.
generated from subsquid-labs/squid-substrate-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
schema.graphql
82 lines (74 loc) · 1.55 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
type Account @entity {
id: ID!
publicKey: ID! @index
transfers: [Transfer!] @derivedFrom(field: "account")
rewards: [StakingReward!] @derivedFrom(field: "account")
identity: Identity @derivedFrom(field: "account")
sub: IdentitySub @derivedFrom(field: "account")
}
enum TransferDirection {
From
To
}
# entity for linking account and transfer
type Transfer @entity {
id: ID!
transfer: NativeTransfer
account: Account!
direction: TransferDirection
}
type NativeTransfer @entity {
id: ID!
blockNumber: Int! @index
timestamp: DateTime! @index
extrinsicHash: String @index
from: Account!
to: Account!
amount: BigInt! @index
success: Boolean!
}
type StakingReward @entity {
id: ID!
timestamp: DateTime!
blockNumber: Int! @index
extrinsicHash: String @index
account: Account!
amount: BigInt!
era: Int
validatorId: ID
}
type IdentityAdditionalField {
name: String
value: String
}
enum Judgement {
Unknown
FeePaid
Reasonable
KnownGood
OutOfDate
LowQuality
Erroneous
}
type Identity @entity {
id: ID!
account: Account! @unique
judgement: Judgement!
subs: [IdentitySub!] @derivedFrom(field: "super")
additional: [IdentityAdditionalField!]
display: String
legal: String
web: String
riot: String
email: String
pgpFingerprint: String
image: String
twitter: String
isKilled: Boolean!
}
type IdentitySub @entity {
id: ID!
super: Identity
account: Account! @unique
name: String
}