forked from octopus-appchains/subql-debionetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
79 lines (63 loc) · 1.61 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
type Block @entity {
id: ID!
number: BigInt @index
timestamp: Date @index
parentHash: String
specVersion: Int
extrinsics: [Extrinsic] @derivedFrom(field: "block")
events: [Event] @derivedFrom(field: "block")
}
type Extrinsic @entity {
id: ID!
hash: String!
method: String @index
section: String @index
args: String
signer: Account @index #create relation to account
nonce: BigInt
timestamp: Date @index
signature: String
tip: BigInt
isSigned: Boolean
isSuccess: Boolean
block: Block #create relation to block
events: [Event] @derivedFrom(field: "extrinsic")
calls: [Call] @derivedFrom(field: "extrinsic")
}
type Event @entity {
id: ID!
index: Int!
section: String! @index
method: String! @index
data: String!
block: Block #create relation to block
extrinsic: Extrinsic #create relation to extrins
}
type Call @entity {
id: ID!
section: String @index
method: String @index
args: String
timestamp: Date @index
isSuccess: Boolean
signer: Account #create ration to account
extrinsic: Extrinsic #create relation to extrinsic
parentCall: Call #create relation to call
calls: [Call] @derivedFrom(field: "parentCall")
}
type Account @entity {
id: ID!
timestamp: Date!
extrinsics: [Extrinsic] @derivedFrom(field: "signer")
calls: [Call] @derivedFrom(field: "signer")
transferIn: [SystemTokenTransfer] @derivedFrom(field: "to")
transferOut: [SystemTokenTransfer] @derivedFrom(field: "from")
}
type SystemTokenTransfer @entity {
id: ID!
from: Account @index
to: Account @index
amount: BigInt @index
timestamp: Date @index
extrinsic: Extrinsic
}